Ejemplo n.º 1
0
    private IEnumerator FleeForSeconds(float secondsToFlee)
    {
        currentState = SmartBotStates.Flee;
        yield return(new WaitForSeconds(secondsToFlee));

        currentState = SmartBotStates.Search;
    }
Ejemplo n.º 2
0
    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);
    }