private void SetTileColor(object sender, EventManager.OnTileEventArgs e) { if (e.OldTile != null) { e.OldTile.GetComponent <Renderer>().material.color = Color.white; } e.Tile.GetComponent <Tile>().isOccupied = true; e.Tile.GetComponent <Renderer>().material.color = Color.green; }
private void SetDragColor(object sender, EventManager.OnTileEventArgs e, bool afterRemoveTile) { Renderer renderer = GetComponent <Renderer>(); if (afterRemoveTile && !isOccupied) { renderer.material.color = Color.white; return; } if (transform.parent.tag == "PlayerHeroRow" && !GetComponent <Tile>().isOccupied) { renderer.material.color = Color.white; } if (transform.parent.tag == "PlayerPlayRow" && !GetComponent <Tile>().isOccupied) { renderer.material.color = Color.magenta; //e.Tile.GetComponent<Renderer>().material.color = Color.magenta; } }
private void RemoveTileColor(object sender, EventManager.OnTileEventArgs e) { e.Tile.GetComponent <Tile>().isOccupied = false; //e.Tile.GetComponent<Renderer>().material.color = Color.white; SetDragColor(sender, e, true); }