/// <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()); }
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); }
public PlayerObjectOrientationSystem(IPlayerInteractiveObject PlayerInteractiveObjectRef, FiringPlayerActionTargetSystem FiringPlayerActionTargetSystemRef) { this.PlayerInteractiveObjectRef = PlayerInteractiveObjectRef; this.FiringPlayerActionTargetSystemRef = FiringPlayerActionTargetSystemRef; }