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); }
public virtual void OnDisable() { //Debug.Log("OnDisable"); Window = null; Editor = null; Data = null; }
public void LoadDataInScene() { targetGameObject = new GameObject(currentData.name); currentEditor = targetGameObject.AddComponent <RoMapEditor>(); currentEditor.Initialize(currentData); currentEditor.EnterEditMode(); Selection.activeGameObject = targetGameObject; }
public virtual void OnEnable(RoMapEditorWindow window, RoMapEditor editor) { Window = window; Editor = editor; Data = editor.MapData; Editor.CurrentBrush = this; //Debug.Log("OnEnable"); OnEnable(); }