//... public void DisableClip(PlayAnimatorClip playAnimClip) { activeClips--; var index = ports[playAnimClip]; clipsMixer.SetInputWeight(index, 0f); activeClipsWeight = activeClips == 0 ? 0 : activeClipsWeight; }
///---------------------------------------------------------------------------------------------- //... public void EnableClip(PlayAnimatorClip playAnimClip, float blendWeight, float subClipWeight) { activeClips++; var index = ports[playAnimClip]; clipsMixer.SetInputWeight(index, activeClips == 1 ? subClipWeight : blendWeight * subClipWeight); activeClipsWeight = activeClips >= 2 ? 1 : blendWeight; }
//... public void UpdateClip(PlayAnimatorClip playAnimClip, float clipTime, float clipPrevious, float weight) { var index = ports[playAnimClip]; var clipPlayable = clipsMixer.GetInput(index); clipPlayable.SetTime(clipTime); clipsMixer.SetInputWeight(index, activeClips == 1 ? 1f : weight); activeClipsWeight = activeClips >= 2 ? 1 : weight; }
///---------------------------------------------------------------------------------------------- //... public void EnableClip(PlayAnimatorClip playAnimClip) { activeClips++; var index = ports[playAnimClip]; var weight = playAnimClip.GetClipWeight(); clipsMixer.SetInputWeight(index, activeClips == 1 ? 1f : weight); activeClipsWeight = activeClips >= 2 ? 1 : weight; }
public void DisableClip(PlayAnimatorClip playAnimClip) { if (animator == null) { return; } if (!graph.IsValid()) { return; } activeClips--; var index = ports[playAnimClip]; mixerPlayableHandle.SetInputWeight(0, activeClips == 0? 1 : 0); mixerPlayableHandle.SetInputWeight(index, 0); }
public void UpdateClip(PlayAnimatorClip playAnimClip, float clipTime, float clipPrevious, float weight) { if (animator == null) { return; } #if UNITY_2017_1_OR_NEWER if (!graph.IsValid()) { return; } #elif UNITY_5_6_OR_NEWER if (!graph.IsValid()) { return; } #else if (!mixerPlayable.IsValid()) { return; } #endif var index = ports[playAnimClip]; #if UNITY_2017_1_OR_NEWER var clipPlayable = mixerPlayable.GetInput(index); clipPlayable.SetTime(clipTime); mixerPlayable.SetInputWeight(index, weight); mixerPlayable.SetInputWeight(0, activeClips == 2? 0 : 1 - weight); #elif UNITY_5_6_OR_NEWER var clipPlayable = mixerPlayableHandle.GetInput(index); clipPlayable.time = clipTime; mixerPlayableHandle.SetInputWeight(index, weight); mixerPlayableHandle.SetInputWeight(0, activeClips == 2? 0 : 1 - weight); #else var clipPlayable = mixerPlayable.GetInput(index); clipPlayable.time = clipTime; mixerPlayable.SetInput(clipPlayable, index); mixerPlayable.SetInputWeight(index, weight); mixerPlayable.SetInputWeight(0, activeClips == 2? 0 : 1 - weight); #endif }
public void EnableClip(PlayAnimatorClip playAnimClip) { if (animator == null) { return; } if (!graph.IsValid()) { return; } activeClips++; var index = ports[playAnimClip]; var weight = playAnimClip.GetClipWeight(); mixerPlayableHandle.SetInputWeight(0, activeClips == 2? 0 : 1 - weight); mixerPlayableHandle.SetInputWeight(index, weight); }
public void UpdateClip(PlayAnimatorClip playAnimClip, float clipTime, float clipPrevious, float weight) { if (animator == null) { return; } if (!graph.IsValid()) { return; } var index = ports[playAnimClip]; var clipPlayable = mixerPlayableHandle.GetInput(index); clipPlayable.time = clipTime; mixerPlayableHandle.SetInputWeight(index, weight); mixerPlayableHandle.SetInputWeight(0, activeClips == 2? 0 : 1 - weight); }
public void DisableClip(PlayAnimatorClip playAnimClip) { if (animator == null) { return; } #if UNITY_2017_1_OR_NEWER if (!graph.IsValid()) { return; } #elif UNITY_5_6_OR_NEWER if (!graph.IsValid()) { return; } #else if (!mixerPlayable.IsValid()) { return; } #endif activeClips--; var index = ports[playAnimClip]; #if UNITY_2017_1_OR_NEWER mixerPlayable.SetInputWeight(0, activeClips == 0? 1 : 0); mixerPlayable.SetInputWeight(index, 0); #elif UNITY_5_6_OR_NEWER mixerPlayableHandle.SetInputWeight(0, activeClips == 0? 1 : 0); mixerPlayableHandle.SetInputWeight(index, 0); #else mixerPlayable.SetInputWeight(0, activeClips == 0? 1 : 0); mixerPlayable.SetInputWeight(index, 0); #endif }
public void EnableClip(PlayAnimatorClip playAnimClip) { if (animator == null) { return; } #if UNITY_2017_1_OR_NEWER if (!graph.IsValid()) { return; } #elif UNITY_5_6_OR_NEWER if (!graph.IsValid()) { return; } #else if (!mixerPlayable.IsValid()) { return; } #endif activeClips++; var index = ports[playAnimClip]; var weight = playAnimClip.GetClipWeight(); #if UNITY_2017_1_OR_NEWER mixerPlayable.SetInputWeight(0, activeClips == 2? 0 : 1 - weight); mixerPlayable.SetInputWeight(index, weight); #elif UNITY_5_6_OR_NEWER mixerPlayableHandle.SetInputWeight(0, activeClips == 2? 0 : 1 - weight); mixerPlayableHandle.SetInputWeight(index, weight); #else mixerPlayable.SetInputWeight(0, activeClips == 2? 0 : 1 - weight); mixerPlayable.SetInputWeight(index, weight); #endif }