コード例 #1
0
    void WrapSetting()
    {
        List <HeroTypeData> type_Data = MyCsvLoad.Instance.GetHeroTypeDatas(hero_Element, hero_Kingdom, hero_Class);

        RemoveSelectedHero(type_Data, selectedCardID);

        wrap.minIndex = 0;
        wrap.maxIndex = type_Data.Count - 1;
        wrap.SortBasedOnScrollMovement();

        lst_Cards.Sort(SortHeroCardByPositionX);
        SortCards();

        Transform trans = wrap.transform;

        if (type_Data.Count < card_num)
        {
            for (int i = 0; i < card_num; i++)
            {
                trans.GetChild(i).gameObject.SetActive((i >= type_Data.Count) ? false : true);
            }
        }
        else
        {
            for (int i = 0; i < card_num; i++)
            {
                trans.GetChild(i).gameObject.SetActive(true);
            }
        }
        wrap.WrapContent(true);
        scrollView.ResetPosition();
    }
コード例 #2
0
    void SortingLastLogin()
    {
        lst.Sort(FriendSortByLastLogin);
        SortAllButton();

        lstDatas.Sort(FriendSortByLastLogin);
        wrap.WrapContent(true);
    }
コード例 #3
0
    void WrapSetting()
    {
        wrap.minIndex = -(lst_VipReward.Count - 1);
        if (lst_VipReward.Count == 1)
        {
            wrap.minIndex = 1;
        }
        wrap.maxIndex = 0;

        wrap.SortBasedOnScrollMovement();

        Transform trans = wrap.transform;

        if (lst_VipReward.Count < button_num)
        {
            for (int i = 0; i < button_num; i++)
            {
                trans.GetChild(i).gameObject.SetActive((i >= lst_VipReward.Count) ? false : true);
            }
        }
        else
        {
            for (int i = 0; i < button_num; i++)
            {
                trans.GetChild(i).gameObject.SetActive(true);
            }
        }
        wrap.WrapContent(true);
        scrollView.ResetPosition();
    }
コード例 #4
0
 public static void IntilizationForWrapContent(UIWrapContent content , int number, GameObject itemPre, List<GameObject> list,bool active , float time, float time2, Action<List<GameObject>> callback = null)
 {
     for (int i = 0; i < number; i++)
     {
         GameObject gameO = (GameObject)GameObject.Instantiate(itemPre);
         gameO.transform.parent = content.transform;
         gameO.transform.localScale = Vector3.one;
         gameO.transform.localPosition = Vector3.one;
         gameO.name = i.ToString();
         list.Add(gameO);
     }
     Utility.instance.WaitForSecs(time2, () =>
     {
         for (int i = 0; i < list.Count; i++)
         {
             if (list[i] != null)
                 list[i].SetActive(active);
         }
     });
     Utility.instance.WaitForSecs(time, () =>
     {
         content.WrapContent();
     });
   
 }
コード例 #5
0
    void WrapSetting()
    {
        List <AchivementTypeData> type_Data = MyCsvLoad.Instance.GetAchivementTypeDivideByTabName(current_tab);

        //Dictionary<string, AchivementTypeData> dic_type = MyCsvLoad.Instance.GetAchivementTypeDatas();

        wrap.minIndex = -(type_Data.Count - 1);
        if (type_Data.Count == 1)
        {
            wrap.minIndex = 1;
        }
        wrap.maxIndex = 0;

        Transform trans = wrap.transform;

        if (type_Data.Count < 10)
        {
            for (int i = type_Data.Count; i < trans.childCount; i++)
            {
                trans.GetChild(i).gameObject.SetActive(false);
            }
        }
        else
        {
            for (int i = 0; i < trans.childCount; i++)
            {
                trans.GetChild(i).gameObject.SetActive(true);
            }
        }

        wrap.SortAlphabetically();
        wrap.WrapContent(true);

        scrollView.ResetPosition();
    }
