示例#1
0
        /// <summary>
        /// Called whenever a new light source attempts to create a singularity.
        /// By default, light sources are created as <see cref="LightSingularityExternal"/> which can be merged into <see cref="LightSingularity"/> to reduce performance impact of realtime lights.
        /// This mod prevents this step and creates a singularity for each external, meaning one <see cref="Light"/> for each lantern or modded light source.
        /// </summary>
        /// <param name="_lightSource">The light source searching trying to merge.</param>
        /// <returns>False to make sure the rest of the vanilla merge method is not executed.</returns>
        private bool OnLightSourceSpawn(LightSingularityExternal _lightSource)
        {
            if (Get == null)
            {
                return(true);             //mod is being unloaded
            }
            //create single singularity for each light
            var sManager = ComponentManager <LightSingularityManager> .Value;

            if (!_lightSource.MorphedLightSingularity)
            {
                sManager.CreateNewSingularityFromMultiple(new[] { _lightSource.gameObject });
            }
            return(false);
        }
示例#2
0
 private static bool LightSingularityExternal_ChooseWhichLightToBecome(LightSingularityExternal __instance) => Get.OnLightSourceSpawn(__instance);
示例#3
0
 private static bool LightSingularityExternal_UpdateLightConnectivity(LightSingularityExternal __instance) => false;