private void EnableCamera() { if (!IsValid()) { DisableCamera(); return; } if (null == m_camera) { m_camera = UIModelWrapCameraPool.GetCamera(this.GetInstanceID()); } SetCameraParams(); Render(); }
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(); }