Beispiel #1
0
 public void OnEnable()
 {
     if (m_instance == null)
     {
         m_instance = this;
         m_logList  = new List <OutputLog>();
         if (Application.isPlaying)
         {
             DontDestroyOnLoad(this.gameObject);
             Debug.Log("LDebug 成功初始化");
         }
     }
 }
Beispiel #2
0
 private void OnDestroy()
 {
     if (m_instance == this)
     {
         if (m_isOutput && Application.isPlaying)
         {
             WirteOutputLog();
         }
         m_instance = null;
         if (Application.isPlaying)
         {
             Debug.Log("LDebug 成功删除");
         }
     }
 }
Beispiel #3
0
 private void Awake()
 {
     if (m_instance == null)
     {
         m_instance = this;
         m_logList  = new List <OutputLog>();
         if (Application.isPlaying)
         {
             DontDestroyOnLoad(this.gameObject);
             Debug.Log($"LDebug 成功初始化");
         }
     }
     else if (m_instance != this)
     {
         DestroyImmediate(this);
     }
 }