Exemplo n.º 1
0
        private static QuickGridContent CreateContent(GameObject parent)
        {
            int        layer = parent.gameObject.layer;
            GameObject go    = new GameObject("Content");

            go.E_SetParentAndReset(parent);
            go.layer = layer;
            QuickGridContent content = go.AddComponent <QuickGridContent>();

            return(content);
        }
    static int get_content(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            littlerbird.UI.QuickGrid        obj = (littlerbird.UI.QuickGrid)o;
            littlerbird.UI.QuickGridContent ret = obj.content;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index content on a nil value"));
        }
    }
Exemplo n.º 3
0
        protected void OnEnable()
        {
            grid = target as QuickGrid;
            grid.needItemEvent     = true;
            grid.needItemPanelMask = false;
            mask = grid.GetComponent <Image>();
            //sv = GetAndAdd<ScrollRect>(grid);

            content = FindComponentInChildren <QuickGridContent>(grid.transform); //grid.GetComponentInChildren<QuickGridContent>();
            if (!content)
            {
                content = CreateContent(grid.gameObject);
            }
            tsfWidget = content.transform;

            item = FindComponentInChildren <QuickGridItemBase>(tsfWidget);// content.GetComponentInChildren<QuickGirdItemConfig>();
            if (!item)
            {
                item = CreateItem(content.gameObject);
            }
        }