public override void applyDamage(ref _Bullet3.DamageSourceUnit ds, float takeTime, float recoveryTime) { var vaildDamage = ds.damage * (1.0f - ds.moveStoppingRate); var recoverableRate = 1.0f - ds.heavyRate; if (mode == enMode.ready) { var hardDamage = vaildDamage; skin.applyDamage(hardDamage, takeTime, recoverableRate, recoveryTime); } else if (mode == enMode.repairingSkin) { var softDamage = vaildDamage * ds.fragmentationRate; under.applyDamage(softDamage, takeTime, recoverableRate, recoveryTime); } else // if( mode == enMode.repairingUnder ) { under.applyDamage(under.durability * 1.5f, 0.1f); } }
public override void applyDamage(ref _Bullet3.DamageSourceUnit ds, float takeTime, float recoveryTime) { var vaildDamage = ds.damage * (1.0f - ds.moveStoppingRate); var recoverableRate = 1.0f - ds.heavyRate; dsi = new DamageSourceInfo(ref ds); if (!outer.isDestroyed) { var hardDamage = vaildDamage; // Debug.Log(hardDamage); outer.applyDamage(hardDamage, takeTime, recoverableRate, recoveryTime); } else // if( !inner.isDestroyed ) { var softDamage = vaildDamage * ds.fragmentationRate; // Debug.Log( softDamage ); inner.applyDamage(softDamage, takeTime, recoverableRate, recoveryTime); } }