当前位置: 首页>>代码示例>>C#>>正文


C# Animator.GetLayerWeight方法代码示例

本文整理汇总了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);
                }
            }
        }
开发者ID:farreltr,项目名称:OneLastSunset,代码行数:32,代码来源:SequencerCommandAnimatorLayer.cs


注:本文中的UnityEngine.Animator.GetLayerWeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。