Exemple #1
0
        internal void ExecuteOrder(Order order, OrderButton orderButton)
        {
            fertilizerParticles.Stop();
            pesticideParticles.Stop();
            waterParticles.Stop();
            seedingParticles.Stop();

            wayPointIndex           = -1;
            this.currentOrderButton = orderButton;
            this.currentOrder       = order;
            this.currentOrder.Execute(mover, orderCallback);
            isMoving = false;
            if (cnt == null)
            {
                cnt = FindObjectOfType <UIController>();
            }
            cnt.updateOrder(currentOrder.orderType);
        }
Exemple #2
0
        private void OrderCallBack()
        {
            Debug.Log("Invoked orderCallback");
            switch (currentOrder.orderType)
            {
            case OrderType.seeds:
                seeds = 1;
                break;

            case OrderType.pesticide:
                pesticide = 1;
                break;

            case OrderType.water:
                water = 1;
                break;
            }
            currentOrderType = currentOrder.orderType;
            currentOrder     = null;
            currentOrderButton.DoneExecuting();
            currentOrderButton = null;
        }