Ejemplo n.º 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();
     }
 }
Ejemplo n.º 2
0
 public void Stop()
 {
     audio.Stop();
     audio.loop = false;
     audio.clip = null;
     Util.ClearMemory();
 }
Ejemplo n.º 3
0
 //Í£Ö¹±³¾°ÒôÀÖ
 public void StopBackSound()
 {
     backSoundKey = "";
     audio.volume = 0;
     audio.Stop();
     Util.ClearMemory();
 }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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!");
        }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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!");
        }
Ejemplo n.º 9
0
        //-----------------------------------------------------------------
        protected void OnDestroy()
        {
            ClearClick();
#if ASYNC_MODE
            ResManager.UnloadAssetBundle(sBundleName);
#endif
            Util.ClearMemory();
            Debug.Log("~" + sBundleName + " unload!");
        }
Ejemplo n.º 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!");
        }
Ejemplo n.º 11
0
 protected void OnDestroy()
 {
     Util.CallMethod(base.name, "OnDestroy", new object[]
     {
         base.gameObject
     });
     this.ClearUIEvent();
     Util.ClearMemory();
     Debug.Log("~" + base.name + " was destroy!");
 }
Ejemplo n.º 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!");
        }
Ejemplo n.º 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!");
        }
Ejemplo n.º 16
0
 //-----------------------------------------------------------------
 protected void OnDestroy()
 {
     if (bundle)
     {
         bundle.Unload(true);
         bundle = null;  //销毁素材
     }
     ClearClick();
     Util.ClearMemory();
     Debug.Log("~" + name + " was destroy!");
 }
Ejemplo n.º 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();
                }
            }
        }
Ejemplo n.º 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!");
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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!");
        }
Ejemplo n.º 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();
 }
Ejemplo n.º 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");
        }
Ejemplo n.º 23
0
 public override void DestroyNode(Node <string, GameObject> node)
 {
     UnityEngine.Object.Destroy(node.Value);
     Util.ClearMemory();
 }
Ejemplo n.º 24
0
 protected void OnDestroy()
 {
     Util.CallLuaFunction(on_destroy, name);
     Util.ClearMemory();
 }
Ejemplo n.º 25
0
 public void Destroy()
 {
     m_LuaObject = null;
     Util.ClearMemory();
     Destroy(gameObject);
 }