Ejemplo n.º 1
0
    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);
    }