public static VersionConfig Get() { if (config == null) { config = BuiltInAssets.LoadConfig <VersionConfig>("VersionConfig"); } return(config); }
static void RunTimeInit() { if (GameObject.FindObjectOfType <UIRoot>() == null) { var prefab = BuiltInAssets.LoadPrefab("UIRoot"); var instance = GameObject.Instantiate(prefab); instance.name = "UIRoot"; DontDestroyOnLoad(instance); } }
public static void CreateUIRoot() { var uiroot = GameObject.FindObjectOfType <UIRoot>(); if (uiroot == null) { var prefab = BuiltInAssets.LoadPrefab("UIRoot"); var instance = GameObject.Instantiate(prefab); instance.name = "UIRoot"; uiroot = instance.GetComponent <UIRoot>(); var windowRoot = uiroot.transform.GetChildTransformDeeply("WindowRoot"); if (windowRoot != null) { Selection.activeObject = windowRoot; } var uicamera = uiroot.GetComponentInChildren <Camera>(true); uicamera.clearFlags = CameraClearFlags.SolidColor; } }
static ColorUtil() { var colorPattern = BuiltInAssets.LoadConfig <ColorPattern>("Config/ColorPattern"); white = colorPattern.white; green = colorPattern.green; blue = colorPattern.blue; purple = colorPattern.purple; orange = colorPattern.orange; red = colorPattern.red; pink = colorPattern.pink; qualityColors = new string[] { StringUtil.Contact("<color=#", ColorToInt16String(white), ">{0}</color>"), StringUtil.Contact("<color=#", ColorToInt16String(green), ">{0}</color>"), StringUtil.Contact("<color=#", ColorToInt16String(blue), ">{0}</color>"), StringUtil.Contact("<color=#", ColorToInt16String(purple), ">{0}</color>"), StringUtil.Contact("<color=#", ColorToInt16String(orange), ">{0}</color>"), StringUtil.Contact("<color=#", ColorToInt16String(red), ">{0}</color>"), StringUtil.Contact("<color=#", ColorToInt16String(pink), ">{0}</color>"), }; }
private void OnEnable() { if (!Application.isPlaying) { var uiroot = GameObject.FindObjectOfType <UIRoot>(); if (uiroot == null) { var prefab = BuiltInAssets.LoadPrefab("UIRoot"); var instance = GameObject.Instantiate(prefab); instance.name = "UIRoot"; uiroot = instance.GetComponent <UIRoot>(); var uicamera = uiroot.GetComponentInChildren <Camera>(true); uicamera.clearFlags = CameraClearFlags.SolidColor; } var windowRoot = uiroot.transform.GetChildTransformDeeply("WindowRoot"); if (windowRoot != null) { (this.transform as RectTransform).MatchWhith(windowRoot as RectTransform); } } }
public static Material GetDefaultSpriteGrayMaterial() { return(BuiltInAssets.LoadMaterial("SpriteGray")); }