using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
|
namespace vnxbqy.UI
|
{
|
public class HUDCenter
|
{
|
public static HUDRoot hudRoot {
|
get; set;
|
}
|
|
public static HUDRoot CreateHUDRoot()
|
{
|
if (hudRoot == null)
|
{
|
var prefab = BuiltInLoader.LoadPrefab("HUDRoot");
|
var instance = GameObject.Instantiate(prefab, Vector3.zero, Quaternion.identity);
|
instance.name = "HUDRoot";
|
hudRoot = instance.GetComponent<HUDRoot>();
|
|
GameObject.DontDestroyOnLoad(instance);
|
}
|
|
return hudRoot;
|
}
|
|
}
|
}
|