コード例 #1
0
 public void OnAfterDeserialize()
 {
     instance = this;
     SceneView.onSceneGUIDelegate += OnSceneGUI;
     Undo.undoRedoPerformed       += UndoRedoPerformed;
     OnDeserialize();
     SceneView.RepaintAll();
 }
コード例 #2
0
    public void Close()
    {
        SceneView.onSceneGUIDelegate -= OnSceneGUI;
        Undo.undoRedoPerformed       -= UndoRedoPerformed;

        instance.OnDestroy();

        instance = null;
        GameObject.DestroyImmediate(this);
        SceneView.RepaintAll();
    }
コード例 #3
0
    public static pb_ISceneEditor Create <T>() where T : pb_ISceneEditor
    {
        if (instance != null)
        {
            return(instance);
        }

        instance           = ScriptableObject.CreateInstance <T>();
        instance.hideFlags = HideFlags.DontSave;

        SceneView.onSceneGUIDelegate += instance.OnSceneGUI;
        Undo.undoRedoPerformed       += instance.UndoRedoPerformed;

        EditorApplication.delayCall += instance.OnInitialize;

        SceneView.RepaintAll();

        return(instance);
    }