Ejemplo n.º 1
0
        public static UI Create()
        {
            try
            {
                //GameObject bundleGameObject = ((GameObject)ResourcesHelper.Load("KV")).Get<GameObject>(UIType.UILoading);
                //GameObject go = UnityEngine.Object.Instantiate(bundleGameObject);
                //go.layer = LayerMask.NameToLayer(LayerNames.UI);
                //UI ui = ComponentFactory.Create<UI, string, GameObject>(UIType.UILoading, go, false);

                //ui.AddComponent<UILoadingComponent>();
                //return ui;

                GameObject bundleGameObject = ((GameObject)ResourcesHelper.Load("UIStart")).gameObject;//Get<GameObject>(UIType.UIStart);
                GameObject go = UnityEngine.Object.Instantiate(bundleGameObject);
                go.layer = LayerMask.NameToLayer(LayerNames.UI);
                UI ui = ComponentFactory.Create <UI, string, GameObject>(UIType.UIStart, go, false);

                ui.AddComponent <UIStartComponet>();
                return(ui);
            }
            catch (Exception e)
            {
                Log.Error(e);
                return(null);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 获得AB包地址和服务器地址
 /// </summary>
 /// <returns></returns>
 public static string GetGlobal()
 {
     try
     {
         GameObject config    = (GameObject)ResourcesHelper.Load("KV");     //加载Resources文件夹下KV 预制体
         string     configStr = config.Get <TextAsset>("GlobalProto").text; //得到上面的GlobalProto文本
         return(configStr);
     }
     catch (Exception e)
     {
         throw new Exception($"load global config file fail", e);
     }
 }
Ejemplo n.º 3
0
 public static string GetGlobal()
 {
     try
     {
         GameObject config    = (GameObject)ResourcesHelper.Load("KV");
         string     configStr = config.GetTargetObjectFromRC <TextAsset>("GlobalProto").text;
         return(configStr);
     }
     catch (Exception e)
     {
         throw new Exception($"load global config file fail", e);
     }
 }
Ejemplo n.º 4
0
        public UI Create(Scene scene, string type, GameObject gameObject)
        {
            try
            {
                GameObject bundleGameObject = ((GameObject)ResourcesHelper.Load("KV")).Get <GameObject>(type);
                GameObject go = UnityEngine.Object.Instantiate(bundleGameObject);
                go.layer = LayerMask.NameToLayer(LayerNames.UI);
                UI ui = ComponentFactory.Create <UI, GameObject>(go);

                ui.AddUiComponent <UILoadingComponent>();
                return(ui);
            }
            catch (Exception e)
            {
                Log.Error(e);
                return(null);
            }
        }
        public static UI Create(Entity domain)
        {
            try
            {
                GameObject bundleGameObject = ((GameObject)ResourcesHelper.Load("KV")).Get <GameObject>(UIType.UILoading);
                GameObject go = UnityEngine.Object.Instantiate(bundleGameObject);
                go.layer = LayerMask.NameToLayer(LayerNames.UI);
                UI ui = EntityFactory.Create <UI, string, GameObject>(domain, UIType.UILoading, go);

                ui.AddComponent <UILoadingComponent>();
                return(ui);
            }
            catch (Exception e)
            {
                Log.Error(e);
                return(null);
            }
        }
Ejemplo n.º 6
0
        public override byte[] FileOpen(string filePath, string ext = null)
        {
            GameObject kv = (GameObject)ResourcesHelper.Load("KV");

            return(kv.Get <TextAsset>(filePath).bytes);
        }