public void RightOrderServed() { CustomerPatience customerPatienceScript = GetComponent <CustomerPatience>(); if (greenText) { if (customerPatienceScript.customerMood == CurrentCustomerMood.customerHappy) { StartCoroutine(FadeInFadeOutText(gain40Points, greenText, true)); GameManager.Instance.AddServerScore(40); GameManager.Instance.IncreaseMood(5); } else if (customerPatienceScript.customerMood == CurrentCustomerMood.customerImpatient) { StartCoroutine(FadeInFadeOutText(gain20Points, greenText, true)); GameManager.Instance.AddServerScore(20); GameManager.Instance.IncreaseMood(2); } else if (customerPatienceScript.customerMood == CurrentCustomerMood.customerAngry) { StartCoroutine(FadeInFadeOutText(gain10Points, greenText, true)); GameManager.Instance.AddServerScore(10); } Evaluation_OverallPlayerPerformance.Instance.UpdateMaxCustomerServiceScore(40); } }
public void CustomerLeaves() { CustomerBehaviour_Queueing customerBehaviour_Queueing = GetComponent <CustomerBehaviour_Queueing>(); CustomerPatience customerPatienceScript = GetComponent <CustomerPatience>(); if (redText) { switch (customerBehaviour_Queueing.groupSizeNum) { case 1: StartCoroutine(FadeInFadeOutText(loseOneCustomer, redText)); GameManager.Instance.ReduceServerScore(10); break; case 2: StartCoroutine(FadeInFadeOutText(loseTwoCustomers, redText)); GameManager.Instance.ReduceServerScore(20); break; case 3: StartCoroutine(FadeInFadeOutText(loseThreeCustomers, redText)); GameManager.Instance.ReduceServerScore(30); break; case 4: StartCoroutine(FadeInFadeOutText(loseFourCustomers, redText)); GameManager.Instance.ReduceServerScore(40); break; } GameManager.Instance.DecreaseMood(5); Evaluation_CustomerService.Instance.UpdateNumCustomersServed(1, true); } }
private void Awake() { image = GetComponent <Image>(); patience = GetComponentInParent <CustomerPatience>(); if (patience != null) { patience.DeclareThis(label, this); } }
// 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; satisfaction = customer.satisfaction; this.animator = animator; receiver = Player.Instance; SubscribeEvents(); }
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); }
//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(); //signals the end of necessary variable-setting controller.InvokeMoveCompleteEvent(); }
//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); }
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); }
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); }