public void UpdatePlayerPosition(int playerID, Vector2 position) { Coordinate coord = roomGrid.ReturnCoordinatesOfObject(position); if (coord.x != currentBlockGroup[0].x || coord.y != currentBlockGroup[0].y) { ClearReferenceOfObjectInGrid(); roomGrid.SetReferenceOfObject(coord.x, coord.y, 1, gameObject); currentBlockGroup[0].x = coord.x; currentBlockGroup[0].y = coord.y; switch (playerID) { //case 1: PlayersController.Instance.p1Coord = coord; break; //case 2: PlayersController.Instance.p2Coord = coord; break; } } }