public void OnBeforeFire(WeaponBaseAgent weaponBaseAgent, WeaponSideCmd cmd) { var runTimeComponent = weaponBaseAgent.RunTimeComponent; if (runTimeComponent.LastAttackTimestamp == 0) { } else { var config = weaponBaseAgent.PistolAccuracyLogicCfg; if (config == null) { return; } runTimeComponent.Accuracy = AccuracyFormula.GetPistolAccuracy(cmd.UserCmd.RenderTime - runTimeComponent.LastAttackTimestamp, config.AccuracyFactor, config.MinAccuracy, config.MaxAccuracy); } }
public void OnBeforeFire(WeaponAttackProxy attackProxy, WeaponSideCmd cmd) { var runTimeComponent = attackProxy.RuntimeComponent; if (runTimeComponent.LastAttackTimestamp == 0) { } else { var config = attackProxy.WeaponConfigAssy.S_PistolAccuracyLogicCfg; if (config == null) { return; } runTimeComponent.Accuracy = AccuracyFormula.GetPistolAccuracy(cmd.UserCmd.RenderTime - runTimeComponent.LastAttackTimestamp, config.AccuracyFactor, config.MinAccuracy, config.MaxAccuracy); } }