Exemplo n.º 1
0
    void OnDisable()
    {
        window = null;
        if((aData)&& saveChanges) {
            bool saveNumFrames = true;
            if((numFrames < aData.getCurrentTake().numFrames) && (aData.getCurrentTake().hasKeyAfter(numFrames))) {
                if(!EditorUtility.DisplayDialog("Data Will Be Lost","You will lose some keys beyond frame "+numFrames+" if you continue.", "Continue Anway","Cancel")) {
                    saveNumFrames = false;
                }
            }
            if(saveNumFrames) {
                // save numFrames
                aData.getCurrentTake().numFrames = numFrames;
                aData.getCurrentTake().deleteKeysAfter(numFrames);

                // save data
                foreach(AMTrack track in aData.getCurrentTake().trackValues) {
                        EditorUtility.SetDirty(track);
                }
            }
            // save frameRate
            aData.getCurrentTake().frameRate = frameRate;
            EditorWindow.GetWindow (typeof (AMTimeline)).Repaint();
            // save data
            EditorUtility.SetDirty(aData);
        }
    }
Exemplo n.º 2
0
    void OnDisable()
    {
        window = null;
        if ((aData) && saveChanges)
        {
            AMUtil.regUndoSelectedTake(aData, "Modify Settings");
            bool saveNumFrames = true;
            if ((numFrames < aData.getCurrentTake().numFrames) && (aData.getCurrentTake().hasKeyAfter(numFrames)))
            {
                if (!EditorUtility.DisplayDialog("Data Will Be Lost", "You will lose some keys beyond frame " + numFrames + " if you continue.", "Continue Anway", "Cancel"))
                {
                    saveNumFrames = false;
                }
            }
            if (saveNumFrames)
            {
                // save numFrames
                aData.getCurrentTake().numFrames = numFrames;
                aData.getCurrentTake().deleteKeysAfter(numFrames);

                // save data
                foreach (AMTrack track in aData.getCurrentTake().trackValues)
                {
                    EditorUtility.SetDirty(track);
                }
            }
            // save frameRate
            aData.getCurrentTake().frameRate = frameRate;
            EditorWindow.GetWindow(typeof(AMTimeline)).Repaint();
            // save data
            EditorUtility.SetDirty(aData);
        }
    }
Exemplo n.º 3
0
    void OnEnable()
    {
        window = this;
        this.title = "Settings";
        this.minSize = new Vector2(125f,115f);
        this.maxSize = this.minSize;

        oData = AMOptionsFile.loadFile();
        loadAnimatorData();
    }
Exemplo n.º 4
0
    void OnEnable()
    {
        window            = this;
        this.titleContent = new GUIContent("Settings");
        this.minSize      = new Vector2(125f, 115f);
        this.maxSize      = this.minSize;

        oData = AMOptionsFile.loadFile();
        loadAnimatorData();
    }
Exemplo n.º 5
0
    void OnDisable()
    {
        window = null;
        if(aData != null && saveChanges) {
            AMTakeData take = aData.currentTake;
            bool saveNumFrames = true;
            if((numFrames < take.numFrames) && (take.hasKeyAfter(numFrames))) {
                if(!EditorUtility.DisplayDialog("Data Will Be Lost", "You will lose some keys beyond frame " + numFrames + " if you continue.", "Continue Anway", "Cancel")) {
                    saveNumFrames = false;
                }
            }

            string label = take.name+": Modify Settings";
            AMTimeline.RegisterTakesUndo(aData, label, true);
            take = aData.currentTake;

            if(saveNumFrames) {
                Undo.RegisterCompleteObjectUndo(AnimatorDataEdit.GetKeysAndTracks(take), label);

                // save numFrames
                take.numFrames = numFrames;
                AMKey[]dkeys = take.removeKeysAfter(aData.target, numFrames);
                foreach(AMKey dkey in dkeys)
                    Undo.DestroyObjectImmediate(dkey);

                // save data
                foreach(AMTrack track in take.trackValues) {
                    foreach(AMKey key in track.keys)
                        EditorUtility.SetDirty(key);
                    EditorUtility.SetDirty(track);
                }
            }
            // save frameRate
            take.frameRate = frameRate;

            //save other data
            take.numLoop = loopCount;
            take.loopMode = loopMode;
            take.loopBackToFrame = Mathf.Clamp(loopBackFrame, -1, numFrames);

            // save data
            aData.SetDirtyTakes();

            EditorWindow.GetWindow(typeof(AMTimeline)).Repaint();
        }
    }
Exemplo n.º 6
0
    void OnEnable()
    {
        window = this;
        #if UNITY_5
        titleContent = new GUIContent("Settings");
        #else
        title = "Settings";
        #endif
        minSize = new Vector2(280f, 190f);
        //maxSize = this.minSize;

        oData = AMOptionsFile.loadFile();
        loadAnimatorData();
    }