Пример #1
0
 public                                                    PPtr <AnimatorTransition>[] CreateEntryTransitions(VirtualSerializedFile file, Parameters parameters)
 {
     if (IsReadConstantArray(parameters.Version))
     {
         foreach (OffsetPtr <SelectorStateConstant> selectorPtr in SelectorStateConstantArray)
         {
             SelectorStateConstant selector = selectorPtr.Instance;
             if (selector.FullPathID == parameters.ID && selector.IsEntry)
             {
                 PPtr <AnimatorTransition>[] transitions = new PPtr <AnimatorTransition> [selector.TransitionConstantArray.Count - 1];
                 for (int i = 0; i < selector.TransitionConstantArray.Count - 1; i++)
                 {
                     SelectorTransitionConstant    selectorTrans   = selector.TransitionConstantArray[i].Instance;
                     AnimatorTransition.Parameters transParameters = new AnimatorTransition.Parameters
                     {
                         StateMachine = this,
                         States       = parameters.States,
                         TOS          = parameters.TOS,
                         Transition   = selectorTrans,
                         Version      = parameters.Version,
                     };
                     AnimatorTransition transition = AnimatorTransition.CreateVirtualInstance(file, transParameters);
                     transitions[i] = transition.File.CreatePPtr(transition);
                 }
                 return(transitions);
             }
         }
     }
     return(new PPtr <AnimatorTransition> [0]);
 }
Пример #2
0
 public                                                    PPtr <AnimatorTransition>[] GetEntryTransitions(VirtualSerializedFile file,
                                                                                                           AnimatorController controller, uint ID, IReadOnlyList <AnimatorState> states)
 {
     if (IsReadConstantArray(controller.File.Version))
     {
         foreach (OffsetPtr <SelectorStateConstant> selectorPtr in SelectorStateConstantArray)
         {
             SelectorStateConstant selector = selectorPtr.Instance;
             if (selector.FullPathID == ID && selector.IsEntry)
             {
                 PPtr <AnimatorTransition>[] transitions = new PPtr <AnimatorTransition> [selector.TransitionConstantArray.Count - 1];
                 for (int i = 0; i < selector.TransitionConstantArray.Count - 1; i++)
                 {
                     SelectorTransitionConstant selectorTrans = selector.TransitionConstantArray[i].Instance;
                     AnimatorTransition         transition    = AnimatorTransition.CreateVirtualInstance(file, controller, selectorTrans, states);
                     transitions[i] = transition.File.CreatePPtr(transition);
                 }
                 return(transitions);
             }
         }
     }
     return(new PPtr <AnimatorTransition> [0]);
 }