Пример #1
0
    void Update()
    {
        if (enemyState == EnemyState.EIdel)
        {
            this.animator.SetBool("EAttack", false);
            this.animator.SetBool("EDefense", false);
            this.animator.SetBool("EMagic", false);
            this.animator.SetBool("ERecovery", false);
        }
        switch (enemyState)
        {
        case EnemyState.EAttack:
            this.animator.SetBool("EAttack", true);
            messageScript.SetEAttackMessage();
            hPBarController.EnemyAttack();
            enemyState = EnemyState.EIdel;
            break;

        case EnemyState.EDefense:
            this.animator.SetBool("EDefense", true);
            messageScript.SetEDAefenseMessage();
            enemyState = EnemyState.EIdel;
            break;

        case EnemyState.EMagic:
            this.animator.SetBool("EMagic", true);
            messageScript.SetEMagicMessage();
            enemyState = EnemyState.EIdel;
            break;

        case EnemyState.ERecovery:
            this.animator.SetBool("ERecovery", true);
            messageScript.SetERecoveryMessage();
            enemyState = EnemyState.EIdel;
            break;

        case EnemyState.EDeath:
            TimeEDCount -= Time.deltaTime;
            if (TimeEDCount <= 0)
            {
                this.animator.SetBool("EDeath", true);
                messageScript.SetEDeathMessage();
            }
            break;
        }

        if (eneHP <= 0)
        {
            enemyState = EnemyState.EDeath;
        }
    }