private void FixedUpdate() { var d = Time.fixedDeltaTime; PlayerInteractiveObjectManager.Get().FixedTick(d); InteractiveObjectV2Manager.Get().FixedTick(d); }
private void Update() { if (SetPlayerPosition) { SetPlayerPosition = false; PlayerInteractiveObjectManager.Get().PlayerInteractiveObject.SetDestination(new ForwardAgentMovementCalculationStrategy(new AIDestination() { Rotation = this.TargetPlayerPosition.rotation, WorldPosition = this.TargetPlayerPosition.position })); } if (DestroyAllObstacles) { DestroyAllObstacles = false; for (var i = ObstacleInteractiveObjectManager.Get().AllObstacleInteractiveObjects.Count - 1; i >= 0; i--) { var currentInteractiveObject = ObstacleInteractiveObjectManager.Get().AllObstacleInteractiveObjects[i]; currentInteractiveObject.Destroy(); } } if (RestartLevel) { LevelTransitionManager.Get().RestartCurrentLevel(); RestartLevel = false; } if (RestoreHealth) { PlayerInteractiveObjectManager.Get().PlayerInteractiveObject.DealDamage(40, null); RestoreHealth = false; } }
public CoreInteractiveObject PlayerObject() { if (this.playerObject == null) { this.playerObject = PlayerInteractiveObjectManager.Get().PlayerInteractiveObject; } return(this.playerObject); }
private void LateUpdate() { var d = Time.deltaTime; PlayerInteractiveObjectManager.Get().LateTick(d); InteractiveObjectV2Manager.Get().LateTick(d); PlayerActionEntryPoint.Get().LateTick(d); ObstacleOcclusionCalculationManagerV2.Get().LateTick(); RangeIntersectionCalculationManagerV2.Get().LateTick(); }
public override ASequencedAction[] BuildScenarioActions() { this.EnemyObject = InteractiveObjectV2Manager.Get().InteractiveObjects.Find(o => o.InteractiveGameObject.GetAssociatedGameObjectName() == EnemyObjectName); this.PlayerInteractiveObject = PlayerInteractiveObjectManager.Get().PlayerInteractiveObject; return(new ASequencedAction[] { new AIWarpActionV2(this.PlayerInteractiveObject, this.PlayerStartPosition, null) .Then(new WaitForSecondsAction(1.5f) .Then(new AIMoveToActionV2(this.PlayerTargetPosition, null, AIMovementSpeedAttenuationFactor.RUN, (strategy) => { this.PlayerInteractiveObject.SetDestination(strategy); }, this.PlayerInteractiveObject.SetAISpeedAttenuationFactor)) ) }); }
public override ASequencedAction[] BuildScenarioActions() { /// By default player has infinite health PlayerInteractiveObjectManager.Get().PlayerInteractiveObject.DealDamage(-99999999, null); var playerObject = PlayerInteractiveObjectManager.Get().PlayerInteractiveObject; var enemyObject = InteractiveObjectV2Manager.Get().InteractiveObjects.Find(o => o.InteractiveGameObject.GetAssociatedGameObjectName() == "GameObject"); return(new ASequencedAction[] { new ProjectileDeflectionTestScenarioAction(enemyObject, playerObject) .Then(new HealthGlobeRecoveryScenarioAction(playerObject)) }); }
protected override void Start() { base.OnStart(); /// Preventing switching to the "Game" window in editor. UnityEditor.SceneView.FocusWindowIfItsOpen(typeof(UnityEditor.SceneView)); base.Start(); PlayerInteractiveObjectCreatedEvent.Get().RegisterPlayerInteractiveObjectCreatedEvent((p) => { /// Player is forced to be controlled by agent PlayerInteractiveObjectManager.Get().PlayerInteractiveObject.PlayerMoveManager.ForceSwitchToAgent(); }); }
private void UnRegisterEvents() { var PlayerInteractiveObject = PlayerInteractiveObjectManager.Get().PlayerInteractiveObject; if (PlayerInteractiveObject is IEM_IPlayerAimingFiringRegisteringEventsExposedMethod IPlayerFiringRegisteringEventsExposedMethod) { IPlayerFiringRegisteringEventsExposedMethod.UnRegisterOnPlayerStartTargettingEvent(this.OnPlayerStartTargetting); IPlayerFiringRegisteringEventsExposedMethod.UnRegisterOnPlayerStoppedTargettingEvent(this.OnPlayerStoppedTargetting); } if (PlayerInteractiveObject is IEM_IPlayerDashDirectionActionRegisteringEventsExposedMethod IEM_IPlayerDashDirectionActionRegisteringEventsExposedMethod) { IEM_IPlayerDashDirectionActionRegisteringEventsExposedMethod.UnRegisterOnPlayerDashDirectionActionStartedEvent(this.OnPlayerDashDirectionActionStarted); IEM_IPlayerDashDirectionActionRegisteringEventsExposedMethod.UnRegisterOnPlayerDashDirectionActionEndedEvent(this.OnPlayerDashDirectionActionEnded); } }
public override ASequencedAction[] BuildScenarioActions() { var PlayerInteractiveObject = PlayerInteractiveObjectManager.Get().PlayerInteractiveObject; return(new ASequencedAction[] { new AIWarpActionV2(PlayerInteractiveObject, Spawn, default(Nullable <Vector3>)) .Then(new AIMoveToActionV2(this.P1.WorldPosition, this.P1.GetWorldRotation(), P1.AIMovementSpeed, (strategy) => { PlayerInteractiveObject.SetDestination(strategy); }, PlayerInteractiveObject.SetAISpeedAttenuationFactor) .Then(new AIMoveToActionV2(this.P2.WorldPosition, this.P2.GetWorldRotation(), P2.AIMovementSpeed, (strategy) => { PlayerInteractiveObject.SetDestination(strategy); }, PlayerInteractiveObject.SetAISpeedAttenuationFactor) .Then(new AIMoveToActionV2(this.P3.WorldPosition, this.P3.GetWorldRotation(), P3.AIMovementSpeed, (strategy) => { PlayerInteractiveObject.SetDestination(strategy); }, PlayerInteractiveObject.SetAISpeedAttenuationFactor) .Then(new AIWarpActionV2(PlayerInteractiveObject, Vector3.zero, null)) ) ) ) }); }
private void StartTest() { this.TestControllerConfiguration.TestControllerDefinition.StartTest = false; var aTestScenarioDefinition = this.TestControllerConfiguration.TestControllerDefinition.aTestScenarioDefinition; this.TestEntitiesPrefabInstance = GameObject.Instantiate(aTestScenarioDefinition.TestEntitiesPrefab); aTestScenarioDefinition.BeforeObjectInitialization(); RangeObjectV2Manager.InitializeAllRangeObjects(); InteractiveObjectV2Manager.Get().InitializeAllInteractiveObjectsInitializer(); /// By default player has infinite health PlayerInteractiveObjectManager.Get().PlayerInteractiveObject.DealDamage(9999999, null); this.SequencedActionPlayer = new SequencedActionPlayer(aTestScenarioDefinition.BuildScenarioActions()); this.SequencedActionPlayer.Play(); }
public override ASequencedAction[] BuildScenarioActions() { this.EnemyObject = InteractiveObjectV2Manager.Get().InteractiveObjects.Find(o => o.InteractiveGameObject.GetAssociatedGameObjectName() == EnemyObjectName); this.PlayerInteractiveObject = PlayerInteractiveObjectManager.Get().PlayerInteractiveObject; return(new ASequencedAction[] { new AIWarpActionV2(this.PlayerInteractiveObject, this.Fire1PlayerPosition, null) .Then(new TargetAndFireToInteractiveObjectAction(this.EnemyObject) .Then(new AIMoveToActionV2(Vector3.zero, null, AIMovementSpeedAttenuationFactor.RUN, (strategy) => { this.PlayerInteractiveObject.SetDestination(strategy); }, this.PlayerInteractiveObject.SetAISpeedAttenuationFactor).Then(BuildWarpPlayerBehindEnemyAction()) .Then(new TargetAndFireToInteractiveObjectAction(this.EnemyObject) .Then(new AIWarpActionV2(this.PlayerInteractiveObject, Vector3.zero, null)) ) ) ) }); }
private void Update() { var d = Time.deltaTime; BeforeTick(d); TutorialManager.Get().Tick(d); PuzzleTutorialEventSenderManager.Get().Tick(d); BlockingCutscenePlayerManager.Get().Tick(d); PlayerActionEntryPoint.Get().Tick(d); PlayerInteractiveObjectManager.Get().Tick(d); PlayerInteractiveObjectManager.Get().AfterTicks(d); CameraMovementManager.Get().Tick(d); ObstacleOcclusionCalculationManagerV2.Get().Tick(d); RangeIntersectionCalculationManagerV2.Get().Tick(d); RangeObjectV2Manager.Get().Tick(d); InteractiveObjectV2Manager.Get().Tick(d); InteractiveObjectV2Manager.Get().AfterTicks(d); GroundEffectsManagerV2.Get().Tick(d); DottedLineRendererManager.Get().Tick(); SelectableObjectManagerV2.Get().Tick(d); CircleFillBarRendererManager.Get().Tick(d); #if UNITY_EDITOR EditorOnlyManagers.Tick(d); #endif }
public override ASequencedAction[] BuildScenarioActions() { CoreInteractiveObject targettedObject0 = null; CoreInteractiveObject targettedObject1 = null; CoreInteractiveObject targettedObject2 = null; IEM_ProjectileFireActionInput_Retriever playerInteractiveObject = PlayerInteractiveObjectManager.Get().PlayerInteractiveObject; foreach (var io in InteractiveObjectV2Manager.Get().InteractiveObjects) { if (io.InteractiveGameObject.GetAssociatedGameObjectName() == TestTargettedObjectName0) { targettedObject0 = io; } if (io.InteractiveGameObject.GetAssociatedGameObjectName() == TestTargettedObjectName1) { targettedObject1 = io; } if (io.InteractiveGameObject.GetAssociatedGameObjectName() == TestTargettedObjectName2) { targettedObject2 = io; } } GameObject AimPhysicsTestPoint0Object = GameObject.Find(AimPhysicsTestPoint0); GameObject AimPhysicsTestPoint1Object = GameObject.Find(AimPhysicsTestPoint1); return(new ASequencedAction[] { new EnsureTargetLockAction(playerInteractiveObject, targettedObject0) .Then(new Target_FireInteractiveObject_AndWait_Action(targettedObject0, new Target_FireInteractiveObject_AndWait_ActionDefintion(() => targettedObject0.IsAskingToBeDestroyed)) .Then(new EnsureTargetLockAction(playerInteractiveObject, targettedObject1) .Then(new Target_FireInteractiveObject_AndWait_Action(targettedObject1, new Target_FireInteractiveObject_AndWait_ActionDefintion(() => targettedObject1.IsAskingToBeDestroyed)) .Then(new EnsureTargetLockAction(playerInteractiveObject, targettedObject2) .Then(new Target_FireInteractiveObject_AndWait_Action(targettedObject2, new Target_FireInteractiveObject_AndWait_ActionDefintion(() => targettedObject2.IsAskingToBeDestroyed)) .Then(new WaitForSecondsAction(0.5f) .Then(new TimeFreezePressedAction() .Then(new StartAimingAction() .Then(new MoveTargetCursorSmoothScreenPosition( new MoveTargetCursorSmoothScreenPositionData(Camera.main.ScreenToViewportPoint(TargetCursorManager.Get().GetTargetCursorScreenPosition()), Camera.main.WorldToViewportPoint(AimPhysicsTestPoint0Object.transform.position), 0.1f)) .Then(new StopAimingAction() .Then(new TimeFreezePressedAction() .Then(new StartAimingAction() .Then(new MoveTargetCursorSmoothScreenPosition( new MoveTargetCursorSmoothScreenPositionData(new Vector2(0.5f, 0.5f), Camera.main.WorldToViewportPoint(AimPhysicsTestPoint0Object.transform.position), 0.1f))) ) ) ) ) )) ) ) ) ) ) ) }); }
public void FirstExecutionAction() { this.playerCrossedDistance = 0f; this.lastFramePlayerPosition = null; this.PlayerInteractiveObject = PlayerInteractiveObjectManager.Get().PlayerInteractiveObject; }
public override void Init() { interactiveObjectTag = new InteractiveObjectTag { IsAttractiveObject = true }; var physicsInteractionSelectionGuard = new InteractiveObjectTagStruct(isAi: 1); AttractiveObjectSystem = new AttractiveObjectSystem(this, physicsInteractionSelectionGuard, this.TestAttractiveObjectInitializerData.AttractiveObjectSystemDefinition, OnAssociatedAttractiveSystemJustIntersected, OnAssociatedAttractiveSystemNoMoreIntersected, OnAssociatedAttractiveSystemInterestedNothing); DisarmObjectSystem = new DisarmObjectSystem(this, this.TestAttractiveObjectInitializerData.DisarmSystemDefinition, new InteractiveObjectTagStruct { IsAi = 1 }, OnAssociatedDisarmObjectTriggerEnter, OnAssciatedDisarmObjectTriggerExit); SelectableObjectSystem = new SelectableObjectSystem(this, this.TestAttractiveObjectInitializerData.SelectableObjectSystemDefinition, this.TestAttractiveObjectInitializerData.SelectableGrabActionDefinition.BuildPlayerAction(PlayerInteractiveObjectManager.Get().PlayerInteractiveObject)); }