Exemple #1
0
 //Object's images become more broken as they go through the imageSet array until being officially broken at the last frame
 public override void Damage(float damageAmo)
 {
     damageAmo = damageAmo / (shadow.GetSize().x *GlobalRegistry.INVERSE_DAMAGE_MULTIPLIER());
     //Objects with zero or only one image are considered unbreakable and will stay the same forever
     if (imageSet.Length > 1)
     {
         if (broken == false && imageNum < imageSet.Length - 1)
         {
             if (damageAmo >= durability)
             {
                 imageNum++;
                 myRenderer.sprite = imageSet[imageNum];
             }
         }
         if (imageNum >= imageSet.Length - 1)
         {
             //If Sprite is last possible sprite, it is now the broken image and should be broken
             broken = true;
         }
     }
 }
Exemple #2
0
 public override void Damage(float damageAmo)
 {
     damageAmo = damageAmo / (shadow.GetSize().x *GlobalRegistry.INVERSE_DAMAGE_MULTIPLIER());
     GameManager.instance.DamageEffect();
     GameManager.instance.DrainCap((int)damageAmo * 2);
 }