// Update is called once per frame void Update() { if (loadFlag) { absoluteTime += Time.deltaTime; if (absoluteTime >= 0.5f) { loadFlag = false; // 리소스 로드 //Global.loadResource(); // XML, JAM 로드 XML_LoadJudgeData(); XML_LoadSelectedMusic(); // 오디오, 배경 비디오 파일 로드 RSC.LoadAudio(Global.songPath + "/" + Global.mp3Path + "/" + Global.musicInfo[Global.currentSelectMusic].mp3Name); RSC.LoadVideoCache(Global.musicInfo[Global.currentSelectMusic].bgaName); // 인게임 설정 로드 loadIngameSetting(); // 씬 전환 SceneManager.LoadScene("InGame"); } } }
// Use this for initialization void Start() { GameObject tmpObj = new GameObject(); DontDestroyOnLoad(tmpObj); Global.outGameBGM = tmpObj.AddComponent <AudioSource>(); RSC.LoadAudio("Sound/bgm1"); Global.outGameBGM.playOnAwake = false; Global.outGameBGM.loop = true; Global.outGameBGM.clip = RSC.GetAudio("bgm1"); Global.outGameBGM.Play(); // TST 스프라이트 받아오기 spr_TST = obj_TouchToStart.GetComponent <UI2DSprite>(); }
void load() { // 리소스 로드 //Global.loadResource(); // XML, JAM 로드 XML_LoadJudgeData(); XML_LoadSelectedMusic(); // 오디오, 배경 비디오 파일 로드 RSC.LoadAudio(Global.songPath + "/" + Global.mp3Path + "/" + Global.musicInfo[Global.currentSelectMusic].mp3Name); RSC.LoadVideoCache(Global.musicInfo[Global.currentSelectMusic].bgaName); // 인게임 설정 로드 loadIngameSetting(); // 씬 전환 SceneManager.LoadScene("InGame"); }
public void selectMusic() { Collider2D col = Physics2D.OverlapPoint( new Vector2(selectObject.transform.localPosition.x * selectObject.transform.root.localScale.x, selectObject.transform.localPosition.y * selectObject.transform.root.localScale.y)); if (col != null) { Global.currentSelectMusic = Int32.Parse(col.name); if (Global.musicInfo.ContainsKey(Global.currentSelectMusic)) { Debug.Log(Global.musicInfo[Global.currentSelectMusic].titleName + " Selected."); // 미리듣기, 타이틀 파일 로드 RSC.LoadSprite(Global.songPath + "/" + Global.pngPath + "/" + Global.musicInfo[Global.currentSelectMusic].pngName); RSC.LoadAudio(Global.songPath + "/" + Global.prevPath + "/" + Global.musicInfo[Global.currentSelectMusic].prevName); // 배경 영상 정지 RSC.GetVideo(Global.modeVideoName[(int)Global.currentSelectMode]).GetComponent <MediaPlayerCtrl>().Stop(); SceneManager.LoadScene("Ready"); } } }