public void ValidateBaseData()
        {
            if (MotionModifier == null)
                MotionModifier = new MotionModifyData();

            if (Events == null)
                Events = new List<EventMarker>();

            if (TagTracks == null)
                TagTracks = new List<TagTrack>();

            if (FavourTagTracks == null)
                FavourTagTracks = new List<TagTrack>();

            if (GeneratedEvents == null)
                GeneratedEvents = new List<EventMarker>();

            if (GeneratedTagTracks == null)
                GeneratedTagTracks = new List<TagTrack>();

            if (GeneratedFavourTagTracks == null)
                GeneratedFavourTagTracks = new List<TagTrack>();

            if (GeneratedUserBoolTracks == null)
                GeneratedUserBoolTracks = new List<TagTrackBase>();

            if (PrimaryClip != null)
            {
                if (LeftFootStepTrack == null || LeftFootStepTrack.Name == null || LeftFootStepTrack.Name == "")
                    LeftFootStepTrack = new FootStepTagTrack(0, "Footstep Left", PrimaryClip.length);

                if (RightFootStepTrack == null || RightFootStepTrack.Name == null || RightFootStepTrack.Name == "")
                    RightFootStepTrack = new FootStepTagTrack(1, "Footstep Right", PrimaryClip.length);

                if (WarpPositionTrack == null || WarpPositionTrack.Name == null || WarpPositionTrack.Name == "")
                    WarpPositionTrack = new TagTrackBase(2, "Disable Warp (Position)", PrimaryClip.length);

                if (WarpRotationTrack == null || WarpRotationTrack.Name == null || WarpRotationTrack.Name == "")
                    WarpRotationTrack = new TagTrackBase(3, "Disable Warp (Rotation)", PrimaryClip.length);

                if (EnableRootMotionTrack == null || EnableRootMotionTrack.Name == null || EnableRootMotionTrack.Name != "Disable Matching")
                    EnableRootMotionTrack = new TagTrackBase(4, "Disable Matching", PrimaryClip.length);

                if (PoseFavourTrack == null || PoseFavourTrack.Name == null || PoseFavourTrack.Name == "" )
                    PoseFavourTrack = new FloatTagTrack(5, "Pose Favour", PrimaryClip.length);

                if (WarpTrajLatTrack == null || WarpTrajLatTrack.Name == null || WarpTrajLatTrack.Name == "")
                    WarpTrajLatTrack = new TagTrackBase(6, "Disable Trajectory Warp (Angular)", PrimaryClip.length);

                if (WarpTrajLongTrack == null || WarpTrajLongTrack.Name == null || WarpTrajLongTrack.Name == "")
                    WarpTrajLongTrack = new TagTrackBase(7, "Disable Trajectory Warp (Long)", PrimaryClip.length);

                PoseFavourTrack.DefaultValue = 1f;
            }
            
            MotionModifier.OnEnable(this);

            EditorUtility.SetDirty(this);
        }
Ejemplo n.º 2
0
        public void ValidateBaseData()
        {
            if (MotionModifier == null)
                MotionModifier = new MotionModifyData();

            if (TagTracks == null)
                TagTracks = new List<TagTrack>();

            if (FavourTagTracks == null)
                FavourTagTracks = new List<TagTrack>();

            if (GeneratedTagTracks == null)
                GeneratedTagTracks = new List<TagTrack>();

            if (GeneratedFavourTagTracks == null)
                GeneratedFavourTagTracks = new List<TagTrack>();

            if (m_clips == null)
                m_clips = new List<AnimationClip>();

            if (m_positions == null)
                m_positions = new List<Vector2>();

            if (m_clips != null && m_clips.Count > 0)
            {
                float clipLength = m_clips[0].length;

                if (LeftFootStepTrack == null || LeftFootStepTrack.Name == "" || LeftFootStepTrack.Name == null)
                    LeftFootStepTrack = new FootStepTagTrack(0, "Footstep Left", clipLength);

                if (RightFootStepTrack == null || RightFootStepTrack.Name == "" || RightFootStepTrack.Name == null)
                    RightFootStepTrack = new FootStepTagTrack(1, "Footstep Right", clipLength);

                if (WarpPositionTrack == null || WarpPositionTrack.Name == "" || WarpPositionTrack.Name == null)
                    WarpPositionTrack = new TagTrackBase(2, "Disable Warp (Position)", clipLength);

                if (WarpRotationTrack == null || WarpRotationTrack.Name == "" || WarpRotationTrack.Name == null)
                    WarpRotationTrack = new TagTrackBase(3, "Disable Warp (Rotation)", clipLength);

                if (EnableRootMotionTrack == null || EnableRootMotionTrack.Name == "" || EnableRootMotionTrack.Name == null)
                    EnableRootMotionTrack = new TagTrackBase(4, "Enable Root Motion", clipLength);

                if (PoseFavourTrack == null || PoseFavourTrack.Name == "" || PoseFavourTrack.Name == null)
                    PoseFavourTrack = new FloatTagTrack(5, "Pose Favour", clipLength);

                if (WarpTrajLatTrack == null || WarpTrajLatTrack.Name == null || WarpTrajLatTrack.Name == "")
                    WarpTrajLatTrack = new TagTrackBase(6, "Disable Trajectory Warp (Angular)", clipLength);

                if (WarpTrajLongTrack == null || WarpTrajLongTrack.Name == null || WarpTrajLongTrack.Name == "")
                    WarpTrajLongTrack = new TagTrackBase(7, "Disable Trajectory Warp (Long)", clipLength);

                PoseFavourTrack.SetDefaultTagValue(1f);
            }

            MotionModifier.OnEnable(this);
            EditorUtility.SetDirty(this);
        }