Example #1
0
        protected override void RenameEnded()
        {
            string name         = base.GetRenameOverlay().name;
            string originalName = base.GetRenameOverlay().originalName;

            if (name != originalName)
            {
                Undo.RecordObject(this.state.activeAnimationClip, "Rename Curve");
                AnimationWindowCurve[] curves = this.m_RenamedNode.curves;
                for (int i = 0; i < curves.Length; i++)
                {
                    AnimationWindowCurve animationWindowCurve = curves[i];
                    string             newPath        = this.RenamePath(animationWindowCurve.path, name);
                    EditorCurveBinding renamedBinding = AnimationWindowUtility.GetRenamedBinding(animationWindowCurve.binding, newPath);
                    if (AnimationWindowUtility.CurveExists(renamedBinding, this.state.allCurves.ToArray()))
                    {
                        Debug.LogWarning("Curve already exists, renaming cancelled.");
                    }
                    else
                    {
                        AnimationWindowUtility.RenameCurvePath(animationWindowCurve, renamedBinding, animationWindowCurve.clip);
                    }
                }
            }
            this.m_RenamedNode = null;
        }
        override protected void RenameEnded()
        {
            string newName = GetRenameOverlay().name;
            string oldName = GetRenameOverlay().originalName;

            if (newName != oldName)
            {
                Undo.RecordObject(state.activeAnimationClip, "Rename Curve");

                foreach (AnimationWindowCurve curve in m_RenamedNode.curves)
                {
                    EditorCurveBinding newBinding = AnimationWindowUtility.GetRenamedBinding(curve.binding, newName);

                    if (AnimationWindowUtility.CurveExists(newBinding, state.allCurves.ToArray()))
                    {
                        Debug.LogWarning("Curve already exists, renaming cancelled.");
                        continue;
                    }

                    AnimationWindowUtility.RenameCurvePath(curve, newBinding, curve.clip);
                }
            }

            m_RenamedNode = null;
        }
        protected override void RenameEnded()
        {
            string name         = base.GetRenameOverlay().name;
            string originalName = base.GetRenameOverlay().originalName;

            if (name != originalName)
            {
                foreach (AnimationWindowCurve curve in this.m_RenamedNode.curves)
                {
                    string             newPath        = this.RenamePath(curve.path, name);
                    EditorCurveBinding renamedBinding = AnimationWindowUtility.GetRenamedBinding(curve.binding, newPath);
                    if (AnimationWindowUtility.CurveExists(renamedBinding, this.state.allCurves.ToArray()))
                    {
                        Debug.LogWarning("Curve already exists, renaming cancelled.");
                    }
                    else
                    {
                        AnimationWindowUtility.RenameCurvePath(curve, renamedBinding, this.state.activeAnimationClip);
                    }
                }
            }
            this.m_RenamedNode = null;
        }