Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 public virtual void OnDisable()
 {
     //Debug.Log("OnDisable");
     Window = null;
     Editor = null;
     Data   = null;
 }
Ejemplo n.º 3
0
        public void LoadDataInScene()
        {
            targetGameObject = new GameObject(currentData.name);
            currentEditor    = targetGameObject.AddComponent <RoMapEditor>();

            currentEditor.Initialize(currentData);
            currentEditor.EnterEditMode();
            Selection.activeGameObject = targetGameObject;
        }
Ejemplo n.º 4
0
        public virtual void OnEnable(RoMapEditorWindow window, RoMapEditor editor)
        {
            Window = window;
            Editor = editor;
            Data   = editor.MapData;

            Editor.CurrentBrush = this;

            //Debug.Log("OnEnable");

            OnEnable();
        }