예제 #1
0
        public void FillTargetingData(ShaftAimingStraightTargetingEvent evt, ShaftAimingStraightTargetingNode weapon)
        {
            TargetingData targetingData = evt.TargetingData;

            targetingData.Origin       = new MuzzleLogicAccessor(weapon.muzzlePoint, weapon.weaponInstance).GetBarrelOriginWorld();
            targetingData.Dir          = evt.WorkingDirection;
            targetingData.FullDistance = weapon.verticalSectorsTargeting.WorkDistance;
            base.ScheduleEvent(new ShaftAimingCollectDirectionEvent(targetingData), weapon);
            base.ScheduleEvent(new ShaftAimingCollectTargetsEvent(targetingData), weapon);
        }
예제 #2
0
        private void PrepareAimingTargets(Entity weapon, Vector3 workingDir)
        {
            TargetingData targetingData = BattleCache.targetingData.GetInstance().Init();
            ShaftAimingStraightTargetingEvent eventInstance = new ShaftAimingStraightTargetingEvent {
                TargetingData    = targetingData,
                WorkingDirection = workingDir
            };

            base.ScheduleEvent(eventInstance, weapon);
            base.ScheduleEvent(new SendShotToServerEvent(targetingData), weapon);
            base.ScheduleEvent(new SendShaftAimingHitToServerEvent(targetingData), weapon);
        }