コード例 #1
0
 static int AddItem(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UIWarpContent obj  = (UIWarpContent)ToLua.CheckObject(L, 1, typeof(UIWarpContent));
         int           arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         obj.AddItem(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #2
0
    IEnumerator AddLevels(int levelCount, Button btn, int currentIndex)
    {
        yield return(new WaitForEndOfFrame());

        int originalIndex = currentIndex;

        for (int i = 0; i < levelCount; i++)
        {
            MapItem levelItem = new MapItem("level_Title");
            levelItem.IsChapter       = false;
            levelItem.StarsCount      = 0;
            levelItem.TotalStarsCount = 3;
            currentIndex = currentIndex + 1;
            m_mapItems.Insert(currentIndex, levelItem);
            m_wrapContent.AddItem(currentIndex);
            btn.transform.parent.parent.localPosition = new Vector3(-btn.transform.parent.localPosition.x, btn.transform.parent.parent.localPosition.y, 0);
            yield return(new WaitForSeconds(0.1f));
        }

        AddCompressListener(btn, originalIndex);
        btn.enabled = true;
    }