|
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
-
- public class UIMainModel : UIBase
- {
- [SerializeField]
- Button StartButton;
- [SerializeField]
- Button StopButton;
-
- bool _isPlaySound;
-
- string bgmPath;
-
- bool IsPlaySound
- {
- get { return _isPlaySound; }
- set
- {
- _isPlaySound = value;
- if (_isPlaySound)
- {
- AudioManager.Instance.PlayBGM(bgmPath);
- StartButton.gameObject.SetActive(false);
- StopButton.gameObject.SetActive(true);
- }
- else
- {
- AudioManager.Instance.StopBGM();
- StartButton.gameObject.SetActive(true);
- StopButton.gameObject.SetActive(false);
- }
- }
- }
-
- public override void OnOpen(params object[] args)
- {
- int model = (int)args[0];
- switch (model)
- {
- case 0:
- bgmPath = "B-2·ÖÖÓ - ºØ, ÍõºØ";
- break;
- case 1:
- bgmPath = "Sinus 2500Hz _ 10dB - Test Tones";
- break;
- case 2:
- bgmPath = "Sinus 6000Hz _ 10dB - Test Tones";
- break;
- case 3:
- bgmPath = "Sinus 8000Hz _ 10dB - Test Tones";
- break;
- default:
- bgmPath = "B-2·ÖÖÓ - ºØ, ÍõºØ";
- break;
- }
- IsPlaySound = false;
- }
- public override void OnClose()
- {
- IsPlaySound = false;
- }
-
- public void ClickCloseButton()
- {
- Close();
- }
-
- public void ClickStartButton()
- {
- IsPlaySound = true;
- }
-
- public void ClickStopButton()
- {
- IsPlaySound = false;
- }
- }
|