public void OnPointerDown(PointerEventData eventData) { if (eventData.button != PointerEventData.InputButton.Left) { return; } if (player.GetMyResources() < building.GetPrice()) { return; } unitSelection.SetIsBuildingState(true); buildingPreviewInstance = Instantiate(building.GetBuildingPreview()); buildingRendererInstance = buildingPreviewInstance.GetComponentInChildren <Renderer>(); buildingPreviewInstance.SetActive(false); }