/// --------------------------------------------- /// Ultimate Character Controller /// Copyright (c) Opsive. All Rights Reserved. /// https://www.opsive.com /// --------------------------------------------- namespace Opsive.UltimateCharacterController.Demo { using UnityEngine; /// /// The scene will run slowly if the lightmaps aren't baked with the lights active. If the lightmaps are not baked then disable the lights /// so the scene will run at a normal speed. /// public class LightmapChecker : MonoBehaviour { /// /// Determine if there are any lightmaps. /// private void Start() { if (LightmapSettings.lightmaps == null || LightmapSettings.lightmaps.Length == 0) { var lights = GetComponentsInChildren(); for (int i = 0; i < lights.Length; ++i) { if (lights[i].type != LightType.Directional) { lights[i].gameObject.SetActive(false); } } } else { Destroy(this); } } } }