Ejemplo n.º 1
0
    /// <summary>
    /// 一般更新
    /// </summary>
    private static void NormalUpdate()
    {
        InvalidList.Clear();
        if (null != m_BloodMap)
        {
            foreach (GfxBlood var in m_BloodMap.Values)
            {
                GfxBlood gba = var;
                U3D_Render.EntityView view = EntityFactory.getEntityViewByID(gba.ID);
                if (view == null)
                {
                    InvalidList.Enqueue(gba);
                    continue;
                }
                if (!gba.Entry)
                {
                    InvalidList.Enqueue(gba);
                    continue;
                }

                if (!gba.Entry.activeSelf || !view.StateMachine.GetVisible())//实体没有被激活或者不可见
                {
                    if (gba.GetEnable())
                    {
                        gba.SetEnable(false);
                    }
                }
                else//正常的实体
                {
                    if (!gba.GetEnable())
                    {
                        gba.SetEnable(true);
                    }
                    gba.OnUpdate();
                }
            }
        }


        while (InvalidList.Count > 0)
        {
            //移除无效的Blood节点
            GfxBlood b = InvalidList.Dequeue();
            if (OptimitzedControlPlane.Instance.EnityCreateOptimize)
            {
                CacheBlood(b);
            }
            else
            {
                GfxBloodManager.Destroy(b);
            }
        }
        InvalidList.Clear();
    }
Ejemplo n.º 2
0
    override public void OnDestroy()
    {
        GfxBloodManager.DestroyALL();
        if (m_RenderTexture != null)
        {
            Destroy(m_RenderTexture);
        }
        m_Instance = null;

        base.OnDestroy();
    }