// Start is called before the first frame update public void Interact(InteractController controller) { if (Buy(controller.GetComponent <MoneyController>())) { Pickup(controller.GetComponent <GearController>()); } }
public void Interact(InteractController controller) { Inventory inventory = controller.GetComponent <Inventory>(); if (IsPlaceboEquipped(inventory)) { Task task = taskManager.TaskExists(GameManager.TaskType.VAX); if (!task) { feedbackText = Instantiate(feedbackTextPrefab, feedbackContainer.transform); feedbackText.GetComponent <Text>().text = "Not now man! Now is not the time for that!"; Destroy(feedbackText, 5.0f); } else { feedbackText = Instantiate(feedbackTextPrefab, feedbackContainer.transform); feedbackText.GetComponent <Text>().text = "Vax switched"; Destroy(feedbackText, 5.0f); inventory.Remove(placebo); feedbackText = Instantiate(feedbackTextPrefab, feedbackContainer.transform); feedbackText.GetComponent <Text>().text = "Nice!"; Destroy(feedbackText, 5.0f); task.Accomplish(); } } }
public void Interact(InteractController controller) { if (Buy(controller.GetComponent <MoneyController>())) { Destroy(this.gameObject); } }
public void Interact(InteractController controller) { Inventory inventory = controller.GetComponent <Inventory>(); if (IsPlaceboEquipped(inventory)) { Debug.Log("Vax switched"); inventory.Remove(placebo); Task task = taskManager.TaskExists(GameManager.TaskType.VAX); if (task) { Debug.Log("Nice!"); task.Accomplish(); } } }
public void Interact(InteractController controller) { ChildHandler childHandler = controller.GetComponentInChildren <ChildHandler>(); ChildHandler currentHandler = GetComponentInParent <ChildHandler>(); playerController = controller.GetComponent <PlayerController>(); if (currentHandler && currentHandler.isEquipped && currentHandler != childHandler) { currentHandler.Remove(); } if (childHandler.isEquipped) { childHandler.Remove(); return; } childHandler.Equip(this); }
public void Interact(InteractController controller) { Inventory inventory = controller.GetComponent <Inventory>(); inventory.Add(item); }