Exemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (!other.CompareTag("Player"))
        {
            return;
        }
        ConsumableUI  consumablePlayerUI = other.transform.parent.Find("UI").Find("Consumable").GetComponent <ConsumableUI>();
        UseConsumable consumablePlayer   = other.transform.Find("UseConsumable").GetComponent <UseConsumable>();

        if (consumablePlayerUI.ConsumableExist())
        {
            return;
        }

        int consumable = _GenerateConsumable();

        consumablePlayerUI.AddConsumable(consumable);
        consumablePlayer.SetConsumable(consumable);
        _SetUsedSprite();
        Destroy(GetComponent <BoxCollider2D>());
    }
Exemplo n.º 2
0
    public void OnYButton()
    {
        UseConsumable useConsumable = consumableGO.GetComponent <UseConsumable>();

        useConsumable.launchCurrentEffect();
    }