Beispiel #1
0
        //!
        //! delete the animation attached to the currently selected object
        //!
        public void deleteAnimation()
        {
            mainController.getCurrentSelection().GetComponent <SceneObject>().setKinematic(false, false);
            mainController.getCurrentSelection().gameObject.layer = 0;
            Destroy(mainController.getCurrentSelection().GetComponent <AnimationSerializer>());
            if (animData.getAnimationClips(mainController.getCurrentSelection().gameObject) != null)
            {
                animData.deleteAnimationCurves(animData.getAnimationClips(mainController.getCurrentSelection().gameObject)[0], typeof(Transform), "m_LocalPosition.x");
                animData.deleteAnimationCurves(animData.getAnimationClips(mainController.getCurrentSelection().gameObject)[0], typeof(Transform), "m_LocalPosition.y");
                animData.deleteAnimationCurves(animData.getAnimationClips(mainController.getCurrentSelection().gameObject)[0], typeof(Transform), "m_LocalPosition.z");
                animData.removeAnimationClips(mainController.getCurrentSelection().gameObject);
            }

            animatedObjects.Remove(mainController.getCurrentSelection().GetComponent <SceneObject>());
            //animationTarget.GetComponent<SceneObject>().updateAnimationCurves();
        }