示例#1
0
 /// <summary>
 /// ²¥·Å±³¾°ÒôÀÖ
 /// </summary>
 /// <param name="canPlay"></param>
 public void PlayBacksound(string abName, string assetName, bool canPlay)
 {
     if (audio.clip != null)
     {
         if (assetName.IndexOf(audio.clip.name) > -1)
         {
             if (!canPlay)
             {
                 audio.Stop();
                 audio.clip = null;
                 Util.ClearMemory();
             }
             return;
         }
     }
     if (canPlay)
     {
         audio.loop = true;
         audio.clip = LoadAudioClip(abName, assetName);
         audio.Play();
     }
     else
     {
         audio.Stop();
         audio.clip = null;
         Util.ClearMemory();
     }
 }
示例#2
0
 public void Stop()
 {
     audio.Stop();
     audio.loop = false;
     audio.clip = null;
     Util.ClearMemory();
 }
示例#3
0
 //Í£Ö¹±³¾°ÒôÀÖ
 public void StopBackSound()
 {
     backSoundKey = "";
     audio.volume = 0;
     audio.Stop();
     Util.ClearMemory();
 }
示例#4
0
 public void PlayBacksound(AudioClip c, bool canPlay)
 {
     if (audio.clip != null)
     {
         if (name.IndexOf(audio.clip.name) > -1)
         {
             if (!canPlay)
             {
                 audio.Stop();
                 audio.clip = null;
                 Util.ClearMemory();
             }
             return;
         }
     }
     if (canPlay)
     {
         audio.loop = true;
         audio.clip = c;
         audio.Play();
     }
     else
     {
         audio.Stop();
         audio.clip = null;
         Util.ClearMemory();
     }
 }
示例#5
0
        //-----------------------------------------------------------------
        protected void OnDestroy()
        {
#if ASYNC_MODE
            string abName = name.ToLower().Replace("panel", "");
            ResManager.UnloadAssetBundle(abName + AppConst.ExtName);
#endif
            if (!CheckValid())
            {
                return;
            }
            ClearClick();
            LuaFunction destroyFunc = mLuaTable.GetLuaFunction("OnDestroy") as LuaFunction;
            if (destroyFunc != null)
            {
                destroyFunc.BeginPCall();
                destroyFunc.PCall();
                destroyFunc.EndPCall();

                destroyFunc.Dispose();
                destroyFunc = null;
            }

            SafeRelease(ref mFixedUpdateFunc);
            SafeRelease(ref mUpdateFunc);
            SafeRelease(ref mLateUpdateFunc);
            SafeRelease(ref mOnEnableFunc);
            SafeRelease(ref mOnDisableFunc);
            SafeRelease(ref mLuaTable);

            Util.ClearMemory();
            Debug.Log("~" + name + " was destroy!");
        }
示例#6
0
 /// <summary>
 /// ²¥·Å±³¾°ÒôÀÖ
 /// </summary>
 /// <param name="canPlay"></param>
 public void PlayBacksound(string name, bool canPlay)
 {
     if (m_audio.clip != null)
     {
         if (name.IndexOf(m_audio.clip.name) > -1)
         {
             if (!canPlay)
             {
                 m_audio.Stop();
                 m_audio.clip = null;
                 Util.ClearMemory();
             }
             return;
         }
     }
     if (canPlay)
     {
         m_audio.loop = true;
         m_audio.clip = LoadAudioClip(name);
         m_audio.Play();
     }
     else
     {
         m_audio.Stop();
         m_audio.clip = null;
         Util.ClearMemory();
     }
 }
示例#7
0
 public void PlayBacksound(string name, bool canPlay)
 {
     if (this.audioSource.get_clip() != null && name.IndexOf(this.audioSource.get_clip().get_name()) > -1)
     {
         if (!canPlay)
         {
             this.audioSource.Stop();
             this.audioSource.set_clip(null);
             Util.ClearMemory();
         }
         return;
     }
     if (canPlay)
     {
         this.audioSource.set_loop(true);
         this.audioSource.set_clip(this.LoadAudioClip(name));
         this.audioSource.Play();
     }
     else
     {
         this.audioSource.Stop();
         this.audioSource.set_clip(null);
         Util.ClearMemory();
     }
 }
