Ejemplo n.º 1
0
 public void Initialize()
 {
     // setup elements
     m_StarElementRoot = GameObject.Find("StarElementRoot");
     if (m_StarElementRoot == null)
     {
         Debug.LogError("m_StarElementRoot not found");
         return;
     }
     m_poolStarElement = new ObjectPool <StarElementStruct>(10, ResetStarElement, InitStarElement);
     // setting config
     m_GameSettingConfig = ConfigManager.Instance.GetMusicGameSettingTable().MusicConfigMap[MUSICID];
     if (m_GameSettingConfig == null)
     {
         Debug.LogError("Music Game : Setting Config not exsist");
         return;
     }
     // game data
     m_MusicPlayer = new MusicPlayer(m_GameSettingConfig, GenerateStar, MusicEndLogic);
     // init scene
     if (CheckFirstPlay())
     {
         StartGuide();
     }
     else
     {
         ReLoadGame();
         ReLoadScene();
     }
 }
Ejemplo n.º 2
0
 public MusicPlayer(MusicGameNoteKeyConfig noteKeyConfig, Action <int> playKeynoteCallBack, Action musicEndCallBack)
 {
     if (noteKeyConfig.NoteKeyList == null || noteKeyConfig.NoteKeyList.Count == 0)
     {
         Debuger.LogError("Music Keynote can not be loaded");
         return;
     }
     m_lstNoteKeyList      = noteKeyConfig.NoteKeyList;
     m_PlayKeynoteCallback = playKeynoteCallBack;
     m_MusicEndCallBack    = musicEndCallBack;
 }