コード例 #1
0
ファイル: ObjectBaseExpand.cs プロジェクト: yu821157174/Lcc
 public static T GetComponent <T>(this AObjectBase aObjectBase) where T : AObjectBase
 {
     if (aObjectBase == null)
     {
         return(null);
     }
     return(LccViewFactory.GetView <T>(aObjectBase.gameObject));
 }
コード例 #2
0
ファイル: ObjectBaseExpand.cs プロジェクト: yu821157174/Lcc
        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));
        }
コード例 #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);
        }
コード例 #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);
        }