EZMIRROR
Mirror gimmick for VRChat worlds

Copyright (c) 2026 NiAka

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

概要
----

「EzMirror」は、【かんたん設置・かんたん設定・かんたんカスタマイズ】を
合言葉にした「NiAka Ez シリーズ」のワールド向けミラーギミックです。

設定項目は EzMirror の設定画面に集約しています。
画面の説明に沿って上から順に進めるだけで、
オフ / 高画質 / 半透明 / 低負荷 などの基本設定を行えます。

プレイヤーだけ表示、半透明表示、フェード距離の調整など、
VRChat のミラーでよく使う機能をひとつにまとめました。

ミラーの種類ごとに別オブジェクトを増やすのではなく、
ひとつのミラーオブジェクトで設定を切り替える設計です。
階層を増やしすぎず、ワールド内のミラーを管理できます。

主な特徴
--------

・設定画面の説明に沿って、配置後の基本設定を順番に進められます。
・ひとつのミラーオブジェクトで、オフ / 高画質 / 半透明 / 低負荷 などを
  切り替えられます。
・ミラーの種類ごとの複製を抑え、階層を管理しやすくできます。
・フェード距離用マテリアルを自動生成し、表示範囲外ではミラーを自動的に非表示にします。
・エディタ上でミラー面を好きなプレビュー色で表示できるため、
  通常のミラーより位置や大きさを確認しやすくなります。
・初期設定済みのオリジナル 3D スイッチモデルを同梱しています。
  そのまま使うことも、ワールドに合わせてカスタマイズすることもできます。

配布・導入
----------

VCC / ALCOM をお使いの場合は、VPM リポジトリからの導入を強くおすすめします。
https://vpm.2aka.io/

パッケージページ:
https://vpm.2aka.io/packages/com.niaka.ezmirror

BOOTH ダウンロード版には .unitypackage と、VPM リポジトリ追加用の
ショートカットを同梱しています。VCC / ALCOM にリポジトリを追加してから、
EzMirror をプロジェクトへ追加してください。

.unitypackage から直接インポートすることもできますが、依存関係や更新管理のため、
通常は VPM リポジトリ経由での導入をおすすめします。

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

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

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

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

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

通常は、位置・回転・大きさと表示範囲をワールドに合わせるだけで基本設定は完了します。

使い方
------

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

画面ボタン（uGUI）:
  レーザーまたはクリックで切り替えボタンを操作します。

インタラクト:
  インタラクト操作で次のミラー設定へ切り替えます。

手の接触判定:
  アバターの手や指に設定した接触判定で切り替えます。

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

切り替え設定
------------

設定 0:
  オフ固定です。ミラーは非表示になります。

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

設定アセットには、シーンに依存しない設定だけを保存します。
シーン内オブジェクト、入力用の画面要素、表示範囲判定などは EzMirror 本体側で管理します。

上級者向けの使い方
------------

画面ボタンや SendCustomEvent から、次の引数なしメソッドを呼び出せます。

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

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

profileIndex は 0 がオフ、1 が設定 1 です。

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

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

Quest で高画質ミラーが選択されない / 表示されない:
  PC 専用のミラー設定は PC 以外の環境でスキップされます。
  Quest 用に使う低負荷設定が PC 専用になっていないか確認してください。

手の接触判定で切り替わらない:
  アバター側の接触判定を想定しています。
  手順 2 の詳細設定で接触判定のタグと Local Only の設定を確認してください。

表示範囲の境界付近で表示が揺れる:
  表示範囲のボックスを少し広げるか、更新間隔を少し長めにします。

クレジット
----------

3Dモデル制作:
  針ネズミ 様
  X(Twitter): https://x.com/harinezumi2001

デバッグ協力:
  針ネズミ 様
  X(Twitter): https://x.com/harinezumi2001

  らぱん伯爵 様
  X(Twitter): https://x.com/lapin_the3rd

  汐音ノア 様
  X(Twitter): https://x.com/Nonkey_ff14

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

1.1.1
  ドキュメント整理のみの更新です。
  VPM リポジトリ経由での導入案内を追加しました。

1.1.0
  配布文言と制作協力クレジットを整理しました。
  実行時用 / エディタ用 asmdef の参照を整理しました。
  UdonSharp パッケージとして必要なアセンブリ境界を検証で固定しました。

1.0.5
  プレハブバリアント / シーン上の個別配置ごとに、エディタのプレビュー色を設定できるようにしました。
  共有プレビュー用マテリアルや実行時 / ビルド用マテリアルには影響しません。

1.0.4
  切り替え設定の追加・削除時に、表示/非表示オブジェクトや詳細設定が前の値を引き継いで見える場合がある問題を修正しました。
  古い設定データでも、未完成の表示/非表示オブジェクト設定が実行時に誤作動しないようにしました。

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

1.0.0
  初回リリース

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

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


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

Overview
--------

EzMirror is a mirror gimmick for VRChat worlds in the NiAka Ez Series,
built around easy placement, easy setup, and easy customization.

The main settings are centralized in the EzMirror Inspector. Follow the guidance
from top to bottom to complete the basic setup.

EzMirror brings together common VRChat mirror needs, such as player-only display,
semi-transparent display, and easier fade-distance adjustment.

Instead of adding a separate mirror object for each mirror type, EzMirror updates
the state of one mirror object. This keeps your Hierarchy easier to manage
while still giving you multiple mirror profiles.

Key Points
----------

- Step-by-step Inspector for setup after placing the prefab.
- Switch a single mirror object across Off, High Quality, Transparent, Low Load, and other profiles.
- Cleaner hierarchy with fewer duplicated mirror objects.
- Automatic fade-distance material generation and mirror hiding outside the display range.
- Custom editor preview color to make the mirror position and size easier to check.
- Includes a preconfigured original 3D switch model. Use it as-is, or customize
  it for your world.

Distribution and Installation
-----------------------------

If you use VCC or ALCOM, installing from the VPM repository is strongly recommended.
https://vpm.2aka.io/

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

The BOOTH download includes a .unitypackage and a shortcut for adding the
VPM repository. Add the repository to VCC or ALCOM, then add EzMirror to your project.

Direct .unitypackage import is also available, but the VPM repository is recommended
for dependency and update management.

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 support for PC and Quest

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 mirror transform and display range
for your world.

Usage
-----

You can combine multiple switching methods.

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

Interact:
  Interact with 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 is 0 for Off, and 1 for 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.

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

Contact switching does not work:
  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.

Credits
-------

3D model production:
  針ネズミ (@harinezumi2001)
  X(Twitter): https://x.com/harinezumi2001

Debug support:
  針ネズミ (@harinezumi2001)
  X(Twitter): https://x.com/harinezumi2001

  らぱん伯爵 (@lapin_the3rd)
  X(Twitter): https://x.com/lapin_the3rd

  汐音ノア (@Nonkey_ff14)
  X(Twitter): https://x.com/Nonkey_ff14

Changelog
---------

1.1.1
  Documentation-only update.
  Added installation guidance for the VPM repository.

1.1.0
  Updated distribution copy and contributor credits.
  Cleaned up Runtime / Editor asmdef references.
  Added validation for the UdonSharp package assembly boundaries.

1.0.5
  Added per-Prefab Variant / Scene instance editor preview color settings.
  The setting does not modify the shared preview material or runtime/build materials.

1.0.4
  Fixed cases where newly added or removed profile settings could appear to reuse previous object and detail values.
  Incomplete profile object entries are now ignored safely at runtime, even in older setup data.

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.
