コード例 #1
0
 public void ShootDroneWeapon(UpdateEvent e, SelfDroneWithTargetNode drone, [JoinByUnit] ShootingDroneWeapon droneWeapon)
 {
     if (droneWeapon.cooldownTimer.CooldownTimerSec <= 0f)
     {
         base.ScheduleEvent <ShotPrepareEvent>(droneWeapon);
     }
 }
コード例 #2
0
        public void Targeting(UpdateEvent e, SelfDroneWithTargetNode drone)
        {
            Entity target = drone.unitTarget.Target;

            if (!(target.Alive && target.HasComponent <TankActiveStateComponent>()))
            {
                drone.Entity.RemoveComponent <UnitTargetComponent>();
            }
        }
コード例 #3
0
 public void ControllDroneWeapon(UpdateEvent e, SelfDroneWithTargetNode drone, [JoinByUnit] SelfDroneWeapon droneWeapon)
 {
     if ((Time.timeSinceLevelLoad - droneWeapon.droneWeapon.lastControlTime) >= WEAPON_CONTROL_PERIOD)
     {
         droneWeapon.droneWeapon.lastControlTime = Time.timeSinceLevelLoad;
         if (this.IsTargetVisable(droneWeapon))
         {
             this.StartShooting(droneWeapon.Entity);
             drone.droneAnimator.StartShoot();
             droneWeapon.droneWeapon.lastTimeTargetSeen = Time.time;
         }
         else
         {
             this.StopShooting(droneWeapon.Entity);
             drone.droneAnimator.StartIdle();
             drone.Entity.RemoveComponentIfPresent <UnitTargetComponent>();
         }
     }
 }
コード例 #4
0
 public void ControllDroneWeapon(NodeRemoveEvent e, SelfDroneWithTargetNode drone, [JoinByUnit] SelfDroneWeapon droneWeapon)
 {
     this.StopShooting(droneWeapon.Entity);
 }