Пример #1
0
    public void SwitchPromotion(bool isVideo)
    {
        _IsShowingVideo = isVideo;
        var paths = isVideo ? EntryPoint.Instance.UpdatePromotionParams.VideoPaths : EntryPoint.Instance.UpdatePromotionParams.PicturePaths;

        pListProgress.SetItemCount(paths.Count);

        if (pRawImageVideo.gameObject.activeSelf != isVideo)
        {
            pRawImageVideo.gameObject.SetActive(isVideo);
        }
        if (pImagePicture.gameObject.activeSelf == isVideo)
        {
            pImagePicture.gameObject.SetActive(!isVideo);
        }

        _CurShowIndex = 0;
        _IsAutoEnd    = false;
        EntryPoint.Instance.VideoManager.StopVideo();
        if (_RefreshCorutine != null)
        {
            EntryPoint.Instance.StopCoroutine(_RefreshCorutine);
            _RefreshCorutine = null;
        }

        if (isVideo)
        {
            SelectVideo(0);
        }
        else
        {
            SelectPicture(0);
        }
    }
Пример #2
0
    static int SetItemCount(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        GNewList obj  = (GNewList)LuaScriptMgr.GetUnityObjectSelf(L, 1, "GNewList");
        int      arg0 = (int)LuaScriptMgr.GetNumber(L, 2);

        obj.SetItemCount(arg0);
        return(0);
    }
Пример #3
0
    private void OpenTab(int count, bool needRepos)
    {
        if (SubViewTemplate != null && _SubList != null)
        {
            if (MainSelected == -1)
            {
                count = 0;
            }

            float y_oldPos = CalcPosY(MainSelected);

            _SubList.SetItemCount(count);

            if (count > 0)
            {
                //Vector2 ori_size = SubViewTemplate.sizeDelta;
                ////Vector2 ori_size = Vector2.zero;//_subList.RectTrans.sizeDelta;
                //float rows = (count > 5) ? 5.5f : count;

                //Vector4 vb = GNewUITools.GetScrollViewBorder(_SubList.ScrollRectControl);

                ////ori_size.x = RectTrans.sizeDelta.x - 2 * _spacing.x;
                //ori_size.y = _SubList.Spacing.y * Mathf.Floor(rows + 1) + _SubList.CellRect.sizeDelta.y * rows + vb.w + vb.y;
                //SubViewTemplate.sizeDelta = ori_size;

                //_SubList.ScrollToStep(SubSelected);

                GUISound.PlaySoundClip(GUISound.PlayType.RollDown);
            }
            else
            {
                SubViewTemplate.sizeDelta = new Vector2(SubViewTemplate.sizeDelta.x, 0);
            }

            if (needRepos)
            {
                RepositionItems();

                //fix position after sub list changing, MainSelected will remain in the same place
                float y_newPos = CalcPosY(MainSelected);
                ScrollToPosition(_Content.anchoredPosition.y + y_oldPos - y_newPos);
            }
        }
    }