When you enable this property, Unity includes the target Mesh Renderer in global illumination calculations. These calculations take place while precomputing lighting data at bake time. The ContributeGI property exposes the ReceiveGI property. The ContributeGI property only takes effect if you enable a global illumination setting such as Baked Global Illumination or Realtime Global Illumination for the target Scene. A Unity Blog post about static lighting with Light Probes provides guidance for using this flag. For additional context, see this tutorial for setting up the Built-in Render Pipeline and lighting in Unity.
void StaticEditorFlagsExample() { // Create a GameObject var go = new GameObject("Example");
// Set the GameObject's StaticEditorFlags var flags = StaticEditorFlags.ContributeGI; GameObjectUtility.SetStaticEditorFlags(go, flags); }
Did you find this page useful? Please give it a rating: