void Start() { theBGMController = this; sourceBGM = this.GetComponent <AudioSource>(); sourceBGM.loop = true; ChangeBGM("costumNormal"); DontDestroyOnLoad(this.gameObject); }
private void Awake() { Cursor.visible = false; //마우스 커서가 보이지 않게 함 Cursor.lockState = CursorLockMode.Locked; //마우스 커서를 고정시킴 playerHealth = GameObject.FindGameObjectWithTag("Player").GetComponent <CompleteProject.PlayerHealth>(); bgm = GameObject.FindGameObjectWithTag("BGMController").GetComponent <BGMController>(); curScene = SceneManager.GetActiveScene().buildIndex; DontDestroyOnLoad(gameObject); }
private void Awake() { controlSpeed = 100; // 10 dashTester_player = transform.parent.GetComponent <DashTester>(); dashTester_enemy = GameObject.Find("Enemy").GetComponent <DashTester>(); GC = GameObject.Find("GameManager").GetComponent <GameController>(); BGMC = GameObject.Find("SoundManager").GetComponent <BGMController>(); }
private void Awake() { instance = this; BGMTracks.Add(DayMusic); BGMTracks.Add(NightMusic); BGMTracks.Add(CaveMusic); ChangeMusic(2); }
void gameStart() { if (UIHelper.shouldMaximize()) { UIHelper.MaximizeWindow(); } backGroundPic.show(); bgm = gameObject.AddComponent <BGMController>(); shiftToServant(menu); }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
private void Start() { currnetTartget = 0; if (m_target != null) { m_navAgent.destination = m_target[currnetTartget].position; } bgmController = GameObject.Find("BGM").GetComponent <BGMController> (); //BGMの速度を変更するやつ }
private void Start() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
private void Awake() { if (instance != null) { Destroy(gameObject); return; } instance = this; DontDestroyOnLoad(gameObject); }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } instance = this; DontDestroyOnLoad(this.gameObject); }
//public static BGMController Instance { // get { // return instanciaBGM; //} // } private void Awake() { if (instanciaBGM != null && instanciaBGM != this) { Destroy(this.gameObject); } else { instanciaBGM = this; DontDestroyOnLoad(instanciaBGM); } }
private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
public override void InitializePlayer() { if (musicInstance == null) { musicInstance = this; DontDestroyOnLoad(this); } else { Destroy(this.gameObject); } }
private void Awake() { if (_instance != null && _instance != this) { Destroy(gameObject); } else { _instance = this; DontDestroyOnLoad(this); } }
// Start is called before the first frame update void Start() { DontDestroyOnLoad(this.gameObject); Trashes = GameObject.FindGameObjectsWithTag("Trash"); oldTrashCount = 0; stage = 0; audioSource = this.gameObject.GetComponent <AudioSource>(); bgmController = FindObjectOfType <BGMController>(); if (SceneManager.GetActiveScene().name == "Title") { ButtonCanvas.gameObject.SetActive(false); } }
IEnumerator corrutina_FinalizarBGM() { float tiempo = volumenMinimo; while (tiempo > 0.0f) { tiempo -= Time.deltaTime * 1.3f; BGM.volume = tiempo; yield return(new WaitForEndOfFrame()); } BGM.volume = 0.0f; instanciaBGM = null; Destroy(this.gameObject); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); source = GetComponent <AudioSource>(); }
private void Awake() { instance = this; UI_BGM = GameObject.FindWithTag("BGMController"); audioSource = GetComponent <AudioSource>(); if (!PlayerPrefs.HasKey("BGMVolume")) { PlayerPrefs.SetFloat("BGMVolume", 1f); } else { audioSource.volume = PlayerPrefs.GetFloat("BGMVolume"); } UI_BGM.GetComponent <Slider>().value = audioSource.volume; }
// Use this for initialization void Start() { _AudioSource.clip = _AudioClip_InGame; _AudioSource.Play(); if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else if (instance != this) { Destroy(gameObject); } }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); AudioSource audio = GetComponent <AudioSource>(); audio.Play(); }
private void Awake() { if (_instance == null) { Application.targetFrameRate = 100; _instance = this; DontDestroyOnLoad(gameObject); _audioSource = this.GetComponent <AudioSource>(); _audioSource.clip = _backMusic[0]; _audioSource.Play(); } else { Destroy(gameObject); return; } }
public static void BGMStopPatch(ref int bgmIndex) { if (acac == null || acac.Count() <= 0) { return; } if (!BGMController.HasBGM(bgmIndex)) { bgmIndex = 0; } try { System.Random rd = new System.Random(); int rdidx = rd.Next() % acac.Count; if (!RandomPlay.Value) { rdidx = bgmplaying % acac.Count; bgmplaying = (bgmplaying + 1) % acac.Count; } RootAS = BGMController.instance.musics[bgmIndex]; RootAS.Stop(); if (newbgmAS == null) { newbgmAS = RootAS.gameObject.AddComponent <AudioSource>(); } else if (ChangeFollowOri.Value) { newbgmAS.Stop(); newbgmAS = RootAS.gameObject.AddComponent <AudioSource>(); } else { return; } newbgmAS.clip = acac[rdidx]; newbgmAS.volume = VFAudio.audioVolume * VFAudio.musicVolume; newbgmAS.Play(); beginsec = DateTime.Now.Ticks / 10000000; bgmlength = newbgmAS.clip.length; } catch (Exception) { } }
void Awake() { //If there are any other existing instances, destroy them if (instance != null && instance != this) { Destroy(this.gameObject); } else { instance = this; } audioSource = GetComponent <AudioSource>(); audioSource.volume = PlayerPrefs.GetFloat("MusicVol"); //Makes sure that the game object doesn't get destroyed when changing scenes DontDestroyOnLoad(this.gameObject); }
void Start() { player = GameObject.FindGameObjectWithTag("Player"); hp = player.GetComponent <CompleteProject.PlayerHealth>(); serumUI = GameObject.FindGameObjectWithTag("SerumUI"); serum_count = serumUI.GetComponent <CompleteProject.SerumUITutorial>(); serums = GameObject.FindGameObjectWithTag("Serum"); Create_Zombie.SetActive(false); soundController = GameObject.FindGameObjectWithTag("SoundController"); audio = soundController.GetComponent <SoundController>(); bgmController = GameObject.FindGameObjectWithTag("BGMController"); bgm = bgmController.GetComponent <BGMController>(); audio.StartAlarm(); bgm.day(); //BGM출력 DayTimeUI.SetActive(true); //안내메시지 출력 Time.timeScale = 0f; Cursor.visible = true; Cursor.lockState = CursorLockMode.None; }
void Start() { player = GameObject.FindGameObjectWithTag("Player"); hp = player.GetComponent <PlayerHealth>(); playerLight = GameObject.FindGameObjectWithTag("PlayerLight"); playerLight.SetActive(false); serumUI = GameObject.FindGameObjectWithTag("SerumUI"); serum_count = serumUI.GetComponent <SerumUI>(); serums = GameObject.FindGameObjectsWithTag("Serum"); Create_Zombie.SetActive(false); soundController = GameObject.FindGameObjectWithTag("SoundController"); audio = soundController.GetComponent <SoundController>(); bgmController = GameObject.FindGameObjectWithTag("BGMController"); bgm = bgmController.GetComponent <BGMController>(); audio.Alarm(); bgm.day(); //BGM출력 DayTimeUI.SetActive(true); //안내메시지 출력 RoundText.text = "Round " + RoundNum; //라운드 표시 StartCoroutine(CallDayTimeUI(2)); //안내메시지 제거 }
public static void BGMGetPatch(ref int bgmIndex) { if (!BGMController.HasBGM(bgmIndex)) { bgmIndex = 0; } //int num = BGMController.instance.musics.Length; try { AudioSource audioSource = BGMController.instance.musics[bgmIndex]; BaseAS = audioSource; while (ALLAS.Count < maxlen) { AudioSource nas = BaseAS.gameObject.AddComponent <AudioSource>(); ALLAS.Add(nas); } } catch (Exception) { } }
private void Start() { code_BGM = GameObject.Find("BGM").GetComponent <BGMController>(); }
// Use this for initialization void Start() { director = GameObject.Find("GameDirector").GetComponent <GameDirector>(); bgm = GameObject.Find("BGM").GetComponent <BGMController>(); highscore = PlayerPrefs.GetFloat("flipthecat.highscore", 0); }
public BGMController() { currentPlaying = BGMType.none; BGMController.Instance = this; LoadAllBGM(); }
protected override void OnStart() { base.OnStart(); _bgmController = _controller as BGMController; }
void gameStart() { backGroundPic.show(); bgm = gameObject.AddComponent <BGMController>(); shiftToServant(menu); }