예제 #1
0
    public static VersionConfig Get()
    {
        if (config == null)
        {
            config = BuiltInAssets.LoadConfig <VersionConfig>("VersionConfig");
        }

        return(config);
    }
예제 #2
0
 static void RunTimeInit()
 {
     if (GameObject.FindObjectOfType <UIRoot>() == null)
     {
         var prefab   = BuiltInAssets.LoadPrefab("UIRoot");
         var instance = GameObject.Instantiate(prefab);
         instance.name = "UIRoot";
         DontDestroyOnLoad(instance);
     }
 }
예제 #3
0
    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;
        }
    }
예제 #4
0
파일: ColorUtil.cs 프로젝트: Hengle/Fish
    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>"),
        };
    }
예제 #5
0
    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);
            }
        }
    }
예제 #6
0
파일: MaterialUtil.cs 프로젝트: Hengle/Fish
 public static Material GetDefaultSpriteGrayMaterial()
 {
     return(BuiltInAssets.LoadMaterial("SpriteGray"));
 }