ClearEvents() public method

public ClearEvents ( ) : void
return void
        void AddClip(TakeInfo takeInfo)
        {
            string uniqueName = MakeUniqueClipName(takeInfo.defaultClipName);

            m_ClipAnimations.InsertArrayElementAtIndex(m_ClipAnimations.arraySize);
            AnimationClipInfoProperties info = GetAnimationClipInfoAtIndex(m_ClipAnimations.arraySize - 1);

            info.name = uniqueName;
            SetupTakeNameAndFrames(info, takeInfo);
            info.wrapMode                = (int)WrapMode.Default;
            info.loop                    = false;
            info.orientationOffsetY      = 0;
            info.level                   = 0;
            info.cycleOffset             = 0;
            info.loopTime                = false;
            info.loopBlend               = false;
            info.loopBlendOrientation    = false;
            info.loopBlendPositionY      = false;
            info.loopBlendPositionXZ     = false;
            info.keepOriginalOrientation = false;
            info.keepOriginalPositionY   = true;
            info.keepOriginalPositionXZ  = false;
            info.heightFromFeet          = false;
            info.mirror                  = false;
            info.maskType                = ClipAnimationMaskType.None;

            SetBodyMaskDefaultValues(info);


            info.ClearEvents();
            info.ClearCurves();
        }
示例#2
0
        private void AddClip(TakeInfo takeInfo)
        {
            this.m_ClipAnimations.InsertArrayElementAtIndex(this.m_ClipAnimations.arraySize);
            AnimationClipInfoProperties animationClipInfoAtIndex = this.GetAnimationClipInfoAtIndex(this.m_ClipAnimations.arraySize - 1);

            animationClipInfoAtIndex.name = this.MakeUniqueClipName(takeInfo.defaultClipName, -1);
            this.SetupTakeNameAndFrames(animationClipInfoAtIndex, takeInfo);
            animationClipInfoAtIndex.wrapMode                = 0;
            animationClipInfoAtIndex.loop                    = false;
            animationClipInfoAtIndex.orientationOffsetY      = 0.0f;
            animationClipInfoAtIndex.level                   = 0.0f;
            animationClipInfoAtIndex.cycleOffset             = 0.0f;
            animationClipInfoAtIndex.loopTime                = false;
            animationClipInfoAtIndex.loopBlend               = false;
            animationClipInfoAtIndex.loopBlendOrientation    = false;
            animationClipInfoAtIndex.loopBlendPositionY      = false;
            animationClipInfoAtIndex.loopBlendPositionXZ     = false;
            animationClipInfoAtIndex.keepOriginalOrientation = false;
            animationClipInfoAtIndex.keepOriginalPositionY   = true;
            animationClipInfoAtIndex.keepOriginalPositionXZ  = false;
            animationClipInfoAtIndex.heightFromFeet          = false;
            animationClipInfoAtIndex.mirror                  = false;
            animationClipInfoAtIndex.maskType                = ClipAnimationMaskType.CreateFromThisModel;
            this.SetBodyMaskDefaultValues(animationClipInfoAtIndex);
            this.SetTransformMaskFromReference(animationClipInfoAtIndex);
            animationClipInfoAtIndex.ClearEvents();
            animationClipInfoAtIndex.ClearCurves();
        }
        private void AddClip(TakeInfo takeInfo)
        {
            this.m_ClipAnimations.InsertArrayElementAtIndex(this.m_ClipAnimations.arraySize);
            AnimationClipInfoProperties animationClipInfoAtIndex = this.GetAnimationClipInfoAtIndex(this.m_ClipAnimations.arraySize - 1);

            animationClipInfoAtIndex.name = this.MakeUniqueClipName(takeInfo.defaultClipName, -1);
            this.SetupTakeNameAndFrames(animationClipInfoAtIndex, takeInfo);
            animationClipInfoAtIndex.wrapMode                = 0;
            animationClipInfoAtIndex.loop                    = false;
            animationClipInfoAtIndex.orientationOffsetY      = 0f;
            animationClipInfoAtIndex.level                   = 0f;
            animationClipInfoAtIndex.cycleOffset             = 0f;
            animationClipInfoAtIndex.loopTime                = false;
            animationClipInfoAtIndex.loopBlend               = false;
            animationClipInfoAtIndex.loopBlendOrientation    = false;
            animationClipInfoAtIndex.loopBlendPositionY      = false;
            animationClipInfoAtIndex.loopBlendPositionXZ     = false;
            animationClipInfoAtIndex.keepOriginalOrientation = false;
            animationClipInfoAtIndex.keepOriginalPositionY   = true;
            animationClipInfoAtIndex.keepOriginalPositionXZ  = false;
            animationClipInfoAtIndex.heightFromFeet          = false;
            animationClipInfoAtIndex.mirror                  = false;
            animationClipInfoAtIndex.maskType                = ClipAnimationMaskType.CreateFromThisModel;
            AvatarMask mask = new AvatarMask();

            string[]         humanTransforms  = null;
            SerializedObject serializedObject = animationClipInfoAtIndex.maskTypeProperty.serializedObject;
            ModelImporter    targetObject     = serializedObject.targetObject as ModelImporter;

            if ((this.animationType == ModelImporterAnimationType.Human) && !targetObject.isAssetOlderOr42)
            {
                humanTransforms = AvatarMaskUtility.GetAvatarHumanTransform(serializedObject, targetObject.transformPaths);
                if (humanTransforms == null)
                {
                    return;
                }
            }
            AvatarMaskUtility.UpdateTransformMask(mask, targetObject.transformPaths, humanTransforms);
            animationClipInfoAtIndex.MaskToClip(mask);
            animationClipInfoAtIndex.ClearEvents();
            animationClipInfoAtIndex.ClearCurves();
            UnityEngine.Object.DestroyImmediate(mask);
        }