IEnumerator Timer() { while (enabled) { curAR = ISMath.Random(attackRange); curSD = ISMath.Random(stoppingDistance); curSD = Mathf.Min(curAR, curSD); SearchEnemy(); yield return(new WaitForSeconds(coreTimerInterval)); } }
IEnumerator Timer() { while (enabled) { currentStopDistance = ISMath.Random(stopRange); currentAttackDistance = ISMath.Random(attackRange); currentStopDistance = Mathf.Min(currentStopDistance, currentAttackDistance); SearchEnemy(); yield return(new WaitForSeconds(coreTimer)); } }
IEnumerator RandomTimer() { while (enabled) // If the Box Collider is selected; { this.currentAttackRange = ISMath.Random(this.attackRange); this.currentStoppingDistance = ISMath.Random(this.stoppingDistance); this.currentStoppingDistance = Mathf.Min(currentAttackRange, currentStoppingDistance); SearchEnemy(); yield return(new WaitForSeconds(this.RandomTimerInterval)); } }