hwthon / runtime-object-editor

Unity実行中にオブジェクトの値を編集する

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

runtime-object-editor

Unity実行中にオブジェクトの値を編集するパッケージです

導入

unity-packmanを使ってinstallしてください

$ unity-packman install hwthon/runtime-object-editor

使う

編集するオブジェクトの定義をする

UnityのSerializationと同じように定義してください

[System.Serializable]
public class SampleObject
{
  public string name;
  public int count;

  [SerializeField]
  private bool enable;
}

Editorを表示する

EditorはUnityのGUIイベントで描画するのでMonoBehaviourを必要とします gameObjectにコンポーネントを追加してOpenメソッドにオブジェクトを渡して表示してください

gameObject.AddComponent<ObjectEditor>().Open(new SampleObject(), OnClosed);

画面イメージ

UIは改善予定です 画面イメージ

About

Unity実行中にオブジェクトの値を編集する


Languages

Language:C# 100.0%