void Start() { hagglingController = FindObjectOfType <HagglingController>(); satisfactionMax = satisfactionLevelSprites.Length - 1; hagglingController.SatisfactionMax = satisfactionMax; satisfactionLevel = satisfactionMax; faceImage.sprite = satisfactionLevelSprites[satisfactionLevel]; }
public void Done() { HagglingController hagglingController = FindObjectOfType <HagglingController>(); hagglingController.transaction.Offer = resultingOffer; hagglingController.CalculateSatisfaction(); FindObjectOfType <HagglingCanvas>().RedrawAll(); gameObject.SetActive(false); }
public void SetResults() { if (success) { HagglingController hagglingController = FindObjectOfType <HagglingController>(); hagglingController.AddItemToTransaction(selectedItem); Debug.Log("Success"); } else { inventoryHandler.ReturnItem(); } Invoke("ExitMiniGame", 3.0f); }
public void Show() { HagglingController hagglingController = FindObjectOfType <HagglingController>(); if (hagglingController.CurrentStamina > 0) { startingOffer = hagglingController.transaction.Offer; hagglingController.CurrentStamina -= hagglingController.HagglingCost; textField.text = startingOffer.ToString(); gameObject.SetActive(true); } else { Debug.Log("Stamina too low"); } }