EZMIRROR
VRChat world mirror switching prefab

Copyright (c) 2026 NiAka

============================================================
日本語
============================================================

概要
----

EzMirror は、VRChat ワールド向けのミラー切替 Prefab です。
1つの VRCMirrorReflection に複数の Profile を用意し、Off / HQ / 半透明 / LQ
などの状態を切り替えられます。

Prefab を配置して基本セットアップを実行し、ミラー面、スイッチUI、Trigger の
位置と大きさを調整するだけで使い始められます。

配布ページ
----------

https://vpm.2aka.io/packages/com.niaka.ezmirror

必要環境
--------

・Unity 2022.3 LTS
・VRChat Worlds SDK 3.10.4 以降の互換環境
・UdonSharp が利用できる VRChat Worlds SDK 環境
・com.unity.ugui 1.0.0
・PC / Quest 基本対応

Quest では、PC専用に設定した Profile はスキップされます。

セットアップ
------------

1. Runtime/Prefabs/EzMirror.prefab を Scene に配置します。
2. ルートの EzMirror Inspector で「基本セットアップを自動実行」を押します。
3. Step 1 でミラー面の位置、回転、大きさを調整します。
4. Step 2 でスイッチUIの位置と入力方法を調整します。
5. Step 3 でミラーを表示し続ける範囲の Box を調整します。
6. Step 4 でフェード距離を調整します。
7. 必要に応じて Profile、保存、効果音、振動を調整します。
8. 設定チェックが「問題なし」になることを確認します。

通常は、Transform と Trigger の大きさをワールドに合わせるだけで十分です。

使い方
------

切替方法は組み合わせて使えます。

uGUI:
  レーザーまたはクリックで Toggle UI を操作します。

Interact:
  Use 操作で次の Profile へ切り替えます。

手の Contact:
  Avatar の手や指の Contact Sender で切り替えます。

選択中のミラー状態はユーザーごとのローカル状態です。
EzMirror はミラーの切替状態をグローバル同期しません。

Profile
-------

Profile 0:
  Off 固定です。ミラーは非表示になります。

Profile 1 以降:
  ミラー表示、画質、透明度、PC専用設定、アイコン、追加オブジェクトなどを
  設定できます。

Profile Asset には、Scene に依存しない設定だけを保存します。
Scene 内オブジェクト、入力UI、Trigger などは EzMirror 本体側で管理します。

高度な使い方
------------

UI や SendCustomEvent から、次の引数なしメソッドを呼び出せます。

  SendCustomEvent("SelectNextFromUgui")
  SendCustomEvent("SelectNext")
  SendCustomEvent("TurnOff")
  SendCustomEvent("ResetToDefault")

他の UdonSharp スクリプトから特定の Profile を選ぶ場合は、EzMirror 参照を
持って SelectProfile(int profileIndex) を呼びます。

profileIndex は 0 が Off、1 が Profile 1 です。

トラブルシューティング
----------------------

ミラーが表示されない:
  EzMirror Inspector の設定チェックを確認してください。
  必要に応じて、開発者オプションの修復機能や Material 再生成を確認します。

Quest で HQ ミラーが表示されない:
  PC専用 Profile は非PC環境でスキップされます。
  Quest 用に使う LQ Profile が PC専用になっていないか確認してください。

Contact が反応しない:
  Avatar 側の Contact Sender を想定しています。
  Step 2 の詳細設定で Contact タグと Local Only の設定を確認してください。

Trigger 境界付近で表示が揺れる:
  Trigger の Box を少し広げるか、Trigger Refresh Interval を少し長めにします。

更新履歴
--------

1.0.2
  Profile 切り替え時、複数の Profile で同じオブジェクトをON対象にしている場合の表示状態を修正しました。

1.0.0
  初回リリース

同梱テキスト
------------

README.txt   この説明書です。
LICENSE.txt  利用条件です。


============================================================
English
============================================================

Overview
--------

EzMirror is a mirror switching prefab for VRChat worlds.
It lets one VRCMirrorReflection use multiple profiles, such as Off, HQ,
Transparent, and LQ.

Place the prefab, run the basic setup, then adjust the mirror surface, switch UI,
and trigger size for your world.

Distribution Page
-----------------

https://vpm.2aka.io/packages/com.niaka.ezmirror

Requirements
------------

- Unity 2022.3 LTS
- VRChat Worlds SDK 3.10.4 or a compatible later environment
- A VRChat Worlds SDK environment with UdonSharp support
- com.unity.ugui 1.0.0
- Basic PC / Quest support

Profiles marked as PC-only are skipped on Quest and other non-PC platforms.

Setup
-----

1. Place Runtime/Prefabs/EzMirror.prefab in your Scene.
2. On the root EzMirror Inspector, click the basic auto setup button.
3. In Step 1, adjust the mirror position, rotation, and size.
4. In Step 2, adjust the switch UI position and input methods.
5. In Step 3, adjust the Box that keeps the mirror visible.
6. In Step 4, adjust the fade distance.
7. If needed, adjust profiles, local save, sound, and haptic feedback.
8. Confirm that the setup check reports no problems.

In most cases, you only need to adjust the Transform and Trigger size for your
world.

Usage
-----

You can combine multiple switching methods.

uGUI:
  Use laser or click input on the Toggle UI.

Interact:
  Use the object to switch to the next profile.

Hand Contact:
  Use avatar hand or finger Contact Senders to switch profiles.

The selected mirror state is local to each user.
EzMirror does not synchronize the selected state globally.

Profiles
--------

Profile 0:
  Fixed Off state. The mirror is hidden.

Profile 1 and later:
  Configure mirror visibility, quality, transparency, PC-only behavior, icons,
  and extra objects.

Profile Assets store only settings that do not depend on the Scene.
Scene objects, input UI, and Triggers are managed on the EzMirror component.

Advanced Use
------------

You can call these no-argument methods from UI events or SendCustomEvent.

  SendCustomEvent("SelectNextFromUgui")
  SendCustomEvent("SelectNext")
  SendCustomEvent("TurnOff")
  SendCustomEvent("ResetToDefault")

From another UdonSharp script, keep an EzMirror reference and call
SelectProfile(int profileIndex) to select a specific profile.

profileIndex 0 is Off, and 1 is Profile 1.

Troubleshooting
---------------

Mirror does not appear:
  Check the setup validation in the EzMirror Inspector.
  If needed, check the repair tools or material regeneration in developer options.

HQ mirror does not appear on Quest:
  PC-only profiles are skipped on non-PC platforms.
  Confirm that the LQ profile for Quest is not marked as PC-only.

Contact does not react:
  EzMirror expects avatar Contact Senders.
  Check the Contact tag and Local Only settings in Step 2 advanced settings.

Visibility flickers around the trigger boundary:
  Make the Trigger Box slightly larger, or increase Trigger Refresh Interval.

Changelog
---------

1.0.2
  Fixed profile object visibility when the same object is turned on by multiple profiles.

1.0.0
  Initial release

Included Text Files
-------------------

README.txt   This guide.
LICENSE.txt  License and terms.
