private IEnumerator FleeForSeconds(float secondsToFlee) { currentState = SmartBotStates.Flee; yield return(new WaitForSeconds(secondsToFlee)); currentState = SmartBotStates.Search; }
public override void Init(GameObject own, SnakeMovement ownMove) { base.Init(own, ownMove); currentState = SmartBotStates.Search; // Randomize initial direction float angle = UnityEngine.Random.Range(0f, 2f); direction = new Vector3(Mathf.Cos(angle), Mathf.Sin(angle), 0f); }