示例#1
0
 private void ThirtyAttack()
 {
     _attackCtrl = (Instantiate(_attackBall, transform.position, Quaternion.identity, transform.parent) as GameObject).GetComponent <AttackCtrl>();
     _attackCtrl.SetAttackEnergy(_bibleEnergy * 3);
     _invokeThiCnt++;
     if (_invokeThiCnt == 10)
     {
         _invokeThiCnt = 0;
         CancelInvoke("ThirtyAttack");
     }
 }
示例#2
0
 private void Attacking()
 {
     if (_abilityCode == 2)
     {
         InvokeRepeating("TripleAttack", 0f, 0.25f);
     }
     else if (_abilityCode == 3)
     {
         _attackCtrl = (Instantiate(_attackBall, transform.position, Quaternion.identity, transform.parent) as GameObject).GetComponent <AttackCtrl>();
         _attackCtrl.SetAttackEnergy(_bibleEnergy);
         _attackCtrl = (Instantiate(_attack2thBall, transform.position, Quaternion.identity, transform.parent) as GameObject).GetComponent <AttackCtrl>();
         _attackCtrl.SetAttackEnergy(_bibleEnergy);
     }
     else if (_abilityCode == 6)
     {
         GameObject[] all = GameObject.FindGameObjectsWithTag("Touchable");
         foreach (GameObject enemy in all)
         {
             enemy.GetComponent <EnemyCtrl>().AllAtack(_bibleEnergy);
         }
     }
     else if (_abilityCode == 7)
     {
         _attackCtrl = (Instantiate(_attackBall, transform.position, Quaternion.identity) as GameObject).GetComponent <AttackCtrl>();
         _attackCtrl.SetAttackEnergy(_bibleEnergy);
     }
     else if (_abilityCode == 9)
     {
         int i = Random.Range(0, 100);
         if (i <= 49)
         {
             InvokeRepeating("ThirtyAttack", 0f, 0.2f);
         }
         else
         {
             _attackCtrl = (Instantiate(_attackBall, transform.position, Quaternion.identity, transform.parent) as GameObject).GetComponent <AttackCtrl>();
             _attackCtrl.SetAttackEnergy(_bibleEnergy);
         }
     }
     else
     {
         _attackCtrl = (Instantiate(_attackBall, transform.position, Quaternion.identity, transform.parent) as GameObject).GetComponent <AttackCtrl>();
         _attackCtrl.SetAttackEnergy(_bibleEnergy);
     }
     _abilityAttackCount -= 1;
     _acText.text         = _abilityAttackCount + "";
     if (_abilityAttackCount == 0)
     {
         StageManager._SMInstance.AbilityEnd();
     }
 }