Ejemplo n.º 1
0
    public void SetAnimationParam(string paramName, AnimatorParamType paramType, object param = null)
    {
        if (null == m_EntityAnimator)
        {
            return;
        }

        switch (paramType)
        {
        case AnimatorParamType.APT_Boolean:
            m_EntityAnimator.SetBool(paramName, (bool)param);
            break;

        case AnimatorParamType.APT_Float:
            //小刀和没拿武器都是空手的移动动作
            paramName = paramName.Replace("WT_None", "");
            paramName = paramName.Replace("WT_Knife", "");
            m_EntityAnimator.SetFloat(paramName, (float)param);
            break;

        case AnimatorParamType.APT_Integer:
            m_EntityAnimator.SetInteger(paramName, (int)param);
            break;

        case AnimatorParamType.APT_Trigger:
            m_EntityAnimator.SetTrigger(paramName);
            break;
        }
    }
 internal AnimatorParam(string name, System.Object va, AnimatorParamType type)
 {
     paraName = name;
     value    = va;
     paraType = type;
 }