Exemple #1
0
        // Use this for initialization
        void Start()
        {
            drone = GameObject.FindGameObjectWithTag("Drone");
            mainPlayer = GameObject.FindGameObjectWithTag("Player").GetComponent<ThirdPersonCharacter>();
			audioSource = GetComponent<AudioSource>();
			movementState = MOVEMENT_STATE.MOVING;
			cameraView = CAMERA_VIEW.PLAYER;
			health = maxHealth;

			bloodOverlay = imageOverlayObject.GetComponent<Image>();
			SetHealth(100);
		}
Exemple #2
0
		public void SwitchCameraView(CAMERA_VIEW newCamera)
		{ 
			if (newCamera == CAMERA_VIEW.PLAYER)
			{
				UpdateMovementState(MOVEMENT_STATE.MOVING);
				mainPlayer.GetComponent<ThirdPersonUserControl>().enabled = true;
				drone.GetComponent<DroneMovement>().enabled = false;
			}
			else if (newCamera == CAMERA_VIEW.DRONE)
			{
				UpdateMovementState(MOVEMENT_STATE.STOPPED);
				mainPlayer.GetComponent<ThirdPersonUserControl>().enabled = false;
				drone.GetComponent<DroneMovement>().enabled = true;
			}
			cameraView = newCamera;
		}