using UnityEngine; namespace Thousandto.Core.Base { /// /// 应用程序的根节点 /// public static class AppRoot { #region //常量 //Root对象名字 private const string CN_NAME = "[ProgramRoot]"; #endregion #region//静态私有对象 //Root对象 private static GameObject _go = null; //Transform private static Transform _trans = null; #endregion #region//属性信息 //GameObject public static GameObject GameObject { get { return _go; } } //Transform public static Transform Transform { get { return _trans; } } #endregion #region//静态构造函数 //静态构造函数 static AppRoot() { _go = new GameObject(CN_NAME); _trans = _go.transform; GameObject.DontDestroyOnLoad(_go); } #endregion } } //EOF