Exemple #1
0
 protected override void OnMixer(float time, MixClip mix)
 {
     if (mixPlayable.IsValid())
     {
         if (!mix.connect || !Application.isPlaying)
         {
             XAnimationClip clipA = (XAnimationClip)mix.blendA;
             XAnimationClip clipB = (XAnimationClip)mix.blendB;
             if (clipA && clipB)
             {
                 mixA = clipA.playable;
                 mixB = clipB.playable;
             }
         }
         mix.connect = true;
         float weight = (time - mix.start) / mix.duration;
         if (mixA.IsValid() && mixB.IsValid())
         {
             mixJob.weight = weight;
             mixPlayable.SetJobData(mixJob);
         }
         else
         {
             string tip = "playable invalid while animating mix ";
             Debug.LogError(tip + mixA.IsValid() + " " + mixB.IsValid());
         }
     }
 }