예제 #1
0
 // Start is called before the first frame update
 public void Interact(InteractController controller)
 {
     if (Buy(controller.GetComponent <MoneyController>()))
     {
         Pickup(controller.GetComponent <GearController>());
     }
 }
예제 #2
0
    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();
            }
        }
    }
예제 #3
0
 public void Interact(InteractController controller)
 {
     if (Buy(controller.GetComponent <MoneyController>()))
     {
         Destroy(this.gameObject);
     }
 }
예제 #4
0
    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();
            }
        }
    }
예제 #5
0
    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);
    }
예제 #6
0
    public void Interact(InteractController controller)
    {
        Inventory inventory = controller.GetComponent <Inventory>();

        inventory.Add(item);
    }