public override void DoBehaviour() { for (int i = 0; i < _count; i++) { switch (_getUnitType) { case EnumInfo.GetUnitType.Random: SetAliveUnit(); Unit _tUnit = GetUnitRandom(); if (_tUnit == null) { return; } _alrealyGetUnitList.Add(_tUnit); _nextBehaviour.DoBehaviour(_tUnit); break; } } }
IEnumerator ProcessNonTargetBehaviour() { while (true) { bool _usedSkill = false; if (_skillBehaviour) { if (_skillBehaviour._nonTarget) { if (_unit._stateMgr._curMana >= _unit._unitData.MaxMana) { _ableToCallNormalBehaviour = false; _unit._stateMgr.ConsumeAllMana(); _skillBehaviour.DoBehaviour(); _usedSkill = true; CancelInvoke("ResetCoolTime"); Invoke("ResetCoolTime", _unit._unitData.AttackSpeed * 1 / _attackSpeedState.GetAttackSpeed()); } } } if (_normalBehaviour) { if (!_usedSkill) { if (_normalBehaviour._nonTarget && _ableToCallNormalBehaviour) { _ableToCallNormalBehaviour = false; CancelInvoke("ResetCoolTime"); Invoke("ResetCoolTime", _unit._unitData.AttackSpeed * 1 / _attackSpeedState.GetAttackSpeed()); _normalBehaviour.DoBehaviour(); } } } yield return(null); } }
IEnumerator ProcessWaitForSec() { yield return(new WaitForSeconds(_waitForSec)); _nextBehaviour.DoBehaviour(); }
public override void DoBehaviour() { _nextBehaviour.DoBehaviour(_unit); }