示例#1
0
        private void RefillPlantSupplies(GameObject playerObject)
        {
            Debug.Log("Doing plant stuff");
            TractorController ctrl = playerObject.GetComponent <TractorController>();

            switch (ctrl.currentOrderType)
            {
            case OrderType.seeds:
                uiCnt.scoreUpdate(1);
                seeded = true;
                seedPod.SetActive(true);
                break;

            case OrderType.fertilizer:
                uiCnt.scoreUpdate(2);
                fertilizerSupply = 1f;
                break;

            case OrderType.pesticide:
                uiCnt.scoreUpdate(2);
                pesticideSupply = 1f;
                break;

            case OrderType.water:
                uiCnt.scoreUpdate(1);
                plantMat.color = defaultColor;
                waterSupply    = 1;
                break;
            }
        }
示例#2
0
 private void Start()
 {
     button     = GetComponent <Button>();
     allButtons = FindObjectsOfType <OrderButton>();
     tract      = FindObjectOfType <TractorController>();
 }