UnityEditor.PreviewRenderUtility.Cleanup C# (CSharp) Method

Cleanup() public method

public Cleanup ( ) : void
return void
        public void Cleanup()
        {
            if (this.m_Camera != null)
            {
                Object.DestroyImmediate(this.m_Camera.gameObject, true);
            }
            if (this.m_RenderTexture != null)
            {
                Object.DestroyImmediate(this.m_RenderTexture);
                this.m_RenderTexture = null;
            }
            foreach (Light light in this.m_Light)
            {
                if (light != null)
                {
                    Object.DestroyImmediate(light.gameObject, true);
                }
            }
        }

Usage Example

示例#1
0
 public void Dispose()
 {
     if (m_Disposed)
     {
         return;
     }
     renderUtility.Cleanup();
     UnityObject.DestroyImmediate(gameObject);
     gameObject = null;
     m_Disposed = true;
 }
All Usage Examples Of UnityEditor.PreviewRenderUtility::Cleanup