Exemple #1
0
    private Vector2Int FindPlayer(Vector2Int oldPosition)
    {
        mygrid.WaitASec();
        mygrid.WaitASec();

        Vector2Int playerPosInArray = new Vector2Int(0, 0);

        for (int col = 0; col < 4; col++)
        {
            for (int rows = 0; rows < 6; rows++)
            {
                if (_allTiles[col, rows].tag == "Player")
                {
                    Debug.Log("FOUND PLAYER POSITION:" + col + "," + rows);

                    playerPosInArray = new Vector2Int(col, rows);

                    return(playerPosInArray);
                }
            }
        }


        return(oldPosition);
    }