Esempio n. 1
0
 private void DisableCamera()
 {
     if (null != m_camera)
     {
         UIModelWrapCameraPool.RecycleCamera(m_camera);
     }
     m_camera = null;
 }
Esempio n. 2
0
        private void EnableCamera()
        {
            if (!IsValid())
            {
                DisableCamera();
                return;
            }

            if (null == m_camera)
            {
                m_camera = UIModelWrapCameraPool.GetCamera(this.GetInstanceID());
            }

            SetCameraParams();
            Render();
        }
Esempio n. 3
0
        protected void Render()
        {
            if (!IsValid())
            {
                return;
            }

            if (!isLoop)
            {
                if (null == m_camera)
                {
                    m_camera = UIModelWrapCameraPool.GetCamera(this.GetInstanceID());
                }
            }

            if (null != tempRt)
            {
                RenderTexture.ReleaseTemporary(tempRt);
            }
            var imgeSize = this.rectTransform.sizeDelta;

            tempRt = RenderTexture.GetTemporary((int)imgeSize.x * 2, (int)imgeSize.y * 2, 24, format);             //*2保证质量
            m_camera.targetTexture = tempRt;
            m_camera.Render();
            if (null != material && material != defaultMaterial)
            {
                material.mainTexture = tempRt;
            }
            else
            {
                texture = tempRt;
            }

            if (!isLoop)
            {
                DisableCamera();
            }

            //TODO.刷新
            SetMaterialDirty();
        }
Esempio n. 4
0
 private void DestroyCamera()
 {
     UIModelWrapCameraPool.Resize();
     m_camera = null;
 }