private IEnumerator Start() { while (target == null) { yield return(null); target = searcherTarget.Find(); } }
private IEnumerator Start() { while (true) { target = targetSearcher.Find(); if (target != null) { if (!sightChecker.IsTargetOnSight(target)) { yield return(moveTask.MovingToBetterPosition(target)); } yield return(new WaitForSeconds(durationShooting)); } yield return(null); } }
private IEnumerator AttackEnemyLoop() { GameObject target = null; while (true) { target = targetSearcher.Find(); if (target != null) { rotateToTarget.target = target.transform; yield return(rotateToTarget.Rotate()); if (sightChecker.IsTargetOnSight(target)) { yield return(gun.Shoting()); } } yield return(null); } }