Ejemplo n.º 1
0
 public override void OnDisable()
 {
     base.OnDisable();
     gameObject.SetActive(false);
     wrapContent.SortBasedOnScrollMovement();
     scrollView.MoveRelative(defScrollViewPos - transform.localPosition);
 }
Ejemplo n.º 2
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();
    }
Ejemplo n.º 3
0
        private IEnumerator <float> C_RefreshScrollList(GameObject obj = null, bool isShowing = false)
        {
            if (isRefreshing)
            {
                yield break;
            }
            isRefreshing = true;
            yield return(0);

            itemScrollList.SortBasedOnScrollMovement();
            yield return(0);

            if (isShowing)
            {
                if (obj != null)
                {
                    Vector3 adPos = obj.transform.localPosition;
                    nativeAdItem.cachedGameObject.transform.localPosition = adPos;
                    nativeAdItem.cachedGameObject.SetActive(true);
                }
                itemScrollList.ResetChildrenPositions();
            }
            yield return(0);

            isRefreshing = false;
        }
Ejemplo n.º 4
0
 protected override void DealShowData()
 {
     if (Data is Dictionary <string, object> && ItemContainer && PrefabItem)
     {
         var dic       = Data as Dictionary <string, object>;
         var showDatas = new SlideShowData(dic, GetItemType());
         var count     = showDatas.DataItems.Count;
         _stayTime      = showDatas.StayTime;
         _moveSpeed     = Math.Abs(showDatas.MoveSpeed);
         _moveDirection = showDatas.MoveSpeed > 0 ? 1 : -1;
         _curStatTime   = 0;
         for (int i = 0; i < count; i++)
         {
             var view = ItemContainer.transform.GetChildView(i, PrefabItem);
             if (view)
             {
                 view.UpdateView(showDatas.DataItems[i]);
             }
         }
         ItemContainer.SortBasedOnScrollMovement();
         if (count <= 1)
         {
             return;
         }
         if (gameObject.activeInHierarchy)
         {
             _coroutine = StartCoroutine(SlideWait());
         }
     }
 }
Ejemplo n.º 5
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();
    }
Ejemplo n.º 6
0
    void WrapSetting()
    {
        wrap.minIndex = -(lstDatas.Count - 1);
        if (lstDatas.Count == 1)
        {
            wrap.minIndex = 1;
        }
        wrap.maxIndex = 0;

        if (lstDatas.Count < 10)
        {
            Transform trans = wrap.transform;

            for (int i = lstDatas.Count; i < trans.childCount; i++)
            {
                trans.GetChild(i).gameObject.SetActive(false);
            }
        }

        wrap.SortBasedOnScrollMovement();

        //init sort
        SortingID();

        scrollView.ResetPosition();

        toggleSortByName.value = true;
    }
Ejemplo n.º 7
0
 private void SetWrap(int dataLen)
 {
     ScrollView.ResetPosition();
     ScrollView.transform.localPosition = Vector3.zero;
     ScrollView.panel.clipOffset        = Vector2.zero;
     Wrap.minIndex = GetMinIndexByLen(dataLen);
     Wrap.SortBasedOnScrollMovement();
 }
Ejemplo n.º 8
0
    static int SortBasedOnScrollMovement(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        UIWrapContent obj = (UIWrapContent)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIWrapContent");

        obj.SortBasedOnScrollMovement();
        return(0);
    }
Ejemplo n.º 9
0
    private void SetWrap()
    {
        ScrollView.ResetPosition();
        ScrollView.transform.localPosition = Vector3.zero;
        ScrollView.panel.clipOffset        = Vector2.zero;
        int minIndex = -DataLen;

        Wrap.minIndex = minIndex;
        Wrap.SortBasedOnScrollMovement();
    }
Ejemplo n.º 10
0
 static public int SortBasedOnScrollMovement(IntPtr l)
 {
     try {
         UIWrapContent self = (UIWrapContent)checkSelf(l);
         self.SortBasedOnScrollMovement();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 11
0
 static int SortBasedOnScrollMovement(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UIWrapContent obj = (UIWrapContent)ToLua.CheckObject <UIWrapContent>(L, 1);
         obj.SortBasedOnScrollMovement();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 12
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();
        }
    }
Ejemplo n.º 13
0
    public static int SortBasedOnScrollMovement(IntPtr l)
    {
        int result;

        try
        {
            UIWrapContent uIWrapContent = (UIWrapContent)LuaObject.checkSelf(l);
            uIWrapContent.SortBasedOnScrollMovement();
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Ejemplo n.º 14
0
    private static int SortBasedOnScrollMovement(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 1);
            UIWrapContent uIWrapContent = (UIWrapContent)ToLua.CheckObject(L, 1, typeof(UIWrapContent));
            uIWrapContent.SortBasedOnScrollMovement();
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
Ejemplo n.º 15
0
 void Wrap()
 {
     WrapContent.SortBasedOnScrollMovement();
     WrapContent.WrapContent();
 }