public static T GetComponent <T>(this AObjectBase aObjectBase) where T : AObjectBase { if (aObjectBase == null) { return(null); } return(LccViewFactory.GetView <T>(aObjectBase.gameObject)); }
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)); }
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); }
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); }