コード例 #6
0
    static int WrapContent(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        UIWrapContent obj = (UIWrapContent)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIWrapContent");

        obj.WrapContent();
        return(0);
    }
コード例 #7
0
 static public int WrapContent(IntPtr l)
 {
     try {
         UIWrapContent self = (UIWrapContent)checkSelf(l);
         self.WrapContent();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #8
0
 static int WrapContent(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UIWrapContent obj = (UIWrapContent)ToLua.CheckObject <UIWrapContent>(L, 1);
         obj.WrapContent();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #9
0
    public override void OnContentBeginHide()
    {
        base.OnContentBeginHide();

        if (wrapContent.transform.childCount > 0)
        {
            GameObject[] childs = new GameObject[wrapContent.transform.childCount];

            for (int i = 0; i < wrapContent.transform.childCount; i++)
            {
                childs[i] = wrapContent.transform.GetChild(i).gameObject;
            }


            for (int i = 0; i < childs.Length; i++)
            {
                childs[i].transform.parent = null;
                NGUITools.Destroy(childs[i]);
            }

            wrapContent.SortBasedOnScrollMovement();
            wrapContent.WrapContent();
        }
    }
コード例 #10
0
    public static int WrapContent(IntPtr l)
    {
        int result;

        try
        {
            UIWrapContent uIWrapContent = (UIWrapContent)LuaObject.checkSelf(l);
            uIWrapContent.WrapContent();
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #11
0
ファイル: InfiniteList.cs プロジェクト: soulhez/RPG_JG
    public override void Parse(IList list)
    {
        listData = list;
        if (list.Count <= 0)
        {
            UITools.SA(this, false);
        }
        else
        {
            if (row <= 1)
            {
                wrapContent.minIndex = (listData.Count - 1) * -1;
                wrapContent.maxIndex = 0;
            }
            else
            {
                wrapContent.maxIndex = 0;
                int _minIndex = listData.Count % row == 0 ? listData.Count / row - 1 : listData.Count / row;
                wrapContent.minIndex = _minIndex * -1;

                groupData = new ArrayList();
                for (int i = 0; i < listData.Count / row; i++)
                {
                    ArrayList _list = new ArrayList();
                    for (int j = 0; j < row; j++)
                    {
                        _list.Add(listData[i * row + j]);
                    }
                    groupData.Add(_list);
                }
                ArrayList l = new ArrayList();
                for (int i = listData.Count - listData.Count % row; i < listData.Count; i++)
                {
                    l.Add(listData[i]);
                }
                if (l.Count != 0)
                {
                    groupData.Add(l);
                }
            }
            UITools.SA(this, true);
            wrapContent.mFirstTime = true;
            wrapContent.WrapContent();
            wrapContent.mFirstTime = false;
        }
    }
コード例 #12
0
    private static int WrapContent(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 1);
            UIWrapContent uIWrapContent = (UIWrapContent)ToLua.CheckObject(L, 1, typeof(UIWrapContent));
            uIWrapContent.WrapContent();
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
コード例 #13
0
    protected void EventResetPosition()
    {
        for (int i = 0; i < _iCountScrollItem; i++)
        {
            _listScrollViewItem[i].SetActive(i < _iCountRealItem);
        }

        int iMaxItem = Mathf.Max(1, _iCountRealItem - 1);

        _pUIWrapContent.minIndex = -iMaxItem;
        _pUIWrapContent.maxIndex = 0;

        _pUIWrapContent.SortAlphabetically();
        _pUIWrapContent.WrapContent();

        if (_iCountRealItem < _iCountScrollItem)
        {
            _pUIScrollView.ResetPosition();
            _pUIScrollView.RestrictWithinBounds(true);
        }

        ProcCheckDisableDrag();
    }
コード例 #14
0
 void Wrap()
 {
     WrapContent.SortBasedOnScrollMovement();
     WrapContent.WrapContent();
 }