Пример #1
0
    /* utils for inherited class */

    protected bool TryTransfromFromSkill(Skill s)
    {
        bool successedTransfrom = false;

        switch (s)
        {
        case Skill.Melee:
            successedTransfrom |= state.TryTransform(CharacterState.AttackStartMelee);
            break;

        case Skill.Shoot:
            successedTransfrom |= state.TryTransform(CharacterState.AttackStartShoot);
            successedTransfrom |= state.TryTransform(CharacterState.AttackRunShoot);
            break;

        case Skill.Dash:
            successedTransfrom |= state.TryTransform(CharacterState.AttackStartDash);
            break;

        case Skill.Throw:
            successedTransfrom |= state.TryTransform(CharacterState.AttackStartThrow);
            break;

        default:
            throw new UnityException("Undefined Transform for skill : " + s.ToString());
        }

        return(successedTransfrom);
    }