Ejemplo n.º 1
0
 // 参数是动作名,不是状态机节点名
 public virtual float getAnimationLength(string name)
 {
     if (mAvatar == null || mAvatar.getAnimator() == null || isEmpty(name))
     {
         return(0.0f);
     }
     if (mAnimationLenghtList.TryGetValue(name, out float length))
     {
         return(length);
     }
     length = getAnimationLength(mAvatar.getAnimator(), name);
     mAnimationLenghtList.Add(name, length);
     return(length);
 }
Ejemplo n.º 2
0
    // 参数是动作名,不是状态机节点名
    public virtual float getAnimationLength(string name)
    {
        if (mAvatar == null || mAvatar.getAnimator() == null || isEmpty(name))
        {
            return(0.0f);
        }
        if (mAnimationLenghtList.ContainsKey(name))
        {
            return(mAnimationLenghtList[name]);
        }
        float length = getAnimationLength(mAvatar.getAnimator(), name);

        mAnimationLenghtList.Add(name, length);
        return(length);
    }