Example #1
0
 public PlayerInteractiveObject(IInteractiveGameObject interactiveGameObject, InteractiveObjectLogicColliderDefinition InteractiveObjectLogicCollider,
                                A_AnimationPlayableDefinition LocomotionAnimationDefinition)
 {
     this.InteractiveObjectLogicCollider = InteractiveObjectLogicCollider;
     this.LocomotionAnimationDefinition  = LocomotionAnimationDefinition;
     base.BaseInit(interactiveGameObject, false);
 }
Example #2
0
 public RootAnimationAITestObject(IInteractiveGameObject interactiveGameObject, RootAnimationAITestObjectInitializerData RootAnimationAITestObjectInitializerData)
 {
     this.RootAnimationAITestObjectInitializerData = RootAnimationAITestObjectInitializerData;
     interactiveGameObject.CreateAgent(this.RootAnimationAITestObjectInitializerData.AIAgentDefinition);
     interactiveGameObject.CreateLogicCollider(this.RootAnimationAITestObjectInitializerData.InteractiveObjectLogicCollider);
     base.BaseInit(interactiveGameObject);
 }
Example #3
0
 public AggressiveAIObject(IInteractiveGameObject interactiveGameObject, AggressiveObjectInitializerData AIInteractiveObjectInitializerData)
 {
     this.AggressiveObjectInitializerData = AIInteractiveObjectInitializerData;
     interactiveGameObject.CreateLogicCollider(AIInteractiveObjectInitializerData.InteractiveObjectLogicCollider);
     interactiveGameObject.CreateAgent(AIInteractiveObjectInitializerData.AIAgentDefinition);
     base.BaseInit(interactiveGameObject, true);
 }
Example #4
0
        public Weapon(IInteractiveGameObject IInteractiveGameObject, WeaponDefinition WeaponDefinition, CoreInteractiveObject weaponHolder)
        {
            this.WeaponHolder = weaponHolder;
            this.BaseInit(IInteractiveGameObject, true);

            this.FiringProjectileSystem  = new FiringProjectileSystem(this, WeaponDefinition);
            this.WeaponPositioningSystem = new WeaponPositioningSystem(this, this.WeaponHolder);
        }
Example #5
0
        public SoliderEnemy(IInteractiveGameObject parent, SoliderEnemyDefinition SoliderEnemyDefinition)
        {
            var mainCamera = Camera.main;

            parent.CreateLogicCollider(SoliderEnemyDefinition.InteractiveObjectBoxLogicColliderDefinition);
            parent.CreateAgent(SoliderEnemyDefinition.AIAgentDefinition);
            this.interactiveObjectTag = new InteractiveObjectTag()
            {
                IsTakingDamage = true
            };
            BaseInit(parent);
            this.InteractiveObjectActionPlayerSystem = new InteractiveObjectActionPlayerSystem(this);
            this.HealthSystem = new HealthSystem(this, SoliderEnemyDefinition.HealthSystemDefinition, this.OnHealthChanged);
            this._stunningDamageDealerReceiverSystem = new StunningDamageDealerReceiverSystem(SoliderEnemyDefinition.stunningDamageDealerReceiverSystemDefinition, this.HealthSystem, this.OnStunningDamageDealingStarted, this.OnStunningDamageDealingEnded);
            this.WeaponHandlingSystem = new WeaponHandlingSystem(this,
                                                                 new WeaponHandlingSystemInitializationData(this, SoliderEnemyDefinition.WeaponHandlingSystemDefinition.WeaponHandlingFirePointOriginLocalDefinition,
                                                                                                            SoliderEnemyDefinition.WeaponHandlingSystemDefinition.WeaponDefinition));
            this.FiringTargetPositionSystem        = new FiringTargetPositionSystem(SoliderEnemyDefinition.FiringTargetPositionSystemDefinition);
            this.ObjectMovementSpeedSystem         = new ObjectMovementSpeedSystem(this, SoliderEnemyDefinition.AITransformMoveManagerComponentV3, new UnConstrainedObjectSpeedAttenuationValueSystem(AIMovementSpeedAttenuationFactor.RUN), ObjectSpeedCalculationType.AGENT);
            this.AIMoveToDestinationSystem         = new AIMoveToDestinationSystem(this, SoliderEnemyDefinition.AITransformMoveManagerComponentV3, this.OnAIDestinationReached);
            this.SoliderEnemyAnimationStateManager = new SoliderEnemyAnimationStateManager(this.AnimationController, SoliderEnemyDefinition.LocomotionAnimation, SoliderEnemyDefinition.SoldierAnimationSystemDefinition);
            this._soldierStateBehavior             = new SoldierStateBehavior();

            this.SightObjectSystem = new SightObjectSystem(this, SoliderEnemyDefinition.SightObjectSystemDefinition, tag => tag.IsPlayer || tag.IsGivingHealth,
                                                           this._soldierStateBehavior.OnInteractiveObjectJustOnSight, null, this._soldierStateBehavior.OnInteractiveObjectJustOutOfSight);

            Profiler.BeginSample("SoliderEnemy : Memory test");
            this.SightVisualFeedbackSystemPtr = SightVisualFeedbackSystemPointer.Allocate();
            this.SightVisualFeedbackSystemPtr.Ref()->Initialize(SoliderEnemyDefinition.SightVisualFeedbackSystemDefinition, this, mainCamera);
            this.SightVisualFeedbackStateBehavior = new SightVisualFeedbackStateBehavior(this.SightVisualFeedbackSystemPtr);
            Profiler.EndSample();

            this._soldierStateBehavior.Init(this, SoliderEnemyDefinition.SoldierAIBehaviorDefinition,
                                            new SoldierAIBehaviorExternalCallbacksV2()
            {
                SetAIAgentDestinationAction          = this.SetDestination,
                SetAIAgentDestinationAction_NoReturn = (IAgentMovementCalculationStrategy => this.SetDestination(IAgentMovementCalculationStrategy)),
                SetAIAgentSpeedAttenuationAction     = this.SetAISpeedAttenuationFactor,
                ClearAIAgentPathAction = this.AIMoveToDestinationSystem.ClearPath,
                AskToFireAFiredprojectile_WithWorldDirection_Action = this.FireProjectileAction_Start,
                GetWeaponFirePointOriginLocalDefinitionAction       = () => SoliderEnemyDefinition.WeaponHandlingSystemDefinition.WeaponHandlingFirePointOriginLocalDefinition,
                OnShootingAtPlayerStartAction = this.OnShootingAtPlayerStart,
                OnShootingAtPlayerEndAction   = this.OnShootingAtPlayerEnd,
                GetIWeaponHandlingSystem_DataRetrievalAction = this.WeaponHandlingSystem,
                OnMoveTowardsPlayerStartedAction             = (CoreInteractiveObject MovingTowardsObject) => this.SightVisualFeedbackStateBehavior.SetSightVisualFeedbackState(SightVisualFeedbackState.DANGER),
                OnMoveTowardsPlayerEndedAction              = () => this.SightVisualFeedbackStateBehavior.SetSightVisualFeedbackState(SightVisualFeedbackState.NONE),
                OnMoveAroundPlayerStartedAction             = (Vector3 LockedWorldPosition) => this.SightVisualFeedbackStateBehavior.SetSightVisualFeedbackState(SightVisualFeedbackState.WARNING),
                OnMoveAroundPlayerEndedAction               = () => this.SightVisualFeedbackStateBehavior.SetSightVisualFeedbackState(SightVisualFeedbackState.NONE),
                OnMoveToLastSeenPlayerPositionStartedAction = (Vector3 LockedWorldPosition) => this.SightVisualFeedbackStateBehavior.SetSightVisualFeedbackState(SightVisualFeedbackState.WARNING),
                OnMoveToLastSeenPlayerPositionEndedAction   = () => this.SightVisualFeedbackStateBehavior.SetSightVisualFeedbackState(SightVisualFeedbackState.NONE)
            });
        }
Example #6
0
        protected void BaseInit(IInteractiveGameObject interactiveGameObject, bool IsUpdatedInMainManager = true)
        {
            isAskingToBeDestroyed       = false;
            this.IsUpdatedInMainManager = IsUpdatedInMainManager;
            InteractiveGameObject       = interactiveGameObject;
            if (InteractiveGameObject.Animator != null)
            {
                this.AnimatorPlayable = new AnimatorPlayableObject(InteractiveGameObject.InteractiveGameObjectParent.name, InteractiveGameObject.Animator);
            }

            this.AnimationController = new AnimationController(InteractiveGameObject.Agent, this.AnimatorPlayable, InteractiveGameObject.PhysicsRigidbody, this.OnRootMotionEnabled, this.OnRootMotionDisabled);

            this.Init();
            this.InteractiveObjectEventsManager.OnInteractiveObjectCreated(this);
        }
Example #7
0
        public HealthGlobeInteractiveObject(HealthGlobeInteractiveObjectDefinitionStruct healthGlobeInteractiveObjectDefinitionStruct,
                                            IInteractiveGameObject interactiveGameObject, BeziersControlPointsBuildInput BeziersControlPointsBuildInput, bool IsUpdatedInMainManager = true)
        {
            this.HealthGlobeInteractiveObjectDefinitionStruct = healthGlobeInteractiveObjectDefinitionStruct;
            this.interactiveObjectTag = new InteractiveObjectTag()
            {
                IsGivingHealth = true
            };

            interactiveGameObject.CreateLogicCollider(healthGlobeInteractiveObjectDefinitionStruct.InteractiveObjectSphereLogicColliderDefinitionStruct);

            base.BaseInit(interactiveGameObject, IsUpdatedInMainManager);

            this.SpawnBeziersMovementSystem = new BeziersMovementSystem(BeziersControlPointsBuildInput, this.OnHealthGlobeSpawnBeziersMovementEnded);
            this.SpawnBeziersMovementSystem.StartBeziersMovement();
        }
Example #8
0
        public FiredProjectile(IInteractiveGameObject parent, FiredProjectileDefinition FiredProjectileDefinition, CoreInteractiveObject weaponHolder)
        {
            this.FiredProjectileDefinition = FiredProjectileDefinition;
            this.interactiveObjectTag = new InteractiveObjectTag() { IsDealingDamage = true };

            parent.CreateLogicCollider(BuildBoxColliderDefinition(FiredProjectileDefinition));
            this.BaseInit(parent, true);

            this.ProjectileWeaponHoldingSystem = new ProjectileWeaponHoldingSystem(weaponHolder);
            this.FiredProjectileMovementSystem = new FiredProjectileMovementSystem(FiredProjectileDefinition, this);
            this._damageDealerEmitterSystem = new DamageDealerEmitterSystem(this, FiredProjectileDefinition.damageDealerEmitterSystemDefinition,
                TriggerSelectionGuard: (InteractiveObjectPhysicsTriggerInfo) => FiredProjectileHasTriggerEnter_DealsDamage_And_MustBeDestroyed(InteractiveObjectPhysicsTriggerInfo.OtherInteractiveObject, this.ProjectileWeaponHoldingSystem.GetWeaponHolder()),
                OnDamageDealtToOtherAction: null);
            this.RegisterInteractiveObjectPhysicsEventListener(new InteractiveObjectPhysicsEventListenerDelegated(
                (InteractiveObjectPhysicsTriggerInfo) => FiredProjectileHasTriggerEnter_DealsDamage_And_MustBeDestroyed(InteractiveObjectPhysicsTriggerInfo.OtherInteractiveObject, this.ProjectileWeaponHoldingSystem.GetWeaponHolder()),
                this.OnObstacleTriggerEnter));
        }
Example #9
0
        public PlayerInteractiveObject(IInteractiveGameObject interactiveGameObject, PlayerInteractiveObjectDefinition PlayerInteractiveObjectDefinition)
        {
            this.PlayerInteractiveObjectDefinition = PlayerInteractiveObjectDefinition;
            base.BaseInit(interactiveGameObject, false);
            interactiveGameObject.GenerateVisibilityProbes(PlayerInteractiveObjectDefinition.VisibilityProbeDefinition, interactiveGameObject.GetLogicColliderAsBox());
            Debug.Log(interactiveGameObject.VisibilityProbe.LocalPoints.Length);
            this.InteractiveObjectActionPlayerSystem = new InteractiveObjectActionPlayerSystem(this);
            this.WeaponHandlingSystem = new WeaponHandlingSystem(
                this,
                new WeaponHandlingSystemInitializationData(this, PlayerInteractiveObjectDefinition.WeaponHandlingSystemDefinition.WeaponHandlingFirePointOriginLocalDefinition, PlayerInteractiveObjectDefinition.WeaponHandlingSystemDefinition.WeaponDefinition));
            this.FiringTargetPositionSystem = new FiringTargetPositionSystem(PlayerInteractiveObjectDefinition.FiringTargetPositionSystemDefinition);
            this.HealthSystem = new HealthSystem(this, PlayerInteractiveObjectDefinition.HealthSystemDefinition, OnHealthValueChangedAction: this.OnHealthValueChanged);
            this.StunningDamageDealerReceiverSystem = new StunningDamageDealerReceiverSystem(PlayerInteractiveObjectDefinition.StunningDamageDealerReceiverSystemDefinition, this.HealthSystem);
            this.lowHealthPlayerSystem    = new LowHealthPlayerSystem(this.HealthSystem, PlayerInteractiveObjectDefinition.LowHealthPlayerSystemDefinition);
            this.PlayerVisualEffectSystem = new PlayerVisualEffectSystem(this, PlayerInteractiveObjectDefinition.PlayerVisualEffectSystemDefinition);

            this.SkillSystem = new SkillSystem(this, this.InteractiveObjectActionPlayerSystem);
            this.SkillSystem.SetPlayerActionToMainWeaponSkill(this.WeaponHandlingSystem.GetCurrentWeaponProjectileFireActionDefinition());
            this.SkillSystem.SetPlayerActionToSubSkill(PlayerInteractiveObjectDefinition.DeflectingProjectileInteractiveObjectActionInherentData, 0);
            this.SkillSystem.SetPlayerActionToSubSkill(PlayerInteractiveObjectDefinition.PlayerDashTeleportationActionDefinition, 1);

            this.PlayerObjectInteractiveObjectActionStateManager =
                new PlayerObjectInteractiveObjectActionStateManager(this.GameInputManager, this.InteractiveObjectActionPlayerSystem,
                                                                    this.SkillSystem,
                                                                    PlayerInteractiveObjectDefinition.firingInteractiveObjectActionInherentData, PlayerInteractiveObjectDefinition.projectileDeflectionTrackingInteractiveObjectActionInherentData,
                                                                    PlayerInteractiveObjectDefinition.PlayerDashActionStateBehaviorInputDataSystemDefinition,
                                                                    new PlayerObjectInteractiveObjectActionStateManagerCallbacks(
                                                                        onPlayerDashDirectionActionStarted: this.OnPlayerDashDirectionActionStarted,
                                                                        onPlayerDashDirectionActionEnded: this.OnPlayerDashDirectionActionEnded
                                                                        ));

            /// To display the associated HealthSystem value to UI.
            HealthUIManager.Get().InitEvents(this.HealthSystem);

            this.FiringPartialDefinitionInitialize();

            this.lowHealthPlayerSystem.RegisterPlayerLowHealthStartedEvent(this.OnLowHealthStarted);
            this.lowHealthPlayerSystem.RegisterPlayerLowHealthEndedEvent(this.OnLowHealthEnded);

            PlayerInteractiveObjectCreatedEvent.Get().OnPlayerInteractiveObjectCreated(this);
        }
Example #10
0
        public FiringRangeFeedbackRangeObject(IInteractiveGameObject IInteractiveGameObject,
                                              GameObject FiredProjectileFeedbackPrefab, CoreInteractiveObject WeaponHolder)
        {
            var firedProjectileModel = MonoBehaviour.Instantiate(FiredProjectileFeedbackPrefab, IInteractiveGameObject.InteractiveGameObjectParent.transform);

            firedProjectileModel.transform.ResetLocalPositionAndRotation();
            BaseInit(IInteractiveGameObject, IsUpdatedInMainManager: false);

            this.PlayerFiringRangeTriggerV2 = new BoxRayRangeObject(IInteractiveGameObject.InteractiveGameObjectParent,
                                                                    new BoxRangeObjectInitialization()
            {
                RangeTypeID = RangeTypeID.NOT_DISPLAYED,
                IsTakingIntoAccountObstacles = false,
                BoxRangeTypeDefinition       = new BoxRangeTypeDefinition()
                {
                    Center = new Vector3(0, 0, 0),
                    Size   = new Vector3(BoxWidth, BoxWidth, BoxWidth)
                }
            },
                                                                    this,
                                                                    BoxWidth,
                                                                    delegate(InteractiveObjectPhysicsTriggerInfo interactiveObjectPhysicsTriggerInfo) { return(FiredProjectile.FiredProjectileHasTriggerEnter_DealsDamage_And_MustBeDestroyed(interactiveObjectPhysicsTriggerInfo.OtherInteractiveObject, WeaponHolder)); }
                                                                    );
        }
Example #11
0
 public LevelCompletionInteractiveObject(LevelCompletionInteractiveObjectInitializerData LevelCompletionInitializerData,
                                         IInteractiveGameObject interactiveGameObject, bool IsUpdatedInMainManager = true)
 {
     this.LevelCompletionInitializerData = LevelCompletionInitializerData;
     base.BaseInit(interactiveGameObject, IsUpdatedInMainManager);
 }
Example #12
0
 public ObstacleInteractiveObject(IInteractiveGameObject interactiveGameObject, ObstacleInteractiveObjectDefinition ObstacleInteractiveObjectDefinition)
 {
     this._obstacleInteractiveObjectDefinition = ObstacleInteractiveObjectDefinition;
     base.BaseInit(interactiveGameObject, false);
 }
Example #13
0
 public TestAttractiveObject(IInteractiveGameObject interactiveGameObject, TestAttractiveObjectInitializerData InteractiveObjectInitializerData)
 {
     this.TestAttractiveObjectInitializerData = InteractiveObjectInitializerData;
     interactiveGameObject.CreateLogicCollider(this.TestAttractiveObjectInitializerData.InteractiveObjectLogicCollider);
     base.BaseInit(interactiveGameObject, true);
 }
Example #14
0
 public LevelChunkInteractiveObject(IInteractiveGameObject interactiveGameObject, LevelChunkInteractiveObjectDefinition LevelChunkInteractiveObjectDefinition)
 {
     this.LevelChunkInteractiveObjectDefinition = LevelChunkInteractiveObjectDefinition;
     base.BaseInit(interactiveGameObject, false);
 }
Example #15
0
 public CopyInteractiveObjectTransformConstraint(IInteractiveGameObject followingIInteractiveGameObject, Transform sourceTrasform)
 {
     FollowingIInteractiveGameObject = followingIInteractiveGameObject;
     SourceTrasform = sourceTrasform;
 }
Example #16
0
 public ObstacleInteractiveObject(IInteractiveGameObject interactiveGameObject, ObstacleInteractiveObjectInitializerData ObstacleInteractiveObjectInitializerData)
 {
     this.ObstacleInteractiveObjectInitializerData = ObstacleInteractiveObjectInitializerData;
     base.BaseInit(interactiveGameObject, false);
 }
Example #17
0
 public LineVisualFeedbackSystem(IInteractiveGameObject InteractiveGameObject)
 {
     InteractiveGameObjectRef = InteractiveGameObject;
     //position calculation
     positionOffsetFromNPC = Vector3.up * InteractiveGameObject.AverageModelBounds.Bounds.max.y;
 }