示例#1
0
        private void UpdateAllDots()
        {
            int nearestItemIndex = this.mLoopListView.CurSnapNearestItemIndex;

            if (nearestItemIndex < 0 || nearestItemIndex >= this.mPageCount)
            {
                return;
            }
            int count = this.mDotElemList.Count;

            if (nearestItemIndex >= count)
            {
                return;
            }
            for (int index = 0; index < count; ++index)
            {
                DotElem mDotElem = this.mDotElemList[index];
                if (index != nearestItemIndex)
                {
                    mDotElem.mDotSmall.SetActive(true);
                    mDotElem.mDotBig.SetActive(false);
                }
                else
                {
                    mDotElem.mDotSmall.SetActive(false);
                    mDotElem.mDotBig.SetActive(true);
                }
            }
        }
示例#2
0
        void UpdateAllDots()
        {
            int curNearestItemIndex = mLoopListView.CurSnapNearestItemIndex;

            if (curNearestItemIndex < 0 || curNearestItemIndex >= mPageCount)
            {
                return;
            }
            int count = mDotElemList.Count;

            if (curNearestItemIndex >= count)
            {
                return;
            }
            for (int i = 0; i < count; ++i)
            {
                DotElem elem = mDotElemList[i];
                if (i != curNearestItemIndex)
                {
                    elem.mDotSmall.SetActive(true);
                    elem.mDotBig.SetActive(false);
                }
                else
                {
                    elem.mDotSmall.SetActive(false);
                    elem.mDotBig.SetActive(true);
                }
            }
        }
示例#3
0
        private void InitDots()
        {
            int childCount = this.mDotsRootObj.get_childCount();

            for (int index1 = 0; index1 < childCount; ++index1)
            {
                Transform child   = this.mDotsRootObj.GetChild(index1);
                DotElem   dotElem = new DotElem();
                dotElem.mDotElemRoot = ((Component)child).get_gameObject();
                dotElem.mDotSmall    = ((Component)child.Find("dotSmall")).get_gameObject();
                dotElem.mDotBig      = ((Component)child.Find("dotBig")).get_gameObject();
                ClickEventListener clickEventListener = ClickEventListener.Get(dotElem.mDotElemRoot);
                int index = index1;
                clickEventListener.SetClickEventHandler((Action <GameObject>)(obj => this.OnDotClicked(index)));
                this.mDotElemList.Add(dotElem);
            }
        }
示例#4
0
        void InitDots()
        {
            int childCount = mDotsRootObj.childCount;

            for (int i = 0; i < childCount; ++i)
            {
                Transform tf   = mDotsRootObj.GetChild(i);
                DotElem   elem = new DotElem();
                elem.mDotElemRoot = tf.gameObject;
                elem.mDotSmall    = tf.Find("dotSmall").gameObject;
                elem.mDotBig      = tf.Find("dotBig").gameObject;
                ClickEventListener listener = ClickEventListener.Get(elem.mDotElemRoot);
                int index = i;
                listener.SetClickEventHandler(delegate(GameObject obj) { OnDotClicked(index); });
                mDotElemList.Add(elem);
            }
        }