public void CameraControllerComponentTest()
        {
            //Given
            Input fixedInput = new FixedInputMock(
                new Vector2(0.14f, 0.05f),
                new List <MouseButton>(new MouseButton[] { MouseButton.RightMouseButton }));
            GameTimer constantTimer = new ConstantTimer(new TimeSpan(0, 0, 0, 0, 100));

            Transform transform = new Transform();
            CameraControllerComponent camComp = new CameraControllerComponent(transform, fixedInput);

            //When
            for (int update = 0; update < 5; update++)
            {
                camComp.Update(constantTimer);
            }

            //Then
            Quaternion comparisonRotation = new Quaternion(-0.084f, 0.90f, -0.37f, -0.20f);

            comparisonRotation.Normalize();
            float dot = Quaternion.Dot(transform.Rotation, comparisonRotation);

            Assert.IsTrue(MathUtil.WithinEpsilon(dot, 1.0f, 0.0001f));
        }
Пример #2
0
    private void Awake()
    {
        _cameraController = FindObjectOfType <CameraControllerComponent>();
        _screenMiddle     = new Vector2(.5f, .5f);
        _keys             = new List <int>();

        _notificationUI.SetActive(false);
    }
Пример #3
0
    protected override void Awake()
    {
        base.Awake();

        _cameraController = FindObjectOfType <CameraControllerComponent>();
        _vfxController    = FindObjectOfType <VFXControllerComponent>();
        _sfxController    = FindObjectOfType <SFXControllerComponent>();

        enabled = false;
    }
Пример #4
0
    protected override void Awake()
    {
        //Initiliaze projectil pool
        PoolSystem.InitiliazePool(_projectilPrefab, null, 1);

        //Get controller components from scene
        _vfxController          = FindObjectOfType <VFXControllerComponent>();
        _cameraController       = FindObjectOfType <CameraControllerComponent>();
        _weaponHolderController = FindObjectOfType <WeaponHolderComponent>();

        //Get the player transform from the root of this object
        _playerForward = transform.root;

        //Stop update method
        enabled = false;

        base.Awake();
    }