| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using UnityEngine; |
| | 4 | |
|
| | 5 | | namespace DCL.Camera |
| | 6 | | { |
| | 7 | | public class CameraControllerAudioHandler : MonoBehaviour |
| | 8 | | { |
| | 9 | | [SerializeField] |
| | 10 | | CameraController cameraController; |
| | 11 | |
|
| | 12 | | [SerializeField] |
| | 13 | | AudioEvent eventCameraFadeIn, eventCameraFadeOut; |
| | 14 | |
|
| 1194 | 15 | | private void Awake() { cameraController.onSetCameraMode += OnSetCameraMode; } |
| | 16 | |
|
| | 17 | | void OnSetCameraMode(CameraMode.ModeId mode) |
| | 18 | | { |
| | 19 | | switch (mode) |
| | 20 | | { |
| | 21 | | case CameraMode.ModeId.FirstPerson: |
| 1 | 22 | | eventCameraFadeIn.Play(true); |
| 1 | 23 | | break; |
| | 24 | | case CameraMode.ModeId.ThirdPerson: |
| 1 | 25 | | eventCameraFadeOut.Play(true); |
| | 26 | | break; |
| | 27 | | default: |
| | 28 | | break; |
| | 29 | | } |
| 1 | 30 | | } |
| | 31 | | } |
| | 32 | | } |