Ejemplo n.º 1
0
    public static AnimationStates set(GameObject target, float newState, float speedAnim = 0.01f)
    {
        AnimationStates animStates = target.GetComponent <AnimationStates>();

        if (animStates == null)
        {
            animStates = target.AddComponent <AnimationStates>();
        }
        animStates.setNewState(newState);
        animStates.speedAnim = speedAnim;
        return(animStates);
    }