示例#1
0
        public void Add <T>() where T : Component
        {
            if (Go == null)
            {
                Debug.LogError(GetType() + "/Add()/ current gameObject is null :" + Go.name);
                return;
            }

            Go.AddComponent <T>();
        }
示例#2
0
        public T Add <T>() where T : Component
        {
            if (Go != null)
            {
                return(Go.AddComponent <T>());
            }

            Debug.LogError("当前gameobject为空");
            return(null);
        }
示例#3
0
        public SelectObject(string imageFileName, string text, Action onClick)
        {
            ButtonObject bo = new ButtonObject(imageFileName, text, onClick);

            Go = bo.Go;

            //加入Layout
            LayoutElement le = Go.AddComponent <LayoutElement>();

            le.preferredHeight = _preferredHeight;
        }