Exemplo n.º 1
0
    private Vector3 GetRandomPosition2D()
    {
        Vector2Int randPos;

        do
        {
            randPos = new Vector2Int(Random.Range(0, this.gridWith), Random.Range(0, this.gridHeight));
        } while (globalManager.GetAllSnakePositions().IndexOf(randPos) != -1);
        return(new Vector3(randPos.x, randPos.y));
    }