コード例 #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
ファイル: ShaftHitSystem.cs プロジェクト: radiomonter/Tanki_X
        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);
        }