Example #1
0
        public static T AddChildComponent <T>(this AObjectBase aObjectBase, params string[] childs) where T : AObjectBase
        {
            GameObject childGameObject = aObjectBase.GetChildGameObject(childs);

            if (childGameObject == null)
            {
                return(null);
            }
            return(LccViewFactory.CreateView <T>(childGameObject));
        }
Example #2
0
        public Item CreateItem(ItemType type, object data, Transform parent)
        {
            Item       item       = new Item();
            GameObject gameObject = CreateGameObject(type.ToItemString(), parent);

            if (gameObject == null)
            {
                return(null);
            }
            item.Type = type;
            Type classType = Manager.Instance.GetType(type.ToItemString());

            if (classType != null)
            {
                item.AObjectBase = LccViewFactory.CreateView(classType, gameObject, data);
            }
            return(item);
        }
        public async Task <Panel> CreatePanelAsync(PanelType type, object data)
        {
            Panel panel = new Panel();

            panel.State = PanelState.Close;
            GameObject gameObject = await CreateGameObjectAsync(type.ToPanelString(), Objects.Canvas.transform);

            if (gameObject == null)
            {
                return(null);
            }
            panel.Type = type;
            Type classType = Manager.Instance.GetType(type.ToPanelString());

            if (classType != null)
            {
                panel.AObjectBase = LccViewFactory.CreateView(classType, gameObject, data);
            }
            panel.ClosePanel();
            return(panel);
        }