private void FindMixers(Playable parent, int port, Playable node)
 {
     if (node.IsValid <Playable>())
     {
         Type playableType = node.GetPlayableType();
         if (playableType == typeof(AnimationMixerPlayable) || playableType == typeof(AnimationLayerMixerPlayable))
         {
             int inputCount = node.GetInputCount <Playable>();
             for (int i = 0; i < inputCount; i++)
             {
                 this.FindMixers(node, i, node.GetInput(i));
             }
             AnimationOutputWeightProcessor.WeightInfo item = new AnimationOutputWeightProcessor.WeightInfo
             {
                 parentMixer = parent,
                 mixer       = node,
                 port        = port,
                 modulate    = (playableType == typeof(AnimationLayerMixerPlayable))
             };
             this.m_Mixers.Add(item);
         }
         else
         {
             int inputCount2 = node.GetInputCount <Playable>();
             for (int j = 0; j < inputCount2; j++)
             {
                 this.FindMixers(parent, port, node.GetInput(j));
             }
         }
     }
 }
 public void Evaluate()
 {
     for (int i = 0; i < this.m_Mixers.Count; i++)
     {
         AnimationOutputWeightProcessor.WeightInfo weightInfo = this.m_Mixers[i];
         float num = (!weightInfo.modulate) ? 1f : weightInfo.parentMixer.GetInputWeight(weightInfo.port);
         weightInfo.parentMixer.SetInputWeight(weightInfo.port, num * WeightUtility.NormalizeMixer(weightInfo.mixer));
     }
     this.m_Output.SetWeight(WeightUtility.NormalizeMixer(this.m_LayerMixer));
 }
Пример #3
0
 public void Evaluate()
 {
     for (int i = 0; i < this.m_Mixers.Count; i++)
     {
         AnimationOutputWeightProcessor.WeightInfo weightInfo = this.m_Mixers[i];
         float num = (!weightInfo.modulate) ? 1f : PlayableExtensions.GetInputWeight <Playable>(weightInfo.parentMixer, weightInfo.port);
         PlayableExtensions.SetInputWeight <Playable>(weightInfo.parentMixer, weightInfo.port, num * WeightUtility.NormalizeMixer(weightInfo.mixer));
     }
     PlayableOutputExtensions.SetWeight <AnimationPlayableOutput>(this.m_Output, WeightUtility.NormalizeMixer(this.m_LayerMixer));
 }