Ejemplo n.º 1
0
    public AnimationClip GetAnim(AnimDirectionType animDirectionType, AnimAttackType animAttackType)
    {
        int directionType = EnumHelper.GetIndex <AnimDirectionType>(animDirectionType);
        int attackType    = EnumHelper.GetIndex <AnimAttackType>(animAttackType);

        return(animations[TOTAL_DIRECTION_TYPES * attackType + directionType]);
    }
Ejemplo n.º 2
0
    public void AddAnim(int animationId, AnimDirectionType animDirectionType, AnimAttackType animAttackType)
    {
        if (animAttackType.Equals(AnimAttackType.Unknown))  // Unknown
        {
            return;
        }
        int           directionType = EnumHelper.GetIndex <AnimDirectionType>(animDirectionType);
        int           attackType    = EnumHelper.GetIndex <AnimAttackType>(animAttackType);
        string        separator     = Path.DirectorySeparatorChar.ToString();
        AnimationClip anim          = Resources.Load <AnimationClip>("Animations" + separator + animationId);

        animations[TOTAL_DIRECTION_TYPES * attackType + directionType] = anim;
        UpdateAnimationClipSpriteSize(anim);
    }