Exemplo n.º 1
0
        public Transition AddTransitionToState_OLD(MotionMatchingState toState, int nodeID, Rect rect, bool portal = false)
        {
            Transition t = null;// new Transition(TransitionType., toState.GetIndex());

            switch (toState.GetStateType())
            {
            case MotionMatchingStateType.MotionMatching:
                t = new Transition(MotionMatchingStateType.MotionMatching, toState.GetIndex());
                break;

            case MotionMatchingStateType.SingleAnimation:
                t = new Transition(MotionMatchingStateType.SingleAnimation, toState.GetIndex());
                break;
            }

            t.toPortal = portal;
            if (!portal)
            {
                t.portalRect = Rect.zero;
            }
            else
            {
                t.portalRect = rect;
            }

            t.nodeID = nodeID;
            transitions.Add(t);
            return(t);
        }
Exemplo n.º 2
0
 public void UpdateTransitions(MotionMatchingState fromState, int removedDataIndex = -1)
 {
     if (stateType == MotionMatchingStateType.MotionMatching)
     {
         return;
     }
     foreach (Transition t in fromState.transitions)
     {
         if (t.nextStateIndex == GetIndex())
         {
             foreach (TransitionOptions o in t.options)
             {
                 if (removedDataIndex > -1 && removedDataIndex < o.whereCanFindingBestPose.Count)
                 {
                     o.whereCanFindingBestPose.RemoveAt(removedDataIndex);
                 }
                 else if (o.whereCanFindingBestPose.Count < this.motionDataGroups[0].animationData.Count)
                 {
                     while (o.whereCanFindingBestPose.Count != this.motionDataGroups[0].animationData.Count)
                     {
                         o.whereCanFindingBestPose.Add(new float2(0f, this.motionDataGroups[0].animationData[o.whereCanFindingBestPose.Count].animationLength));
                     }
                 }
                 else if (o.whereCanFindingBestPose.Count > this.motionDataGroups[0].animationData.Count)
                 {
                     while (o.whereCanFindingBestPose.Count != this.motionDataGroups[0].animationData.Count)
                     {
                         o.whereCanFindingBestPose.RemoveAt(o.whereCanFindingBestPose.Count - 1);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 public void AddFindigBestPoseOption(MotionMatchingState toState)
 {
     if (toState.GetStateType() != MotionMatchingStateType.MotionMatching)
     {
         for (int i = 0; i < toState.motionDataGroups[0].animationData.Count; i++)
         {
             whereCanFindingBestPose.Add(new Vector2(0f, toState.motionDataGroups[0].animationData[i].animationLength));
         }
     }
 }
Exemplo n.º 4
0
 public void AddCheckingTransitionOption(MotionMatchingState fromState)
 {
     if (fromState.GetStateType() != MotionMatchingStateType.MotionMatching)
     {
         for (int i = 0; i < fromState.motionDataGroups[0].animationData.Count; i++)
         {
             this.whenCanCheckingTransition.Add(new Vector2(0f, fromState.motionDataGroups[0].animationData[i].animationLength));
         }
     }
 }
        private BasicMotionMatchingJob[] mmJobs; // motion matching job

        public LogicMotionMatchingState(
            MotionMatchingState state,
            MotionMatching component,
            MotionMatchingPlayableGraph playableGraph,
            LogicMotionMatchingLayer logicLayer,
            Transform gameObject,
            int framesForJob
            ) :
            base(state, component, playableGraph, logicLayer, gameObject, framesForJob)
        {
            OnCreate();
        }
Exemplo n.º 6
0
 public bool AddTransition(MotionMatchingState toState, int nodeID, bool portal = false)
 {
     transitions.Add(new Transition(
                         toState.GetStateType(),
                         toState.GetIndex()
                         ));
     transitions[transitions.Count - 1].nodeID              = nodeID;
     transitions[transitions.Count - 1].transitionRect      = new Rect();
     transitions[transitions.Count - 1].transitionRect.size = new Vector2(15, 15);
     transitions[transitions.Count - 1].toPortal            = portal;
     transitions[transitions.Count - 1].fromStateIndex      = this.GetIndex();
     return(false);
 }