示例#1
0
    // Don't call e.Use() every frame or the scene view will never update until you manually click out and back in!!
    void OnSceneGUI()
    {
        Event e = Event.current;

        if (e.type == EventType.KeyDown)
        {
            OnKeyDown(e);
            e.Use();
            EditorSceneManager.MarkAllScenesDirty();
        }

        currentState.OnSceneGUI(Event.current);

        Repaint();   // Forces inspector to redraw. Useful for situations where inspector is modified outside of OnInspectorGUI
    }