Skip to content

Instantly share code, notes, and snippets.

@ronyx69
Created March 21, 2018 13:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ronyx69/bfa8940c8d68f99b8826c88af51a39b7 to your computer and use it in GitHub Desktop.
Save ronyx69/bfa8940c8d68f99b8826c88af51a39b7 to your computer and use it in GitHub Desktop.
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