Пример #1
0
        /// <summary>
        /// Called from <see cref="PlayerInteractiveObjectCreatedEvent"/>.
        /// </summary
        protected virtual void OnPlayerInteractiveObjectCreated(IPlayerInteractiveObject IPlayerInteractiveObject)
        {
            //set initial position
            this.CameraPivotPointTransform[0].position = IPlayerInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent.transform.position;

            this._cameraFollowSystem = new CameraFollowSystem(IPlayerInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent.transform,
                                                              CameraConfigurationGameObject.Get().CameraMovementConfiguration.CameraFollowManagerComponent);

            var CameraMovementJobStateStruct = this.CameraMovementJob.GetCameraMovementJobState();

            CameraMovementJobStateStruct.CameraObject.Initialize(CameraPivotPointTransform[0], MainCamera);
            this._cameraFollowSystem.InitState(ref CameraMovementJobStateStruct);
            this.CameraMovementJob.SetCameraMovementJobState(CameraMovementJobStateStruct);
        }
Пример #2
0
        public CameraMovementJobManager()
        {
            this.MainCamera = Camera.main;
            this.CameraPivotPointTransform = new TransformAccessArray(new Transform[] { GameObject.FindGameObjectWithTag(TagConstants.CAMERA_PIVOT_POINT_TAG).transform });

            this.CameraMovementJob = new CameraMovementJob(new NativeArray <CameraMovementJobState>(1, Allocator.Persistent));

            this._cameraOrientationSystem     = new CameraOrientationSystem(GameInputManager.Get());
            this.CameraPanningSystem          = new CameraPanningSystem(CameraConfigurationGameObject.Get().CameraMovementConfiguration);
            this.CameraVerticalRotationSystem = new CameraVerticalRotationSystem(CameraConfigurationGameObject.Get().CameraMovementConfiguration);
            this._cameraZoomSystem            = new CameraZoomSystem(this.MainCamera, GameInputManager.Get());

            /// InitState state
            var CameraMovementJobStateStruct = this.CameraMovementJob.GetCameraMovementJobState();

            CameraMovementJobStateStruct.CameraObject.Initialize(this.CameraPivotPointTransform[0], this.MainCamera);
            this._cameraZoomSystem.InitState(ref CameraMovementJobStateStruct);
            this.CameraVerticalRotationSystem.InitState(ref CameraMovementJobStateStruct);

            this.CameraMovementJob.SetCameraMovementJobState(CameraMovementJobStateStruct);
        }
Пример #3
0
        public void Init()
        {
            var playerPosition   = GameObject.FindGameObjectWithTag(TagConstants.PLAYER_TAG).transform;
            var cameraPivotPoint = GameObject.FindGameObjectWithTag(TagConstants.CAMERA_PIVOT_POINT_TAG).transform;

            this.CameraFollowManager      = new CameraFollowManager(playerPosition, cameraPivotPoint, CameraConfigurationGameObject.Get().CameraMovementConfiguration.CameraFollowManagerComponent);
            this.CameraOrientationManager = new CameraOrientationManager(cameraPivotPoint, GameInputManager.Get(), InputConfigurationGameObject.Get().CoreInputConfiguration);
            this.CameraZoomManager        = new CameraZoomManager(Camera.main, GameInputManager.Get());
        }