本文整理汇总了C#中UnityEngine.Animator.GetLayerWeight方法的典型用法代码示例。如果您正苦于以下问题:C# Animator.GetLayerWeight方法的具体用法?C# Animator.GetLayerWeight怎么用?C# Animator.GetLayerWeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Animator
的用法示例。
在下文中一共展示了Animator.GetLayerWeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public void Start()
{
// Get the values of the parameters:
layerIndex = GetParameterAsInt(0, 1);
weight = GetParameterAsFloat(1, 1);
subject = GetSubject(2);
duration = GetParameterAsFloat(3, 0);
if (DialogueDebug.LogInfo) Debug.Log(string.Format("{0}: Sequencer: AnimatorLayer({1}, {2}, {3}, {4})", new System.Object[] { DialogueDebug.Prefix, layerIndex, weight, subject, duration }));
// Check the parameters:
if (subject == null) {
if (DialogueDebug.LogWarnings) Debug.LogWarning(string.Format("{0}: Sequencer: AnimatorLayer(): subject '{1}' wasn't found.", new System.Object[] { DialogueDebug.Prefix, GetParameter(2) }));
Stop();
} else {
animator = subject.GetComponentInChildren<Animator>();
if (animator == null) {
if (DialogueDebug.LogWarnings) Debug.LogWarning(string.Format("{0}: Sequencer: AnimatorLayer(): no Animator found on '{1}'.", new System.Object[] { DialogueDebug.Prefix, subject.name }));
Stop();
} else if ((layerIndex < 1) || (layerIndex >= animator.layerCount)) {
if (DialogueDebug.LogWarnings) Debug.LogWarning(string.Format("{0}: Sequencer: AnimatorLayer(): layer index {1} is invalid.", new System.Object[] { DialogueDebug.Prefix, layerIndex }));
Stop();
} else if (duration < SmoothMoveCutoff) {
Stop();
} else {
// Set up the lerp:
startTime = DialogueTime.time;
endTime = startTime + duration;
originalWeight = animator.GetLayerWeight(layerIndex);
}
}
}