public Material GetMaterial() { if (material == null || material.Get() == null) { switch (cameraSettings.renderShader) { case CameraSettings.RenderShader.MultiplyHDR: material = LightingMaterial.Load("Light2D/Internal/Multiply HDR"); break; case CameraSettings.RenderShader.Multiply: material = LightingMaterial.Load("Light2D/Internal/Multiply"); break; case CameraSettings.RenderShader.Additive: material = LightingMaterial.Load(Max2D.shaderPath + "Particles/Additive"); break; case CameraSettings.RenderShader.Custom: material = LightingMaterial.Load(cameraSettings.GetMaterial()); break; } } material.SetTexture(renderTexture.renderTexture); return(material.Get()); }