| | |
| | | |
| | | static readonly List<int> commonUseAudioSet = new List<int>() { defaultClickPositiveAudio, defaultClickNegativeAudio, 3, 4 }; |
| | | |
| | | public static SoundPlayer Instance { |
| | | get; set; |
| | | static SoundPlayer m_Instance = null; |
| | | public static SoundPlayer Instance |
| | | { |
| | | get |
| | | { |
| | | if (m_Instance == null) |
| | | { |
| | | CreateSoundPlayer(); |
| | | } |
| | | return m_Instance; |
| | | } |
| | | |
| | | } |
| | | |
| | | [SerializeField] AudioSource m_MusicAudioSource; |
| | |
| | | public static void CreateSoundPlayer() |
| | | { |
| | | var gameObject = GameObject.Instantiate(BuiltInLoader.LoadPrefab("SoundPlayer")); |
| | | Instance = gameObject.GetComponent<SoundPlayer>(); |
| | | Instance.name = "SoundPlayer"; |
| | | Instance.SetActive(true); |
| | | m_Instance = gameObject.GetComponent<SoundPlayer>(); |
| | | m_Instance.name = "SoundPlayer"; |
| | | m_Instance.SetActive(true); |
| | | DontDestroyOnLoad(gameObject); |
| | | } |
| | | |
| | |
| | | //} |
| | | |
| | | //private void LateUpdate() |
| | | //{
|
| | | // if (CameraController.Instance != null && CameraController.Instance.CameraObject != null)
|
| | | // {
|
| | | // this.transform.position = CameraController.Instance.transform.position + new Vector3(0, 5, 0);
|
| | | // this.transform.rotation = CameraController.Instance.CameraObject.transform.rotation;
|
| | | //{ |
| | | // if (CameraController.Instance != null && CameraController.Instance.CameraObject != null) |
| | | // { |
| | | // this.transform.position = CameraController.Instance.transform.position + new Vector3(0, 5, 0); |
| | | // this.transform.rotation = CameraController.Instance.CameraObject.transform.rotation; |
| | | // } |
| | | //} |
| | | |