void ChangeAttackCore(bool open) { if (damageBox != null) { if (damageBox.enabled != open) { damageBox.enabled = open; } } if (hitBox != null) { hitBox.ChangeAttack(open); } }
//是否开启武器触发器,用于打碎瓶子罐子,等场景物件,与部分只响应攻击的 public void ChangeAttack(bool open) { for (int i = 0; i < weaponDamage.Count; i++) { if (weaponDamage[i] == null) { continue; } if (weaponDamage[i].enabled != open) { weaponDamage[i].enabled = open; FightBox fb = weaponDamage[i].GetComponent <FightBox>(); if (fb != null) { fb.ChangeAttack(open); } } } }