/** * Inspector上のGUI表示. */ public override void OnInspectorGUI() { // 変数の初期化 m_View = this.target as MonobitTransformView; if (m_View == null) { return; } // Transformの同期に関する設定の表示 SyncSetting("Position", ref m_View.m_SyncPosition); SyncSetting("Rotation", ref m_View.m_SyncRotation); SyncSetting("Scale", ref m_View.m_SyncScale); // ワープに関する設定の表示 SnapSetting(); // データの更新 if (GUI.changed) { serializedObject.ApplyModifiedProperties(); EditorUtility.SetDirty(m_View); MonobitEditor.MarkSceneDirty(); } }
public void OnDrawGizmos() { _monobitView = GetComponent <MonobitView>(); if (_monobitView == null) { _monobitView = gameObject.AddComponent <MonobitView>(); } Debug.Log("aaa"); //MonobitTransformViewを追加------------------------ MonobitTransformView t = GetComponent <MonobitTransformView>(); if (t == null) { t = gameObject.AddComponent <MonobitEngine.MonobitTransformView>(); } _monobitView.ObservedComponents = new List <Component>(); _monobitView.ObservedComponents.Add(t); //MonobitAnimatorViewを追加------------------------ MonobitAnimatorView a = GetComponent <MonobitAnimatorView>(); if (GetComponent <Animator>() != null && a == null) { a = gameObject.AddComponent <MonobitEngine.MonobitAnimatorView>(); } if (a != null) { _monobitView.ObservedComponents.Add(a); } //自作クラスの実装 var sn = GetComponents <SyncNetWorkBehavior>(); foreach (var snc in sn) { _monobitView.ObservedComponents.Add(snc); } if (_monobitView != null) { _monobitView?.UpdateSerializeViewMethod(); } }