コード例 #1
0
 static void CloneAll(byte[] ui, Transform root)
 {
     if (ui != null)
     {
         HGUIManager.Initial(root);
         var fake  = HGUIManager.LoadModels(ui, "assTest").models;
         var child = HGUIManager.GetAllChild(fake);
         if (child != null)
         {
             Initializer initializer = new Initializer();
             for (int i = 0; i < child.Length; i++)
             {
                 var go = HGUIManager.Clone(child[i], initializer);
                 if (go != null)
                 {
                     var trans = go.transform;
                     trans.SetParent(root);
                     trans.localPosition = Vector3.zero;
                     trans.localScale    = Vector3.one;
                     trans.localRotation = Quaternion.identity;
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: TestPageHelper.cs プロジェクト: huqiang0204/HGUI
    public void Initital()
    {
        LoadBundle();
        HGUIManager.Initial();
        var db = HGUIManager.GetPrefab(TargetCanvas);

        HGUIManager.prefabAssets.Clear();
        HGUIManager.LoadModels(db, AssetName);
        var c = transform.childCount;

        for (int i = 0; i < c; i++)
        {
            GameObject.Destroy(transform.GetChild(i).gameObject);
        }
    }
コード例 #3
0
    public override void Initial(Transform parent, object dat = null)
    {
        base.Initial(parent, dat);
        string dic  = Application.persistentDataPath + "/";
        string path = dic + "baseUI.bytes";

        if (File.Exists(path))
        {
            byte[] ui = File.ReadAllBytes(dic + "baseUI.bytes");
            HGUIManager.LoadModels(ui, "baseUI");
        }
        string dll = dic + "HotFix.dll";
        string pdb = dic + "HotFix.dll";

        HotFix.Instance.Load(File.ReadAllBytes(dll));
        HotFix.Instance.Start(Parent, "Start", dat);
    }
コード例 #4
0
    protected override void Start()
    {
        base.Start();
        Instance       = this;
        Scale.DpiScale = true;
        App.Initial(transform);
        DontDestroyOnLoad(gameObject);
        HGUIManager.LoadModels(baseUI.bytes, "baseUI");
#if UNITY_EDITOR
        AssetBundle.UnloadAllAssetBundles(true);
#endif
        //ElementAsset.LoadAssetsAsync("base.unity3d").PlayOver = (o, e) =>
        //{
        UIPage.LoadPage <LoadingPage>("checkOss");
        // };
        KcpDataControll.Instance.Connection("193.112.70.170", 8899);
    }
コード例 #5
0
    // Start is called before the first frame update
    protected override void Start()
    {
        KcpDataControll.Instance.Connection("192.168.0.134", 8899);
        KcpDataControll.Instance.OpenLog();
        base.Start();
        App.Initial(transform);
        HGUIManager.LoadModels(baseUI.bytes, "baseUI");
#if UNITY_EDITOR
        AssetBundle.UnloadAllAssetBundles(true);
#endif
        //ElementAsset.LoadAssetsAsync("base.unity3d").PlayOver = (o, e) =>
        //{
        //    UIPage.LoadPage<ChatPage>();
        //};
        UIPage.LoadPage <StartPage>();
        DataGrid.CursorX = DockPanelLine.CursorX = Resources.Load <Texture2D>("StretchWX");
        DataGrid.CursorY = DockPanelLine.CursorY = Resources.Load <Texture2D>("StretchWY");
    }
コード例 #6
0
    static void CloneAll(DataBuffer db, UIElement root)
    {
        root.child.Clear();
        var fake  = HGUIManager.LoadModels(db, "assTest").models;
        var child = HGUIManager.GetAllChild(fake);

        if (child != null)
        {
            for (int i = 0; i < child.Length; i++)
            {
                var go = HGUIManager.Clone(child[i]);
                if (go != null)
                {
                    go.SetParent(root);
                    go.localScale = Vector3.one;
                }
            }
        }
    }
コード例 #7
0
 static void Clone(string CloneName, byte[] ui, Transform root)
 {
     if (ui != null)
     {
         if (CloneName != null)
         {
             if (CloneName != "")
             {
                 HGUIManager.Initial(root);
                 HGUIManager.LoadModels(ui, "assTest");
                 var go = HGUIManager.GameBuffer.Clone(HGUIManager.FindModel("assTest", CloneName));
                 if (go != null)
                 {
                     var trans = go.transform;
                     trans.SetParent(root);
                 }
             }
         }
     }
 }
コード例 #8
0
 static void CloneAll(byte[] ui, Transform root)
 {
     if (ui != null)
     {
         HGUIManager.Initial(root);
         var fake  = HGUIManager.LoadModels(ui, "assTest").models;
         var child = HGUIManager.GetAllChild(fake);
         if (child != null)
         {
             for (int i = 0; i < child.Length; i++)
             {
                 var go = HGUIManager.GameBuffer.Clone(child[i]);
                 if (go != null)
                 {
                     var trans = go.transform;
                     trans.SetParent(root);
                 }
             }
         }
     }
 }
コード例 #9
0
 static void Clone(string CloneName, byte[] ui, Transform root)
 {
     if (ui != null)
     {
         if (CloneName != null)
         {
             if (CloneName != "")
             {
                 HGUIManager.Initial(root);
                 HGUIManager.LoadModels(ui, "assTest");
                 Initializer initializer = new Initializer();
                 var         go          = HGUIManager.Clone(HGUIManager.FindModel("assTest", CloneName), initializer);
                 if (go != null)
                 {
                     var trans = go.transform;
                     trans.SetParent(root);
                     trans.localScale    = Vector3.one;
                     trans.localScale    = Vector3.one;
                     trans.localRotation = Quaternion.identity;
                 }
             }
         }
     }
 }