示例#1
0
    private void Queue(GameObject customer)
    {
        CustomerPatience patience = customer.GetComponent <CustomerPatience>();
        SpriteRenderer   renderer = customer.GetComponent <SpriteRenderer>();

        Debug.Log(patience.GetInstanceID());

        customersToSpawn.Enqueue(customer);
        renderer.enabled = false;
        patience.SetPatienceInteractibility(false);
    }
示例#2
0
    //private Vector3Int dropoffPoint = new Vector3Int(-8, 5, 0);
    //private Luggage dropoffItem = new Luggage();
    //private Player receiver = null;

    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        customer      = animator.gameObject.GetComponent <Customer>();
        controller    = customer.controller;
        patience      = customer.patience;
        this.animator = animator;

        SubscribeEvents();

        //turn the patience counter back on
        patience.SetPatienceInteractibility(true);
    }
示例#3
0
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        customer      = animator.gameObject.GetComponent <Customer>();
        playerNode    = customer.GetComponentInChildren <PlayerNode>();
        patience      = customer.patience;
        satisfaction  = customer.satisfaction;
        renderer      = customer.GetComponent <SpriteRenderer>();
        this.animator = animator;
        receiver      = customer;

        SubscribeEvents();

        //turn the patience counter back on
        patience.SetPatienceInteractibility(true);
    }
示例#4
0
    public CustomerController Dequeue()
    {
        if (customersToSpawn.Count != 0)
        {
            //calls the first customer in the to-spawn list
            GameObject customer = customersToSpawn.Dequeue();

            CustomerController controller = customer.GetComponent <CustomerController>();
            Debug.Log(controller.GetInstanceID());
            CustomerPatience patience = customer.GetComponent <CustomerPatience>();
            SpriteRenderer   renderer = customer.GetComponent <SpriteRenderer>();

            renderer.enabled = true;
            patience.SetPatienceInteractibility(true);

            return(controller);
        }

        return(null);
    }