private void OnEnable()
        {
            animationPlayer = (AnimationPlayer)target;
            HandleInitialization(false);

            if (animationPlayer.EnsureVersionUpgraded())
            {
                EditorUtility.SetDirty(animationPlayer);
                if (animationPlayer.gameObject.scene.IsValid())
                {
                    EditorSceneManager.MarkSceneDirty(animationPlayer.gameObject.scene);
                }
            }

            Undo.undoRedoPerformed -= CheckSelectionBounds;
            Undo.undoRedoPerformed += CheckSelectionBounds;

            var instanceId = animationPlayer.GetInstanceID();

            selectedLayer    = new PersistedInt(persistedLayer + instanceId);
            selectedEditMode = new PersistedAnimationPlayerEditMode(persistedEditMode + instanceId);
            selectedState    = new PersistedInt(persistedState + instanceId);
            selectedToState  = new PersistedInt(persistedToState + instanceId);

            stateNamesNeedsUpdate = true;
        }
Exemplo n.º 2
0
 public MetaDataDrawer(AnimationPlayer animationPlayer)
 {
     this.animationPlayer = animationPlayer;
     usedClipsFoldout     = new PersistedBool(persistedFoldoutUsedClips + animationPlayer.GetInstanceID());
     usedModelsFoldout    = new PersistedBool(persistedFoldoutUsedModels + animationPlayer.GetInstanceID());
 }