Created
July 8, 2019 16:10
-
-
Save davehampson/56ffea653f0b88d64d01d2db23a11fe1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Workaround for 1087657 https://issuetracker.unity3d.com/issues/android-cullallvisiblelights-consume-too-much-cpu-when-only-baked-lights-are-used-in-the-scene | |
Light[] lights = (Light[])GameObject.FindObjectsOfType(typeof(Light)); | |
for (int i = 0; i < lights.Length; i++) | |
{ | |
Light light = lights[i]; | |
if (light.type == LightType.Point || light.type == LightType.Spot) // Assuming all your baked lights are these types | |
light.gameObject.SetActive(false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment