public LayerConstant GetLayerByStateMachineIndex(int index)
 {
     for (int i = 0; i < LayerArray.Length; i++)
     {
         ref LayerConstant layer = ref LayerArray[i].Instance;
         if (layer.StateMachineIndex == index && layer.StateMachineMotionSetIndex == 0)
         {
             return(layer);
         }
     }
Exemple #2
0
 public int GetLayerIndex(LayerConstant layer)
 {
     for (int i = 0; i < LayerArray.Count; i++)
     {
         LayerConstant checkLayer = LayerArray[i].Instance;
         if (checkLayer.StateMachineIndex == layer.StateMachineIndex && checkLayer.StateMachineMotionSetIndex == layer.StateMachineMotionSetIndex)
         {
             return(i);
         }
     }
     throw new ArgumentException("Layer wasn't found", nameof(layer));
 }
Exemple #3
0
 public LayerConstant GetLayerByStateMachineIndex(int index)
 {
     foreach (OffsetPtr <LayerConstant> layerPtr in LayerArray)
     {
         LayerConstant layer = layerPtr.Instance;
         if (layer.StateMachineIndex == index && layer.StateMachineMotionSetIndex == 0)
         {
             return(layer);
         }
     }
     throw new ArgumentOutOfRangeException(nameof(index));
 }
Exemple #4
0
 public int GetLayerIndexByStateMachineIndex(int index)
 {
     for (int i = 0; i < LayerArray.Count; i++)
     {
         LayerConstant layer = LayerArray[i].Instance;
         if (layer.StateMachineIndex == index && layer.StateMachineMotionSetIndex == 0)
         {
             return(i);
         }
     }
     throw new ArgumentOutOfRangeException(nameof(index));
 }
Exemple #5
0
        public AnimatorControllerLayer(AnimatorStateMachine stateMachine, AnimatorController controller, int layerIndex)
        {
            LayerConstant layer = controller.Controller.LayerArray[layerIndex].Instance;

            stateMachine.ParentStateMachinePosition = new Vector3f(800.0f, 20.0f, 0.0f);

            Name = controller.TOS[layer.Binding];

            StateMachine = stateMachine.File.CreatePPtr(stateMachine);

#warning TODO: animator
            Mask = default;

            Motions                  = System.Array.Empty <StateMotionPair>();
            Behaviours               = System.Array.Empty <StateBehavioursPair>();
            BlendingMode             = layer.LayerBlendingMode;
            SyncedLayerIndex         = layer.StateMachineMotionSetIndex == 0 ? -1 : layer.StateMachineIndex;
            DefaultWeight            = layer.DefaultWeight;
            IKPass                   = layer.IKPass;
            SyncedLayerAffectsTiming = layer.SyncedLayerAffectsTiming;
            Controller               = controller.File.CreatePPtr(controller);
        }