Esempio n. 1
0
 public static T GetComponent <T>(this AObjectBase aObjectBase) where T : AObjectBase
 {
     if (aObjectBase == null)
     {
         return(null);
     }
     return(LccViewFactory.GetView <T>(aObjectBase.gameObject));
 }
Esempio n. 2
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));
        }
Esempio n. 3
0
        public async Task <Item> CreateItemAsync(ItemType type, object data, Transform parent)
        {
            Item       item       = new Item();
            GameObject gameObject = await CreateGameObjectAsync(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);
        }
Esempio n. 4
0
        public Panel CreatePanel(PanelType type, object data)
        {
            Panel panel = new Panel();

            panel.State = PanelState.Close;
            GameObject gameObject = CreateGameObject(type.ToPanelString(), LccModel.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);
        }