示例#1
0
        /// <summary>
        /// /!\ The creation of <see cref="PlayerAimRangeFeedbackSystem"/> must absolutely be done after that physics objects have been taken into account from the physics engine.
        ///     This is because the <paramref name="FiringPlayerActionTargetSystemRef"/> uses operations on newly created physics object to calculate
        ///     the target direction <see cref="FiringPlayerActionTargetSystem.Tick"/>
        /// </summary>
        public PlayerAimRangeFeedbackSystem(CoreInteractiveObject playerInteractiveObject, FiringPlayerActionTargetSystem FiringPlayerActionTargetSystemRef)
        {
            IsInitialized           = true;
            PlayerInteractiveObject = playerInteractiveObject;
            this.FiringPlayerActionTargetSystemRef = FiringPlayerActionTargetSystemRef;
            this.firingRangeFeedbackRangeObject    = new FiringRangeFeedbackRangeObject(
                InteractiveGameObjectFactory.Build_Allocate(new GameObject("FiringRangeFeedbackRangeObject")),
                PlayerAimingRangeFeedbackConfigurationGameObject.Get().playerAimingRangeVisualFeedbackConfiguration.FiredProjectileFeedbackPrefab,
                playerInteractiveObject);

            this.firingRangeFeedbackRangeObject.InitializeRaybox(CalculateFiringTargetPosition());
        }
示例#2
0
        public PlayerAimingInteractiveObjectAction(ref FiringInteractiveObjectActionInput firingInteractiveObjectActionInput) :
            base(firingInteractiveObjectActionInput.PlayerAimingInteractiveObjectActionInherentData.coreInteractiveObjectActionDefinition)
        {
            this.FiringInteractiveObject = firingInteractiveObjectActionInput.firingInteractiveObject;

            var gameInputManager = GameInputManager.Get();

            this._playerAimingInteractiveObjectActionInherentData = firingInteractiveObjectActionInput.PlayerAimingInteractiveObjectActionInherentData;

            this.FiringPlayerActionTargetSystem           = new FiringPlayerActionTargetSystem(this._playerAimingInteractiveObjectActionInherentData, this.FiringInteractiveObject, TargetCursorManager.Get());
            this.PlayerObjectOrientationSystem            = new PlayerObjectOrientationSystem(this.FiringInteractiveObject as IPlayerInteractiveObject, this.FiringPlayerActionTargetSystem);
            this.InteractiveObjectTargettedVisualFeedback = new InteractiveObjectTargettedVisualFeedback(firingInteractiveObjectActionInput.PlayerAimingInteractiveObjectActionInherentData, Camera.main);

            this.ExitActionSystem = new ExitActionSystem(gameInputManager);

            this._firingLockSelectionSystem = new FiringLockSelectionSystem(this.OnInteractiveObjectTargetted);


            /// Initialisation of states
            this.Tick(0f);
            this.AfterTicks(0f);
        }
示例#3
0
 public PlayerObjectOrientationSystem(IPlayerInteractiveObject PlayerInteractiveObjectRef,
                                      FiringPlayerActionTargetSystem FiringPlayerActionTargetSystemRef)
 {
     this.PlayerInteractiveObjectRef        = PlayerInteractiveObjectRef;
     this.FiringPlayerActionTargetSystemRef = FiringPlayerActionTargetSystemRef;
 }