Пример #1
0
 void ReceiverMsg(params object[] paramList)
 {
     foreach (var sth in paramList)
     {
         QPrint.Warn(sth.ToString());
     }
 }
Пример #2
0
        public void PreloadMusic(string path, int id)
        {
            QTest.TimeBegan(path);

            ResMgr.Instance().LoadRes(path, delegate(string resName, Object resObj) {
                if (resObj)
                {
                    if (APP_CONFIG.DEBUG)
                    {
                        QPrint.Warn("loaded: " + path + " " + id.ToString() + "time:" + QTest.TimeStop(path));
                    }
                    musicClips[id] = resObj as AudioClip;
                }
            });
        }
Пример #3
0
        public void Off()
        {
            if (APP_CONFIG.DEBUG)
            {
                QPrint.Warn("Sound Off");
            }
            listener.enabled = false;
            DataManager.Instance().soundState = SOUND.OFF;
            soundState = SOUND.OFF;

            var audios = GetComponents <AudioSource> ();

            for (int i = 0; i < audios.Length; i++)
            {
                audios [i].volume = 0.0f;
            }
        }
Пример #4
0
        public void On()
        {
            if (APP_CONFIG.DEBUG)
            {
                QPrint.Warn("Sound On");
            }
            listener.enabled = true;
            DataManager.Instance().soundState = SOUND.ON;
            soundState         = SOUND.ON;
            musicPlayer.volume = 1.0f;

            var audios = GetComponents <AudioSource> ();

            for (int i = 0; i < audios.Length; i++)
            {
                audios [i].volume = 1.0f;
            }
        }
Пример #5
0
 public void PlayMusic(int id, bool loop = true)
 {
     if (APP_CONFIG.DEBUG)
     {
         QPrint.Warn(id + "" + loop);
     }
     musicPlayer.loop = loop;
     musicPlayer.clip = musicClips [id];
     if (soundState == SOUND.ON)
     {
         musicPlayer.volume = 1.0f;
     }
     else
     {
         musicPlayer.volume = 0.0f;
     }
     musicPlayer.Play();
 }
Пример #6
0
        /// <summary>
        /// 读一张表
        /// </summary>
        public IEnumerator LoadTable(string name)
        {
            System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
            watch.Start();
            TextAsset textAsset = Resources.Load(PATH + name, typeof(TextAsset)) as TextAsset;

            if (APP_CONFIG.DEBUG)
            {
                QPrint.Warn(textAsset.name);
            }
            mCachedTables.Add(textAsset.name, new CSVTable(textAsset.text));
            watch.Stop();

            if (APP_CONFIG.DEBUG)
            {
                QPrint.Warn("time:" + watch.ElapsedMilliseconds);
            }
            yield return(0);
        }