Beispiel #1
0
        public void USE_Consumable(Consumable_SO type)
        {
            if (type.consumableType == Consumable_SO.ConsumableType.INVISIBILITY)
            {
                OnInvisibilityInUse();
                OnInvisibilityDisabled();
            }
            else if (type.consumableType == Consumable_SO.ConsumableType.HEALTH)
            {
                playerData_SO.player_health = 100;
                EventData_SO.HealthChanged(playerData_SO.player_health);
            }

            else
            {
                OnConsumableInUse(type);
            }
        }
Beispiel #2
0
        void OnTriggerEnter(Collider other)
        {
            if (other.CompareTag("Consumable"))
            {
                other.gameObject.SetActive(false);
                StartCoroutine(reE(other.gameObject));

                Consumable_SO con = other.gameObject.GetComponent <ConsumableGameObject>().consumable;


                if (con.consumableType != Consumable_SO.ConsumableType.COIN)
                {
                    inventoryDataStore_SO.addConsumable(con);
                }
                ///Unit test
                playerData.player_health = playerData.player_health - 10;
                EventData_SO.HealthChanged(playerData.player_health);
            }

            if (other.CompareTag("LightFly"))
            {
                playerData.butterfly_is_free = true;
            }
        }
Beispiel #3
0
 void Start()
 {
     EventData_SO.HealthChanged(playerData_SO.player_health);
 }