Exemplo n.º 1
0
        public void UpdateLogic(bool bCameraDirty, Vector3 vCameraPos)
        {
            if (m_bHaveNullTitle)
            {
                m_bHaveNullTitle = false;
                m_ValidTitles.ClearNullItem();
            }

            // 更新位置信息
            for (int i = m_ValidTitles.size - 1; i >= 0; --i)
            {
                HUDTitleInfo title = m_ValidTitles[i];
                title.m_nBatcherIndex = i;
                if (title.m_tf != null)
                {
                    title.ApplyMove(bCameraDirty, vCameraPos);
                }
            }

            if (m_bTitleMove)
            {
                m_bTitleMove = false;
                m_nSortVeresion++;
            }

            if (m_bNeedSort || m_nSortVeresion > 10)
            {
                bool bNeedSort    = m_bNeedSort;
                int  nSortVersion = m_nSortVeresion;
                m_bTitleMove    = false;
                m_bNeedSort     = false;
                m_nSortVeresion = 0;
                CompareTitleByDist();
                if (m_bRebuildMesh)
                {
                    //if(m_bStatic)
                    //    Debug.Log("Static Need PrepareRebuild, NeedSort=" + bNeedSort + ", Version=" + nSortVersion);
                    //else
                    //    Debug.Log("Dynamic Need PrepareRebuild, NeedSort=" + bNeedSort + ", Version=" + nSortVersion);
                    m_bRebuildMesh = false;
                    PrepareRebuild();
                }
            }
            for (int i = 0, nSize = m_ValidTitles.size; i < nSize; ++i)
            {
                HUDTitleInfo title = m_ValidTitles[i];
                title.m_nBatcherIndex = i;
                if (!title.m_bNeedHide && !title.m_bInitHUDMesh)
                {
                    InitTitleHUDMesh(title);
                }
            }
            m_MeshRender.FillMesh();
        }
Exemplo n.º 2
0
    public void UpdateLogic()
    {
        if (!mDirty)
        {
            return;
        }
        mDirty = false;

        if (mHaveNullVertex)
        {
            mHaveNullVertex = false;
            m_SpriteVertex.ClearNullItem();
        }
        UpdateMesh();
        OnLoadHudAtlas();
        m_nOldSpriteNumb = m_SpriteVertex.size;
    }