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));
        }
Exemplo n.º 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;
 }
Exemplo n.º 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;
            }
        }
Exemplo n.º 4
0
 protected virtual void OnHit(BulletInfo info)
 {
 }