void Awake() { // ai = AIManeger.GetComponent<AI> (); stone = Resources.Load("Stone") as GameObject; ai = CursorManager.GetComponent <AI> (); timer = 0; oto = GetComponent <AudioSource> (); bgmM = BGMManager.GetComponent <BGMmanager> (); }
// Start is called before the first frame update void Awake() { if (bgm_instance == null) { bgm_instance = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); }
private void Awake() { if (instance == null) { instance = this; //DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } for (int i = 0; i < bgmSources.Length; i++) { bgmSources[i] = gameObject.AddComponent <AudioSource>(); } bgmSources[1].volume = 0; for (int i = 0; i < seSources.Length; i++) { seSources[i] = gameObject.AddComponent <AudioSource>(); } }