コード例 #1
0
 public TweenableFloat(VariableTweener lerper, float rate = 2f, float value = 0)
 {
     start       = target = this.value = value;
     this.rate   = rate;
     t           = 1;
     onChange    = null;
     this.lerper = lerper;
 }
コード例 #2
0
 private void InitializeTweener()
 {
     if (!lerper)
     {
         lerper = GetComponent <VariableTweener>();
         if (!lerper)
         {
             lerper = gameObject.AddComponent <VariableTweener>();
         }
     }
 }
コード例 #3
0
 public Pose(VariableTweener lerper)
 {
     this.lerper = lerper;
 }
コード例 #4
0
        public Finger(PlayableGraph graph, AnimationClip closed, AnimationClip opened, AvatarMask mask, VariableTweener lerper)
        {
            mixer = AnimationLayerMixerPlayable.Create(graph, 2);
            var openPlayable = AnimationClipPlayable.Create(graph, opened);

            graph.Connect(openPlayable, 0, mixer, 0);
            var closedPlayable = AnimationClipPlayable.Create(graph, closed);

            graph.Connect(closedPlayable, 0, mixer, 1);
            mixer.SetLayerAdditive(0, false);
            mixer.SetLayerMaskFromAvatarMask(0, mask);
            mixer.SetInputWeight(0, 1);
            mixer.SetInputWeight(1, 0);
            crossFadingWeight           = new TweenableFloat(lerper);
            crossFadingWeight.onChange += (value) =>
            {
                mixer.SetInputWeight(0, 1 - value);
                mixer.SetInputWeight(1, value);
            };
        }