コード例 #1
0
 //--------------------------------------------------------------Everything below this line is for damage Systems----------------------------------------------------------------------\\
 public void GetDamaged(int damage)
 {
     PlaySFX(SFXStates.Damage);
     whatGotDamaged = WhatGotDamaged.MainBody;
     if (isShieldGeneratorDestroyed != false)
     {
         bossHealth = bossHealth - damage;
         StartCoroutine(HitFlash());
     }
     else
     {
         StartCoroutine(HitFlash());
     }
     Debug.Log("Body damage");
 }
コード例 #2
0
 public void DamageShield(int damage)
 {
     PlaySFX(SFXStates.Damage);
     whatGotDamaged = WhatGotDamaged.ShieldGenerator;
     if (shieldHealth <= 0)
     {
         isShieldGeneratorDestroyed = true;
         Instantiate(explosionParticles, shieldGenerator.transform.position, shieldGenerator.transform.rotation);
         PlaySFX(SFXStates.SubExplosion);
         Destroy(shieldGenerator);
     }
     else
     {
         StartCoroutine(HitFlash());
         shieldHealth = shieldHealth - damage;
     }
     Debug.Log("shield damage");
 }
コード例 #3
0
 public void DamageCannon(int damage)
 {
     PlaySFX(SFXStates.Damage);
     whatGotDamaged = WhatGotDamaged.Cannon;
     if (cannonHealth < 0)
     {
         Instantiate(explosionParticles, turretBase.transform.position, turretBase.transform.rotation);
         turretBase.SetActive(false);
         turretHead.SetActive(false);
         PlaySFX(SFXStates.SubExplosion);
         isTurretDestroyed = true;
     }
     else
     {
         if (isShieldGeneratorDestroyed != false)
         {
             cannonHealth = cannonHealth - damage;
         }
         StartCoroutine(HitFlash());
     }
     Debug.Log("turret damage");
 }