void OnMouseDown() { if (!hasAuthority) { return; } if (!WorldHandler.isShiftDown()) { WorldHandler.deselectAntHill(); WorldHandler.deselectUnits(); } GameObject indicator = gameObject.transform.FindChild("Indicator").gameObject; indicator.SetActive(!indicator.activeSelf); isUnitSelected = indicator.activeSelf; if (isUnitSelected) { WorldHandler.PlayUnitBattleSound(); WorldHandler.unitsSelected.Add(gameObject); } else { WorldHandler.unitsSelected.Remove(gameObject); } }
void OnMouseDown() { if (EventSystem.current.IsPointerOverGameObject()) { return; } if (!GetComponent <NetworkIdentity>().hasAuthority) { return; } if (!WorldHandler.isShiftDown()) { WorldHandler.deselectUnits(); } GameObject indicator = gameObject.transform.FindChild("Indicator").gameObject; indicator.SetActive(!indicator.activeSelf); isAntHillSelected = indicator.activeSelf; }