Beispiel #1
0
        public void BeforeTest()
        {
            _previousCursorLockMode = Cursor.lockState;

            _gameModeComponent = new GameObject().AddComponent <TestGameModeComponent>();
            _gameModeComponent.gameObject.AddComponent <TestUnityMessageEventDispatcherComponent>().TestAwake();

            _controllerComponent = _gameModeComponent.gameObject.AddComponent <TestControllerComponent>();

            _gameModeComponent.PlayerControllerType = _controllerComponent.gameObject;
            _gameModeComponent.PlayerCharacterType  = new GameObject {
                name = "TestName"
            };
            _gameModeComponent.HUDType = new GameObject();

            var serviceProvider = new GameObject().AddComponent <TestGameServiceProvider>();

            serviceProvider.TestAwake();
            _spawnService = new MockSpawnService();
            serviceProvider.AddService <ISpawnServiceInterface>(_spawnService);

            _spawnService.GetNearestSpawnLocationResult = _gameModeComponent.gameObject.transform;

            _spawnLocation = new GameObject().AddComponent <TestSpawnLocationComponent>();
            _gameModeComponent.StartingSpawnLocation = _spawnLocation;
        }
Beispiel #2
0
        public void AfterTest()
        {
            _cameraComponent = null;
            _camera          = null;
            _controller      = null;

            _pawn = null;
        }
        public void AfterTest()
        {
            _actionState = null;

            _originalCamera = null;
            _controller     = null;

            _character          = null;
            _health             = null;
            _inputBinder        = null;
            _actionStateMachine = null;

            _inCamera = null;
        }
Beispiel #4
0
        public void BeforeTest()
        {
            _pawn = new GameObject();
            _pawn.transform.position = new Vector3(100.0f, 300.0f, 700.0f);

            _controller = new GameObject().AddComponent <TestControllerComponent>();
            _controller.SetPawn(_pawn);

            _camera = _controller.gameObject.AddComponent <UnityEngine.Camera>();

            _cameraComponent = _controller.gameObject.AddComponent <TestPlayerCameraComponent>();

            _cameraComponent.ZoomSpeed = 2.0f;

            _cameraComponent.TestStart();
        }
        public void BeforeTest()
        {
            _inCamera = new GameObject().AddComponent <Camera>();

            _actionStateMachine = new GameObject().AddComponent <MockActionStateMachineComponent>();
            _inputBinder        = _actionStateMachine.gameObject.AddComponent <MockInputBinderComponent>();
            _health             = _actionStateMachine.gameObject.AddComponent <MockHealthComponent>();
            _character          = _inputBinder.gameObject.AddComponent <TestCharacterComponent>();
            _character.gameObject.AddComponent <TestUnityMessageEventDispatcherComponent>().TestAwake();

            _controller                 = new GameObject().AddComponent <TestControllerComponent>();
            _originalCamera             = _controller.gameObject.AddComponent <Camera>();
            _character.ActiveController = _controller;

            _cameraTime = 2.0f;

            _actionState = new CinematicCameraActionState(new CinematicCameraActionStateInfo(_character.gameObject, _inCamera, _cameraTime));
        }