public virtual void Release() { if (Albedo != null) { Albedo.Release(); Albedo = null; } if (Height != null) { Height.Release(); Height = null; } if (Normal != null) { Normal.Release(); Normal = null; } if (Metallic != null) { Metallic.Release(); Metallic = null; } if (Roughness != null) { Roughness.Release(); Roughness = null; } if (Occlusion != null) { Occlusion.Release(); Occlusion = null; } if (Thickness != null) { Thickness.Release(); Thickness = null; } if (Emission != null) { Emission.Release(); Emission = null; } }
public virtual void Release() { if (UI3DPreview.Instance != null) { var prev = UI3DPreview.Instance; if (Albedo != null && Albedo != prev.defaultBlack && Albedo != prev.defaultDarkGray && Albedo != prev.defaultGray && Albedo != prev.defaultWhite) { Albedo.Release(); Albedo = null; } if (Height != null && Height != prev.defaultBlack && Height != prev.defaultDarkGray && Height != prev.defaultGray && Height != prev.defaultWhite) { Height.Release(); Height = null; } if (Normal != null && Normal != prev.defaultBlack && Normal != prev.defaultDarkGray && Normal != prev.defaultGray && Normal != prev.defaultWhite) { Normal.Release(); Normal = null; } if (Metallic != null && Metallic != prev.defaultBlack && Metallic != prev.defaultDarkGray && Metallic != prev.defaultGray && Metallic != prev.defaultWhite) { Metallic.Release(); Metallic = null; } if (Roughness != null && Roughness != prev.defaultBlack && Roughness != prev.defaultDarkGray && Roughness != prev.defaultGray && Roughness != prev.defaultWhite) { Roughness.Release(); Roughness = null; } if (Occlusion != null && Occlusion != prev.defaultBlack && Occlusion != prev.defaultDarkGray && Occlusion != prev.defaultGray && Occlusion != prev.defaultWhite) { Occlusion.Release(); Occlusion = null; } } else { if (Albedo != null) { Albedo.Release(); Albedo = null; } if (Height != null) { Height.Release(); Height = null; } if (Normal != null) { Normal.Release(); Normal = null; } if (Metallic != null) { Metallic.Release(); Metallic = null; } if (Roughness != null) { Roughness.Release(); Roughness = null; } if (Occlusion != null) { Occlusion.Release(); Occlusion = null; } } }