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));
        }
Beispiel #2
0
 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;
 }
Beispiel #3
0
        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;
            }
        }
Beispiel #4
0
 protected virtual void OnHit(BulletInfo info)
 {
 }