public void Discover(Ownable owned) { visibleByList.Add(owned); discoveredBy.Add(owned.GetOwner()); State = EHexState.Visible; if (!IsEmpty()) { ObjectInCell.SetActive(true); } gameObject.GetComponentInChildren <MeshRenderer>().material = VisibleMaterial; }
public void UnDiscover() { visibleByList.Clear(); State = EHexState.Undiscovered; if (!IsEmpty() && ObjectInCell.tag != "Star") { ObjectInCell.SetActive(false); } gameObject.GetComponentInChildren <MeshRenderer>().material = UndiscoveredMaterial; if (!IsEmpty() && ObjectInCell.tag == "Star") { gameObject.GetComponentInChildren <MeshRenderer>().material = VisibleMaterial; } }
public void Hide() { visibleByList.Clear(); State = EHexState.Hidden; gameObject.GetComponentInChildren <MeshRenderer>().material = HiddenMaterial; if (!IsEmpty()) { if (ObjectInCell.tag != "Star" && ObjectInCell.tag != "Planet") { ObjectInCell.SetActive(false); } if (ObjectInCell.tag == "Star") { gameObject.GetComponentInChildren <MeshRenderer>().material = VisibleMaterial; } } }