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; }
private void InitializeTweener() { if (!lerper) { lerper = GetComponent <VariableTweener>(); if (!lerper) { lerper = gameObject.AddComponent <VariableTweener>(); } } }
public Pose(VariableTweener lerper) { this.lerper = lerper; }
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); }; }