示例#1
0
    void OnGUI()
    {
        if (GUILayout.Button("PrintMethods"))
        {
            AnimationWindowUtils.PrintMethods();
        }

        if (GUILayout.Button("ToggleRecord"))
        {
            AnimationWindowUtils.ToggleRecord();
        }

        if (GUILayout.Button("get_previewing"))
        {
            Debug.Log(AnimationWindowUtils.get_previewing());
        }

        if (GUILayout.Button("get_recording"))
        {
            Debug.Log(AnimationWindowUtils.get_recording());
        }
    }
示例#2
0
    private static void OnSceneGUI(SceneView sceneView)
    {
        Handles.BeginGUI();
        MonoBehaviour control = Selection.activeObject as Control;

        if (control == null)
        {
            var gameobject = Selection.activeObject as GameObject;
            if (gameobject != null)
            {
                control = gameobject.GetComponent <Control>();
                if (control == null)
                {
                    control = gameobject.GetComponent <Ik2D>();
                }
            }
        }

        if (AnimationWindowUtils.get_recording())
        {
            GUI.color = new Color(1, 0, 0, 0.8f);
            GUI.Box(new Rect(0, 0, sceneView.position.width, sceneView.position.height), GUIContent.none, EditorStyles.textArea);
        }

        if (control != null)
        {
            GUI.color = Color.black;
            GUI.Box(new Rect(0, 0, sceneView.position.width, 150), GUIContent.none, EditorStyles.textArea);
            var style = new GUIStyle();
            style.normal.textColor = Color.white;
            style.fontSize         = 100;
            GUI.color = Color.white;
            var message = string.Format("{0} ({1})", control.gameObject.name, Tools.current);
            GUI.Label(new Rect(0, 0, 100, sceneView.position.height), message, style);
        }

        Handles.EndGUI();
    }