示例#1
0
 static public void Initilize()
 {
     if (_instance != null)
     {
         return;
     }
     if (_instance == null)
     {
         GameObject obj = GameObject.Find(Tag);
         if (obj == null)
         {
             obj      = new GameObject();
             obj.name = Tag;
         }
         _instance = obj.GetComponent <TimerMgr>();
         if (_instance == null)
         {
             _instance = obj.AddComponent <TimerMgr>();
         }
         _instance.init();
         GameObject.DontDestroyOnLoad(obj);
     }
 }