コード例 #1
0
 void BuildRoadShortEvent()
 {
     if (costs.Purchasable(costs.roadShort)) // have this return a build to check if we can build, if this returns false, have the buildCosts do the alerting that we don't have enough funds
     {
         start             = true;
         buildingSelection = roadShort;
         PlaceStartingBuilding(roadShort);
     }
 }
コード例 #2
0
    void BuyLandGridClickedEvent()
    {
        if (costs.Purchasable(costs.land))
        {
            if (!buyLandGridToggle)
            {
                landParcel.SetActive(true);
                // GO = landParcel;
                CreateGameObject(landParcel);
                startDraggingBuyLandSelector = true;
                destroyToggle = false;
            }

            else if (buyLandGridToggle)
            {
                landParcel.SetActive(false);
                startDraggingBuyLandSelector = false;
            }

            if (destroyToggle)
            {
                buyLandGridToggle = !buyLandGridToggle;
            }
        }
    }
コード例 #3
0
 public void BuyLandEvent()
 {
     if (costs.Purchasable(costs.land))
     {
         // set the snap to grid level, but keep in mind, will need to declare the snap to grid level for each build method
         gridSize = 64.0f;
         Debug.Log("Buying land!");
         start             = true;
         buildingSelection = land;
         PlaceStartingBuilding(land);
     }
 }