Esempio n. 1
0
        private void OnClick(int index)
        {
            if (!this.m_startComplete)
            {
                return;
            }
            Vector3 startPos = m_startPos - Vector3.right * (m_grid_con.X - m_img_Width / 2f);
            Vector3 endPos   = m_endPos - Vector3.right * (m_grid_con.X + m_img_Width / 2f);

            CheckGameView();
            SetChooseEndIndex(m_startIndex, index, endPos);
            if (index < m_activity_data.Count - 1)
            {
                SetChooseEndIndex(index + 1, m_endIndex + 1, startPos);
            }

            Vector3 centerPos = startPos;     //(startPos + endPos) / 2f + Vector3.right * m_img_Width / 2f;

            centerPos.x = m_screenWidth / 2f; // - m_img_Width / 2f;
            coms[index].SetEndPos(centerPos, -1);
            coms[index].SetChooseState(true);
            m_uiType = ActivityUIType.Choose;
            if (m_startIndex != index)
            {
                coms[m_startIndex].PlayTween();
            }
            if (index + 1 < coms.Count)
            {
                coms[index + 1].PlayTween();
            }
            coms[index].SetDuration(m_chooseQuitTime);
            coms[index].PlayTween();
            //coms[index].PlayTween();
        }
Esempio n. 2
0
        private void OnClose(GameObject obj)
        {
            if (!this.m_startComplete)
            {
                return;
            }
            EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.activity_open.ToString());

            m_uiType = ActivityUIType.Quit;
            if (coms.Count == 0)
            {
                EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_ACTIVITY);
            }
            else
            {
                CheckGameView();
                Vector3 endPos = new Vector3(m_endPos.x - m_grid_con.X, m_endPos.y, m_endPos.z);
                for (int i = 0; i < coms.Count; i++)
                {
                    coms[i].SetEndPos(endPos);
                }
                if (coms.Count > 0)
                {
                    coms[m_startIndex].PlayTween();
                }
            }
        }
Esempio n. 3
0
        public override void OnHide()
        {
            base.OnHide();
            this.m_startComplete = false;
            GameEvents.UIEvents.UI_Activity_Event.OnTweenFinish  -= OnTweenFinish;
            GameEvents.UIEvents.UI_Activity_Event.OnChooseFinish -= OnChooseFinish;
            GameEvents.UIEvents.UI_Activity_Event.OnClick        -= OnClick;
            DragEventTriggerListener.Get(m_scroll_view.gameObject).onDragStart -= OnDragStart;

            MessageHandler.UnRegisterMessageHandler(MessageDefine.SCActivityBaseListResponse, OnResponse);
            m_close_btn.RemoveClickCallBack(OnClose);
            m_uiType     = ActivityUIType.None;
            m_startIndex = 0;
            m_endIndex   = 0;
            m_activity_data.Clear();
        }
Esempio n. 4
0
        private void OnResponse(object obj)
        {
            if (obj is SCActivityBaseListResponse)
            {
                EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.activity_open.ToString());

                SCActivityBaseListResponse res = obj as SCActivityBaseListResponse;
                for (int i = 0; i < res.BaseInfos.Count; i++)
                {
                    m_activity_data.Add(res.BaseInfos[i]);
                }
                GetInitLastIndex();
                OnInitPanel();
                m_uiType = ActivityUIType.Start;
                if (coms.Count > 0)
                {
                    coms[0].PlayTween();
                }
            }
        }