public void CustomerDroppedInZone(Zone zone) { GameObject feedbackIcon = Instantiate(God.instance.feedbackIconPrefab, transform.position, Quaternion.identity) as GameObject; Customer.ZoneMatchingResults result = customerModel.DroppedInZone(zone); if (result == Customer.ZoneMatchingResults.Fail) { feedbackIcon.GetComponent<FeedbackIcon>().icon = FeedbackIcon.Icons.Fail; AudioManager.instance.PlayAudioForIcon(FeedbackIcon.Icons.Fail); GetComponent<UIDragDropItem>().enabled = false; customerModel.Die(); return; } else if (result == Customer.ZoneMatchingResults.SecondBest) { //Should create little icon customer here? feedbackIcon.GetComponent<FeedbackIcon>().icon = FeedbackIcon.Icons.SecondBestOption; } else { //Should create little icon customer here? feedbackIcon.GetComponent<FeedbackIcon>().icon = FeedbackIcon.Icons.BestOption; } GetComponent<UIDragDropItem>().enabled = false; zone.AddCustomer(customerModel); AudioManager.instance.PlayAudioForIcon(feedbackIcon.GetComponent<FeedbackIcon>().icon); // transform.parent = null; DestroyCustomerView(); }
public void CustomerDroppedInZone(Zone zone) { GameObject feedbackIcon = Instantiate(God.instance.feedbackIconPrefab, transform.position, Quaternion.identity) as GameObject; Customer.ZoneMatchingResults result = customerModel.DroppedInZone(zone); if (result == Customer.ZoneMatchingResults.Fail) { feedbackIcon.GetComponent <FeedbackIcon>().icon = FeedbackIcon.Icons.Fail; AudioManager.instance.PlayAudioForIcon(FeedbackIcon.Icons.Fail); GetComponent <UIDragDropItem>().enabled = false; customerModel.Die(); return; } else if (result == Customer.ZoneMatchingResults.SecondBest) { //Should create little icon customer here? feedbackIcon.GetComponent <FeedbackIcon>().icon = FeedbackIcon.Icons.SecondBestOption; } else { //Should create little icon customer here? feedbackIcon.GetComponent <FeedbackIcon>().icon = FeedbackIcon.Icons.BestOption; } GetComponent <UIDragDropItem>().enabled = false; zone.AddCustomer(customerModel); AudioManager.instance.PlayAudioForIcon(feedbackIcon.GetComponent <FeedbackIcon>().icon); // transform.parent = null; DestroyCustomerView(); }