Esempio n. 1
0
        public void MoveBox(Vector3 vecBox)
        {
            //立即显示背景
            ShowBg();
            BoxFly pBox = new BoxFly();

            pBox.Init(vecBox, m_Obj_Chest.gameObject.transform.GetChild(0).GetChild(1).GetChild(0).GetChild(0).GetChild(0).position, m_objEff1);  //0.1下第0个item目录
            m_FlyBoxs.Add(pBox);
        }
Esempio n. 2
0
        public bool Update(float dTime)
        {
            m_fWndHide += dTime;
            m_BoxShow.Update(dTime);

            for (byte i = 0; i < m_FlyBoxs.Count;)
            {
                BoxFly pBox = m_FlyBoxs[i];
                if (!pBox.Update(dTime))
                {
                    if (m_byStoreBoxs == 0)                                                                                               //the first one
                    {
                        m_BoxShow.Show(false, pBox.m_goEffect1, m_objEff1, m_Obj_Chest.gameObject.transform.GetChild(0).GetChild(1), 0f); //延迟,先出背景
                        pBox.m_goEffect1 = null;
                    }
                    else//nothing
                    {
                    }
                    m_byStoreBoxs++;
                    SetBoxCount();
                    pBox.Destroy();
                    Utility.ListRemoveAt(m_FlyBoxs, i);
                    continue;
                }
                else
                {
                    i++;
                }
            }

            if (m_fMessageDelay > 0f)
            {
                m_fMessageDelay -= dTime;
            }
            if (m_MessageList.Count > 0 && m_byStoreBoxs > 0 && m_fMessageDelay <= 0f)
            {
                Message pMessage = m_MessageList[0];
                m_MessageList.RemoveAt(0);
                if (pMessage.m_msgtype == MsgType.SHOW)
                {
                    DoShow(pMessage.m_byparam1, pMessage.m_byparam2, pMessage.m_byparam3, false);
                }
                else if (pMessage.m_msgtype == MsgType.OPEN)
                {
                    OnOpenBox(false, pMessage.m_byparam1, pMessage.m_byparam2, pMessage.m_byparam3, false);
                }
                else if (pMessage.m_msgtype == MsgType.HIDE)
                {
                    HideChestWindow(true);
                    m_byStoreBoxs--;
                    SetBoxCount();
                    m_fWndHide = 0f;
                }
            }

            m_fDealTime -= dTime;
            if (m_fDealTime >= 0)
            {
                m_LabelTime.text = ((int)m_fDealTime).ToString() + '秒';
            }
            return(true);
        }