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);
        }
Ejemplo n.º 2
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);
        }