Esempio n. 1
0
    protected override void Update()
    {
        base.Update();
        if (lastOrder == eOrderType.WORK && movable.hasReachedPosition)
        {
            if (targetStation.AssignWorker())
            {
                assigned = true;
                animator.SetTrigger("StartWork");
                assigneStation = targetStation;
            }
            lastOrder = eOrderType.NONE;
        }

        if (assigned && assigneStation.tag == "Truck")
        {
            Truck truck = (Truck)assigneStation;
            if (truck.state != Truck.eState.UNLOADING)
            {
                assigned = false;
                assigneStation.RemoveWorker();
                animator.SetTrigger("StopWork");
            }
        }
    }