示例#1
0
 public void OnDisable()
 {
     if (instance == this)
     {
         instance = null;
     }
 }
示例#2
0
        public static void Init()
        {
            if (instance != null)
            {
                return;
            }

            GameObject obj = new GameObject("UnityMainThread");

            DontDestroyOnLoad(obj);
            instance = obj.AddComponent <UnityMainThread>();
        }