Beispiel #1
0
    public static TransfromModel LoadToGame(string ass, string mod, object o, Transform parent, string filter = "mod")
    {
        var m = ModelManager2D.LoadToGame(ass, mod, o, parent);

        //LoadToGame(m, o, parent, filter);
        return(m);
    }
 static void CloneAll(byte[] ui, Transform root)
 {
     if (ui != null)
     {
         LoadBundle();
         ModelManager2D.Initial();
         var all    = ModelManager2D.LoadModels(ui, "assTest");
         var models = all.models.child;
         for (int i = 0; i < models.Count; i++)
         {
             EditorModelManager2D.LoadToGame(models[i], null, root, "");
         }
     }
 }
 static void Clone(string Assetsname, string CloneName, byte[] ui, Transform root)
 {
     if (ui != null)
     {
         if (Assetsname != null)
         {
             if (CloneName != null)
             {
                 if (CloneName != "")
                 {
                     LoadBundle();
                     ModelManager2D.Initial();
                     ModelManager2D.LoadModels(ui, "assTest");
                     EditorModelManager2D.LoadToGame(Assetsname, CloneName, null, root, "");
                 }
             }
         }
     }
 }
Beispiel #4
0
 static void Clone(string CloneName, byte[] ui, Transform root, Element2DCreate ele)
 {
     if (ui != null)
     {
         if (CloneName != null)
         {
             if (CloneName != "")
             {
                 LoadBundle();
                 ModelManager2D.Initial(root);
                 ele.RegExtendComponent();
                 var assets = ModelManager2D.LoadModels(ui, "assTest");
                 var fake   = ModelManager2D.GameBuffer.FindChild(assets.models, CloneName);
                 var go     = ModelManager2D.GameBuffer.Clone(fake);
                 go.transform.SetParent(root);
             }
         }
     }
 }
    static void Create(string Assetname, string dicpath, GameObject gameObject)
    {
        if (Assetname == null)
        {
            return;
        }
        if (Assetname == "")
        {
            return;
        }
        LoadBundle();
        Assetname = Assetname.Replace(" ", "");
        ModelManager2D.Initial();
        var dc = dicpath;

        if (dc == null | dc == "")
        {
            dc = Application.dataPath + "/AssetsBundle/";
        }
        ModelManager2D.SavePrefab(gameObject.transform, dc + Assetname);
        Debug.Log("create done");
    }
Beispiel #6
0
        public static void Initial(RectTransform uiRoot)
        {
            InitialUI();
            Initial();
            if (uiRoot == null)
            {
                var ui = new GameObject("UI", typeof(Canvas));
                ui.GetComponent <Canvas>().renderMode = RenderMode.ScreenSpaceOverlay;
                UIRoot = new GameObject("uiRoot", typeof(RectTransform)).transform as RectTransform;
                UIRoot.SetParent(ui.transform);
                UIRoot.localPosition = Vector3.zero;

                Hint = new GameObject("Hint", typeof(RectTransform)).transform as RectTransform;
                Hint.SetParent(ui.transform);
                Hint.localPosition = Vector3.zero;
                Hint.SetAsLastSibling();
                //HintPage.root = Hint;
                //NotifyControll.root = Hint;
            }
            else
            {
                UIRoot = uiRoot;
            }
            var root = ModelElement.CreateNew("uiRoot");

            root.Context     = uiRoot as RectTransform;
            root.Main        = uiRoot.gameObject;
            UIPage.Root      = root;
            UIRoot.sizeDelta = new Vector2(Screen.width, Screen.height);

            var buff = new GameObject("buffer", typeof(Canvas));

            buff.SetActive(false);
            ModelManagerUI.CycleBuffer = buff.transform;
            EventCallBack.InsertRoot(UIRoot.root as RectTransform);
            ModelManager2D.Initial();
            Scale.NormalDpi = Screen.dpi;
        }
Beispiel #7
0
    public static GameObject LoadToGame(TransfromModel mod, object o, Transform parent, string filter = "mod")
    {
        var m = ModelManager2D.LoadToGame(mod, o, parent, filter);

        return(m);
    }
 /// <summary>
 ///
 /// </summary>
 private void Start()
 {
     //provides access to the stackmodel and stackdisplay for running their function
     _manager = GetComponent <ModelManager2D>();
 }