public static bool step1(int instanceID, int line)
        {
            MM_AnimatorController contr;

            try
            {
                contr = (MM_AnimatorController)EditorUtility.InstanceIDToObject(instanceID);
            }
            catch (System.Exception e)
            {
                return(false);
            }

            if (EditorWindow.HasOpenInstances <AnimatorGraphEditor>())
            {
                EditorWindow.GetWindow <AnimatorGraphEditor>().SetAsset(contr);
                EditorWindow.GetWindow <AnimatorGraphEditor>().Repaint();
                return(true);
            }

            AnimatorGraphEditor.ShowWindow();
            EditorWindow.GetWindow <AnimatorGraphEditor>().SetAsset(contr);
            EditorWindow.GetWindow <AnimatorGraphEditor>().Repaint();

            return(true);
        }
        public static void ShowWindow()
        {
            AnimatorGraphEditor editor = EditorWindow.GetWindow <AnimatorGraphEditor>();

            editor.position     = new Rect(new Vector2(100, 100), new Vector2(800, 600));
            editor.titleContent = new GUIContent("Motion Matching Graph");
        }
コード例 #3
0
        public static bool OnAssetOpen(int instanceID, int line)
        {
            DataCreator asset;

            try
            {
                asset = (DataCreator)EditorUtility.InstanceIDToObject(instanceID);
            }
            catch (System.Exception e)
            {
                return(false);
            }

            if (EditorWindow.HasOpenInstances <AnimatorGraphEditor>())
            {
                EditorWindow.GetWindow <DataCreatorEditor>().SetAsset(asset);
                EditorWindow.GetWindow <DataCreatorEditor>().Repaint();
                return(true);
            }

            AnimatorGraphEditor.ShowWindow();
            EditorWindow.GetWindow <DataCreatorEditor>().SetAsset(asset);
            EditorWindow.GetWindow <DataCreatorEditor>().Repaint();

            return(true);
        }