Files
Main/Assets/Plugins/References/FuncellBase/_Global/AppRoot.cs

54 lines
1.1 KiB
C#
Raw Normal View History

2025-01-25 04:38:09 +08:00
using UnityEngine;
namespace Thousandto.Core.Base
{
/// <summary>
/// 应用程序的根节点
/// </summary>
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