// Contains the diffrent ways to move players. #region Move Player Methods // Moves a player to a x,y location. private void MovePlayerDirect(int x, int y, FantPlayer fp) { gridPlayer[fp.Poss.x, fp.Poss.y] = null; gridPlayer[x, y] = fp; fp.transform.position = new Vector3(OffSetX(x), OffSetY(y) + 3f, -1); fp.Poss = new Vector2Int(x, y); SpriteRenderer sr = fp.GetComponent <SpriteRenderer>(); sr.sortingOrder = -y; }
// Contains the diffrent ways to move players. #region Move Player Methods // Moves a player to a x,y location. private void MovePlayerDirect(int x, int y, FantPlayer fp) { fp.transform.position = new Vector3(OffSetX(x), OffSetY(y) + 3f, -1); SpriteRenderer sr = fp.GetComponent<SpriteRenderer>(); sr.sortingOrder = -y; }