Example #1
0
 private static void Prefix(InteriorLightingManager __instance, ref float timeOfDayIntensity, bool followTod)
 {
     if (!GameManager.m_IsPaused && AmbientLights.config != null && AmbientLights.config.ready && GameLights.gameLightsReady)
     {
         timeOfDayIntensity *= AmbientLights.currentLightSet.lightshaftStr;
     }
 }
Example #2
0
 private static void Postfix(InteriorLightingManager __instance)
 {
     if (!GameManager.m_IsPaused && AmbientLights.config != null && AmbientLights.config.ready && GameLights.gameLightsReady)
     {
         //AmbientLights.UpdateGameLights();
         GameLights.UpdateLights();
     }
 }
Example #3
0
 private static void Postfix(InteriorLightingManager __instance)
 {
     if (GameLights.mngr != null)
     {
         GameLights.mngr = __instance;
         GameLights.AddGameLights();
     }
 }
Example #4
0
            private static void Postfix(InteriorLightingManager __instance)
            {
                List <string> logger = new List <string>();

                Color[] colors = new Color[20];
                colors[0]  = new Color(1f, 0, 0);
                colors[1]  = new Color(0, 1f, 0);
                colors[2]  = new Color(0, 0, 1f);
                colors[3]  = new Color(1f, 1f, 0);
                colors[4]  = new Color(1f, 0, 1f);
                colors[5]  = new Color(0, 1f, 1f);
                colors[6]  = new Color(1f, 1f, 1f);
                colors[7]  = new Color(0, 0, 0);
                colors[8]  = new Color(0.5f, 0, 0);
                colors[9]  = new Color(0, 0.5f, 0);
                colors[10] = new Color(0, 0, 0.5f);
                colors[11] = new Color(0.5f, 0.5f, 0);
                colors[12] = new Color(0.5f, 0, 0.5f);
                colors[13] = new Color(0, 0.5f, 0.5f);
                colors[14] = new Color(0.5f, 0.5f, 0.5f);
                colors[15] = new Color(1f, 0.5f, 0);
                colors[16] = new Color(1f, 0, 0.5f);
                colors[17] = new Color(0, 1f, 0.5f);
                colors[18] = new Color(0.5f, 1f, 0);
                colors[19] = new Color(1f, 0.5f, 0.5f);
                int color_index = 0;

                List <InteriorLightingGroup> lightGroups = __instance.m_LightGroupList;

                foreach (InteriorLightingGroup group in lightGroups)
                {
                    Color new_color = colors[color_index];

                    logger.Add("GROUP: " + group.gameObject.name + " - " + new_color.ToString());

                    List <Light> lights = group.GetLights();

                    foreach (Light light in lights)
                    {
                        logger.Add("{" + "|" + string.Format("\"description\": \"{0}\",", light.gameObject.name) + "|" + string.Format("\"position\": \"{0}\",", light.gameObject.transform.position.ToString()) + "|" + "\"orientation\":\"\"," + "|" + "\"size\": 1," + "|" + "\"cover\": 0" + "|" + "},");
                    }

                    color_index++;
                    if (color_index >= colors.Length)
                    {
                        color_index = 0;
                    }
                }

                //Debug.Log(Utils.SerializeObject(logger));
            }