照明・壁スイッチ・ブレーカー|部屋ごとに停電・復旧できるUnityプレハブ / Branch Light
- ダウンロード商品¥ 500



廊下のブレーカーを落とすと、廊下だけが暗くなり、隣室の灯りはついたまま。復旧すると、それぞれの壁スイッチの位置に従って灯りが戻ります。住宅の普段の照明にも、探索ゲームで配電盤を探して電気を戻す場面にも使えます。 すぐに試す Light.unitypackage をすべてインポートし、Assets/BranchLight/Circuit.unity を開いて Play。配電盤の「A HALL」をクリックすると、廊下の左灯が消えます。もう一度押すと左灯が戻り、元々消していた右灯は消えたままです。 自分のゲームに置く BranchLight.prefab をシーンに置くと、廊下と隣室の2回路、灯具3灯、壁スイッチ3個、ブレーカー2個が接続済みです。自分のシーンには有効なカメラと、音を聞くための Audio Listener を用意してください。自分のリアルタイム照明も、回路のInspectorで連動先の壁スイッチを選び、Lightをドラッグして「Connect / 登録」を押すと追加できます。操作音は壁スイッチとブレーカーで個別に変更できます。 同梱物 Unityパッケージ、日英README、利用規約。パッケージには設置用プレハブ、デモシーン、材質、C#ソース、操作音2種、照明登録用のInspectorを収録。動画の廊下と事務室はデモシーンの使用例です。追加ライトは、自作の光源を登録した場合の撮影例です。 検証環境 Unity 2022.3.22f1 / Built-in / 従来入力。新規プロジェクトへのImport、別シーンでのプレハブ配置、追加Lightの登録処理・保存・再読み込みを確認。Play ModeとWindows x64単体版で回路分離、復旧、停電中のスイッチ変更を自動検証しました。Windows単体版では実際のマウスクリックでも停電・復旧・右灯の点灯を確認しています。URP、HDRP、新Input Systemのみの構成、VRChat、複数人同期は未検証です。ベイク済みの光は制御対象外です。 利用条件 商用利用、改変、完成作品への組み込みを許可します。素材単体での再配布・再販売はできません。 Branch Light | Interactive lights, wall switches and circuit breakers for Unity Cut the corridor circuit and the office stays lit. Restore power and each corridor lamp follows the position of its own wall switch. Use the same prefab for everyday room lighting or a scene where the player has to find the panel to restore power. Try the demo Import all of Light.unitypackage, open Assets/BranchLight/Circuit.unity and press Play. Click A HALL on the panel to cut the corridor lights. Click again to restore the left lamp. The right lamp stays off until you operate its wall switch. Add it to your scene Place BranchLight.prefab in the scene. Two circuits, three fixtures, three wall switches and two breakers are already connected. Provide an active camera and an Audio Listener for sound. To connect your own realtime Light, select the circuit, choose a wall switch in its Inspector, drag in the Light and click Connect. The wall switch and breaker sounds can each be replaced with your own AudioClip. Contents Unity package, English/Japanese guides and terms of use. The package includes the prefab, demo scene, materials, C# source, two original switch sounds and a custom Inspector for connecting lights. The rooms in the video are the demo setting. The additional light illustrates how to connect your own light source. Tested in Unity 2022.3.22f1, Built-in Render Pipeline, legacy input. Verified import into a clean project, placement in a separate scene, and the persistence of a newly connected Light after saving and reopening. Automated Play Mode and Windows x64 standalone checks covered independent circuits, restoration and changing a switch during an outage. Mouse clicks in the Windows build also verified an outage, restoration and switching on the second corridor lamp. URP, HDRP, new-input-only setups, VRChat and multiplayer are untested. The controls operate realtime lights and do not change baked lighting. Terms of use Commercial use, modification and incorporation into finished works are permitted. Redistribution or resale as standalone assets is prohibited.


