Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (powerSelected == "")
     {
         powerSelected = potionManager.GetComponent <PotionManager>().tabPowerPotions[potionColorId];
     }
 }
Example #2
0
    void OnTriggerEnter2D(Collider2D other)
    {
        power = potionManager.GetComponent <PotionManager>().tabPowerPotions[potionColorId];
        if (other.tag == "enemy" || other.tag == "Player")
        {
            var user = other.GetComponent <Character>();
            switch (power)
            {
            case ("Stun"):
                powerStun(user);
                break;

            case ("Degats"):
                powerDegats(user);
                break;

            case ("Heal"):
                powerHeal(user);
                break;
            }
        }
        // Appel du pouvoir selectionner
    }