示例#8
0
        protected void OnDestroy()
        {
            this.ClearClick();
            string text = base.get_name().ToLower().Replace("panel", string.Empty);

            Util.ClearMemory();
            Debug.Log("~" + base.get_name() + " was destroy!");
        }
示例#9
0
        //-----------------------------------------------------------------
        protected void OnDestroy()
        {
            ClearClick();
#if ASYNC_MODE
            ResManager.UnloadAssetBundle(sBundleName);
#endif
            Util.ClearMemory();
            Debug.Log("~" + sBundleName + " unload!");
        }
示例#10
0
        //-----------------------------------------------------------------
        protected void OnDestroy()
        {
#if ASYNC_MODE
            string abName = name.ToLower().Replace("panel", "");
            ResManager.UnloadAssetBundle(abName + AppConst.ExtName);
#endif
            Util.ClearMemory();
            Debug.Log("~" + name + " was destroy!");
        }
示例#11
0
 protected void OnDestroy()
 {
     Util.CallMethod(base.name, "OnDestroy", new object[]
     {
         base.gameObject
     });
     this.ClearUIEvent();
     Util.ClearMemory();
     Debug.Log("~" + base.name + " was destroy!");
 }
示例#12
0
        //-----------------------------------------------------------------
        protected void OnDestroy()
        {
            ClearClick();
#if ASYNC_MODE
            //string abName = name.ToLower().Replace("panel", "");
            ResManager.UnloadAssetBundle(bindingAbName);
#endif
            Util.ClearMemory();
            Debug.Log("~" + name + " was destroy!");
        }
示例#13
0
        //-----------------------------------------------------------------
        protected void OnDestroy()
        {
            Util.CallMethod(name.Substring(name.IndexOf('.') + 1), "OnDestroy");
            ClearClick();
#if ASYNC_MODE
            string abName = name.Substring(0, name.IndexOf('.')).ToLower();
            ResManager.UnloadAssetBundle(abName + AppConst.ExtName);
#endif
            Util.ClearMemory();
            Debug.Log("~" + name + " was destroy!");
        }
        //-----------------------------------------------------------------
        protected void OnDestroy()
        {
            Util.CallGlobalLuaFunction("HandleUIMessage", m_lua_id, "OnDestroy");
            ClearClick();
#if ASYNC_MODE
            string abName = name.ToLower().Replace("panel", "");
            ResManager.UnloadAssetBundle(abName + AppConst.ExtName);
#endif
            Util.ClearMemory();
            Debug.Log("~" + name + " was destroy!");
        }
        //-----------------------------------------------------------------
        protected void OnDestroy()
        {
            PeriodCallBackManager.GetInstance().Destroy(gameObject);
            ClearClick();
#if ASYNC_MODE
            string abName = name.ToLower().Replace("panel", "");
            ResManager.UnloadAssetBundle(abName + AppConst.ExtName);
#endif
            Util.ClearMemory();
            Debug.Log("~" + name + " was destroy!");
        }
示例#16
0
 //-----------------------------------------------------------------
 protected void OnDestroy()
 {
     if (bundle)
     {
         bundle.Unload(true);
         bundle = null;  //销毁素材
     }
     ClearClick();
     Util.ClearMemory();
     Debug.Log("~" + name + " was destroy!");
 }
示例#17
0
        //Í£Ö¹²¥·Å
        public void StopSound(string abName, string assetName)
        {
            string name = GetClipNewName(abName, assetName);

            if (dicAudios.ContainsKey(name))
            {
                if (dicAudios[name] != null)
                {
                    dicAudios[name].enabled = false;
                    Util.ClearMemory();
                }
            }
        }
示例#18
0
        //-----------------------------------------------------------------
        protected void OnDestroy()
        {
            ClearClick();
#if ASYNC_MODE
            if (Application.isPlaying)
            {
                string abName = panel.ToLower();
                ResManager.UnloadAssetBundle(abName);
            }
#endif
            Util.ClearMemory();
            Debug.Log("~" + panel + " was destroy!");
        }
