コード例 #1
0
        private bool HasSelectedMap()
        {
            if (Selection.activeGameObject != null)
            {
                var selEditor = Selection.activeGameObject.GetComponent <RoMapEditor>();
                if (selEditor != null)
                {
                    if (currentEditor != null && selEditor.gameObject != currentEditor.gameObject)
                    {
                        LeaveEditorMode();
                    }

                    targetGameObject = Selection.activeGameObject;
                    currentEditor    = selEditor;
                    currentData      = currentEditor.MapData;

                    if (currentData != null)
                    {
                        return(true);
                    }
                }
            }

            LeaveEditorMode();

            return(false);
        }
コード例 #2
0
 public virtual void OnDisable()
 {
     //Debug.Log("OnDisable");
     Window = null;
     Editor = null;
     Data   = null;
 }
コード例 #3
0
        public void LoadDataInScene()
        {
            targetGameObject = new GameObject(currentData.name);
            currentEditor    = targetGameObject.AddComponent <RoMapEditor>();

            currentEditor.Initialize(currentData);
            currentEditor.EnterEditMode();
            Selection.activeGameObject = targetGameObject;
        }
コード例 #4
0
        public virtual void OnEnable(RoMapEditorWindow window, RoMapEditor editor)
        {
            Window = window;
            Editor = editor;
            Data   = editor.MapData;

            Editor.CurrentBrush = this;

            //Debug.Log("OnEnable");

            OnEnable();
        }