public void DisableAllDamage() { if (touchDamage != null) { touchDamage.DisableDamage(); } if (shortAttack.meleeDamage != null) { shortAttack.meleeDamage.DisableDamage(); } }
// Use this for initialization void Start() { instance = this; rigidbody2D = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); isFacingRight = true; sliding = false; animator.SetBool("Sliding", sliding); slidetime = maxSlideTime; slideCoolDownTime = slideCoolDown; attackMelee = false; animator.SetBool("Attack_Melee", attackMelee); attackMeleeCoolDownTime = attackMeleeCoolDown; shield = false; animator.SetBool("Shield", shield); shieldCoolDownTime = shieldCoolDown; crouch = false; animator.SetBool("Crouch", crouch); shoot = false; gun1 = false; hasgun1 = false; animator.SetBool("Gun1", gun1); shoot2 = false; gun2 = false; hasgun2 = false; animator.SetBool("Gun2", gun2); die = false; animator.SetBool("Die", die); knockback = false; knockbackCoolDownTime = 0.5f; damageSystem = GetComponent <DamageSystem>(); damageSystem.DisableDamage(); healthSystem = GetComponent <HealthSystem>(); }