示例#19
0
        IEnumerator _restart()
        {
            Debug.Log("LUA RESTART");
            Util.ClearMemory();
            yield return(Yielders.GetWaitForSeconds(0.2f));

            Unload();
            AppFacade.Instance.RemoveManager <NetworkManager>();
            yield return(Yielders.GetWaitForSeconds(0.2f));

            AppFacade.Instance.AddManager <NetworkManager>();
            //PanelManager.sceneUIRoot.SetActive(true);
            LuaStart();
            Util.ClearMemory();
        }
示例#20
0
        //-----------------------------------------------------------------
        protected void OnDestroy()
        {
            ClearButtonClick();
            ClearToggleClick();
            ClearInputChange();
            ClearInputEndEdit();
            ClearSliderChange();
            ClearScrollbarChange();
            ClearDropdownChange();
#if ASYNC_MODE
            string abName = name.ToLower();
            ResManager.UnloadAssetBundle(abName + AppConst.ExtName);
#endif
            Util.ClearMemory();
            Debug.Log("~" + name + " was destroy!");
        }
示例#21
0
 public void CleanAudioClip()
 {
     if (this.sounds.Count > 0)
     {
         List <string> list = new List <string>();
         Dictionary <string, AudioClip> .Enumerator enumerator = this.sounds.GetEnumerator();
         while (enumerator.MoveNext())
         {
             KeyValuePair <string, AudioClip> current = enumerator.Current;
             string text = current.Key.Replace('/', '_');
             if (text.LastIndexOf('.') != -1)
             {
                 text = text.Substring(0, text.LastIndexOf('.'));
             }
             UnityEngine.Object arg_7B_0 = this.bgAudio.clip;
             KeyValuePair <string, AudioClip> current2 = enumerator.Current;
             if (arg_7B_0 != current2.Value)
             {
                 List <string> arg_96_0 = list;
                 KeyValuePair <string, AudioClip> current3 = enumerator.Current;
                 arg_96_0.Add(current3.Key);
                 base.ResManager.UnloadAssetBundle(text, true, true);
             }
         }
         for (int i = 0; i < list.Count; i++)
         {
             if (this.sounds.ContainsKey(list[i]) && this.sounds[list[i]] == null)
             {
                 this.sounds.Remove(list[i]);
             }
         }
         list.Clear();
     }
     this.onlyAudio.Stop();
     this.onlyAudio.clip          = null;
     this.intervalBackgroundMusic = null;
     this.ClearIntervalPlayAduio();
     this.Stop2DAduio();
     Util.ClearMemory();
 }
示例#22
0
        /// <summary>
        /// ���ű�������
        /// </summary>
        /// <param name="canPlay"></param>
        public void PlayBacksound(string name, bool canPlay)
        {
            string url = AppConst.AudioDir + name;

            if (audio == null)
            {
                Debug.Log("<><><><>><><>PlayBacksoundPlayBacksound 10");
            }

            if (audio.clip != null)
            {
                if (url.IndexOf(audio.clip.name) > -1)
                {
                    if (!canPlay)
                    {
                        audio.Stop();
                        audio.clip = null;
                        Util.ClearMemory();
                    }
                    return;
                }
            }
            Debug.Log("<><><><>><><>PlayBacksoundPlayBacksound 1");
            if (canPlay)
            {
                audio.loop = true;
                audio.clip = LoadAudioClip(name);
                audio.Play();
            }
            else
            {
                audio.Stop();
                audio.clip = null;
                Util.ClearMemory();
            }
            Debug.Log("<><><><>><><>PlayBacksoundPlayBacksound 2");
        }
示例#23
0
 public override void DestroyNode(Node <string, GameObject> node)
 {
     UnityEngine.Object.Destroy(node.Value);
     Util.ClearMemory();
 }
示例#24
0
 protected void OnDestroy()
 {
     Util.CallLuaFunction(on_destroy, name);
     Util.ClearMemory();
 }
 public void Destroy()
 {
     m_LuaObject = null;
     Util.ClearMemory();
     Destroy(gameObject);
 }