示例#1
0
        private IEnumerator AddLearningPointWhenDeath()
        {
            yield return(new WaitUntil(() => isDeath));

            playerInfo.AddLearningPoint();
            yield return(new WaitForSeconds(5.0f));

            enabled = false;
            Destroy(brain.gameObject);
            Theme.ChangeBGM(BGM.Field);
        }
示例#2
0
 public void DestroyBarHP()
 {
     if (enemyHP != null)
     {
         if (!isLastBoss)
         {
             Destroy(enemyHP.gameObject);
         }
         else
         {
             Destroy(enemyHP.gameObject.transform.parent.gameObject);
         }
         Minimap.DestroyEnemy(transform);
         RecoverEnemyHP();
         Theme.ChangeBGM(BGM.Field);
     }
 }
示例#3
0
        public void LookForPlayer()
        {
            if (isDeath)
            {
                return;
            }
            if (playerTransform != null)
            {
                return;
            }

            float radius = 7;

            if (brain is AI_Strong)
            {
                radius = 15;
            }

            var colliders = Physics.OverlapSphere(transform.position, radius, LayerMask.GetMask("Player"));

            if (colliders.Length == 0 || PlayerControl.Attack.mInstance.isDeath)
            {
                return;
            }

            InstantiateBarHP();

            if (brain is AI_Strong)
            {
                Theme.ChangeBGM(BGM.Bridge);
            }
            else
            {
                Theme.ChangeBGM(BGM.Fight);
            }

            playerTransform      = colliders[0].transform;
            playerInfo           = playerTransform.GetComponent <PlayerInfo>();
            playerAttackInstance = PlayerControl.Attack.mInstance;
        }