コード例 #1
0
ファイル: SoundManager.cs プロジェクト: cjh880118/TabletHolo
        public IEnumerator Setup()
        {
            _loadComplete = false;
            _table        = TableManager.Instance.GetTableClass <BT_Sound>();

            for (int i = 0; i < _table.sheets[0].list.Count; i++)
            {
                yield return(StartCoroutine(Load(_table.sheets[0].list[i].Index)));
            }

            _loadComplete = true;
        }
コード例 #2
0
 protected override void OnLoadStart()
 {
     mobileOptionModel    = Model.First <MobileOptionModel>();
     noteModel            = Model.First <NoteModel>();
     playerInventoryModel = Model.First <PlayerInventoryModel>();
     holostarSettingModel = Model.First <HolostarSettingModel>();
     optionModel          = Model.First <MobileOptionModel>();
     bT_Sound             = TableManager.Instance.GetTableClass <BT_Sound>();
     foreach (var o in bT_Sound.sheets[0].list)
     {
         if (o.isGame)
         {
             ListRhythmGameMusic.Add(o);
         }
     }
     StartCoroutine(LoadInitialData());
 }
コード例 #3
0
ファイル: SoundManager.cs プロジェクト: cjh880118/TabletHolo
        public IEnumerator Load(int id, bool instant = true, bool bgm = false)
        {
            if (id == 0)
            {
                yield break;
            }

            if (_caches.ContainsKey(id))
            {
                yield break;
            }

            if (_table == null)
            {
                _table = TableManager.Instance.GetTableClass <BT_Sound>();
                if (_table == null)
                {
                    //yield return StartCoroutine(TableManager.Instance.Load());
                    _table = TableManager.Instance.GetTableClass <BT_Sound>();

                    if (_table == null)
                    {
                        yield break;
                    }
                }
            }

            //var data = _table.Rows.Find(x => x.SoundID == id);
            var data = _table.sheets[0].list.Find(x => x.Index == id);

            if (data == null)
            {
                Debug.LogErrorFormat("Could not found 'BT_SoundRow' : {0} of {1}", id, gameObject.name);
                yield break;
            }

            string path = Model.First <SettingModel>().GetLocalizingPath();

            string fullpath = string.Format("Sound/{0}/{1}", path, data.FileName);

            yield return(StartCoroutine(ResourceLoader.Instance.Load <AudioClip>(fullpath,
                                                                                 o => OnPostLoadProcess(o, fullpath, id, data, instant, bgm))));
        }