1.0.0 • Published 2 years ago
jp.suzuryg.local-switch-generator v1.0.0
LocalSwitchGenerator
This tool allows you to easily create local switch gimmicks in world production using the Cluster Creator Kit.
- You can switch objects ON/OFF for each player
- Timeline method is used, so it can be applied to any object.
- When used on Item-type objects, behavior may change from other players
Requirements
- Unity 2021.3 / Cluster Creator Kit v1.17.0
Installation
from disk
- Download and unzip the latest release
- Open the "Packages" window from the Unity menu Window > Package Manager
- From the "+" button at the top left of the window, select "Add package from disk" and open the
package.json
in the unzipped folder
scoped registries
- Open Packages/manifest.json and edit as follows:
{
"scopedRegistries": [
{
"name": "suzuryg",
"url": "https://registry.npmjs.com",
"scopes": [ "jp.suzuryg" ]
}
],
"dependencies": {
"jp.suzuryg.local-switch-generator": "1.0.0",
...
How to Use
Generate Local Switch
- Open the tool window from Unity menu Tools > LocalSwitchGenerator
- Set the object you want to switch ON/OFF in "Target Object" field
- Set the object you want to use as the ON/OFF button in "Button" field
- Press the "Generate" button to create the local switch gimmick
- Item component and InteractItemTrigger component will be added to the button
- A gimmick object named "Switch_XXX" (XXX is the name of the target object) will be created
Delete Local Switch
- Remove the Item component and InteractItemTrigger component from the button
- Delete the "Switch_XXX" object
References
Creating Timeline-Style Local Gimmicks in Cluster
LocalSwitchGenerator
Cluster Creator Kit を使用したワールド制作で、ローカルスイッチのギミックを簡単に作れるツールです。
- プレイヤーごとにオブジェクトの ON / OFF を切り替えることができます
- Timeline方式なので、すべてのオブジェクトに対して使用できます
- Item系のオブジェクトに使用した際は他プレイヤー視点での挙動が変化する場合があります
要件
- Unity 2021.3 / Cluster Creator Kit v1.17.0
インストール
from disk
- 最新の release からダウンロード、展開します
- Unity メニュー Window > Package Manager から "Packages" ウィンドウを開きます
- ウィンドウ内左上の "+" ボタンから "Add package from disk" を選択、展開したフォルダ内の
package.json
を開きます
scoped registries
- Packages/manifest.json を開き、以下のように編集します
{
"scopedRegistries": [
{
"name": "suzuryg",
"url": "https://registry.npmjs.com",
"scopes": [ "jp.suzuryg" ]
}
],
"dependencies": {
"jp.suzuryg.local-switch-generator": "1.0.0",
...
使い方
ローカルスイッチの生成
- Unity メニュー Tools > LocalSwitchGenerator から 本ツールのウィンドウ を開きます
- 「対象オブジェクト」に ON / OFF を切り替えたいオブジェクトをセットします
- 「ボタン」に ON / OFF を切り替えるボタンとするオブジェクトをセットします
- 「生成」ボタンを押すと、ローカルスイッチのギミックが生成されます
- ボタンにItemコンポーネントとInteractItemTriggerコンポーネントが追加されます
- 「Switch_XXX」(XXXは対象オブジェクトの名前)という名前のギミック用オブジェクトが生成されます
ローカルスイッチの削除
- ボタンからItemコンポーネントとInteractItemTriggerコンポーネントを削除します
- 「Switch_XXX」オブジェクトを削除します
参考文献
1.0.0
2 years ago