protected override void OnHit(BulletInfo info) { var current = healthReader.Data.Health; current -= info.Power; if (current < 0) { current = 0; } healthCommandSender.SendModifyHealthCommand(entityId, new HealthModifier(0, current)); }
public BulletInfo(BulletInfo info, byte act) { Power = info.Power; Type = info.Type; Alignment = info.Alignment; LaunchPosition = info.LaunchPosition; InitialVelocity = info.InitialVelocity; CurrentVelocity = info.CurrentVelocity; LaunchTime = info.LaunchTime; LifeTime = info.LifeTime; GunId = info.GunId; ShooterEntityId = info.ShooterEntityId; BulletId = info.BulletId; active = act; }
private void Query(Rigidbody rigid, ref BulletInfo info) { if (!info.IsActive) { return; } // time check var diff = Time.ElapsedTime - info.LaunchTime; if (diff >= info.LifeTime) { info.IsActive = false; rigid.gameObject.SetActive(false); return; } }
protected virtual void OnHit(BulletInfo info) { }