예제 #1
0
        public void setUp(Actions             actions,
							  MouseLook           mouseLook,
							  FOVKick             fovKick,
							  CurveControlledBob  headBob,
							  LerpControlledBob   jumpBob,
							  AttackController    attackController)
        {
            this.actions=actions;
                this.mouseLook=mouseLook;
                this.fovKick=fovKick;
                this.headBob=headBob;
                this.jumpBob=jumpBob;
                this.attackController=attackController;

                this.mainCameraObject    = SingletonNames.getMainCamera();
                this.playerObject        = SingletonNames.getPlayer();
                this.audioSource         = playerObject.gameObject.AddComponent<AudioSource>();
                this.audioData           = playerObject.GetComponent<MovementAudioData>();
                this.characterController = playerObject.GetComponent<CharacterController>();

                objectsSelector = mainCameraObject.GetComponent<ObjectsSelector>();

                originalCameraPosition = mainCameraObject.transform.localPosition;

                fovKick.Setup(mainCameraObject);
                headBob.Setup(mainCameraObject, stepInterval);
                mouseLook.Init(playerObject.transform, mainCameraObject.transform);

                stepCycle = 0f;
                nextStep = stepCycle / 2f;
                isJumping = false;
        }
예제 #2
0
        public void setUp(Actions actions,
						  MouseLook           mouseLook,
						  FOVKick             fovKick,
						  CurveControlledBob  headBob,
						  LerpControlledBob   jumpBob,
						  AttackController    attackController)
        {
            this.actions=actions;
                this.mouseLook=mouseLook;
                this.fovKick=fovKick;
                this.headBob=headBob;
                this.jumpBob=jumpBob;

                this.attackController=attackController;

                this.mainCameraObject    = SingletonNames.getMainCamera();
                this.playerObject        = SingletonNames.getPlayer();
                this.audioSource         = playerObject.gameObject.AddComponent<AudioSource>();
                this.audioData           = playerObject.GetComponent<MovementAudioData>();
                this.characterController = playerObject.GetComponent<CharacterController>();

                originalCameraPosition = mainCameraObject.transform.localPosition;

                isJumping = false;
        }