Skip to content

Instantly share code, notes, and snippets.

@ronyx69
Created March 21, 2018 13:59
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Changes the times when a prop is illuminated.
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo;
var off = 15.0f; // amount of hours the light is turned off during the day (15 max) (0 means always on)
var random = 0.3f; // adds randomness to time lights turn on/off, if 0 then all lights turn on/off at the same time
asset.m_illuminationOffRange.x = 6*Convert.ToSingle(Math.Pow(Convert.ToDouble((6-off/2.5)/6), Convert.ToDouble(1/1.09)));
asset.m_illuminationOffRange.y = Mathf.Clamp(6*Convert.ToSingle(Math.Pow(Convert.ToDouble((6-off/2.5)/6), Convert.ToDouble(1/1.09)))-random, 0, 6);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment