I am currently working on a project that deals with in-game time. I have 3D models of buildings and am using a “glow” type texture/mesh to make the windows on them appear “lighted”. I have a bit of code here:
var lightGlow : MeshRenderer;
function Update(){
var seconds : int = Time.time;
if(seconds < 5)
renderer.enabled = true;
else if(seconds > 5)
renderer.enabled = false;
if(seconds > 8)
renderer.enabled = true;
else if(seconds > 10)
renderer.enabled = false;
Debug.Log(seconds);}
I am trying to figure out how to make the seconds start over again after “x” amount, so that the lightglow variable is able to repeat continuously. I know there has to be a simple solution, but I’ve googled myself (almost) to death, and I’ve only been writing my own scripts for a little over a month now. Any help/tips would be greatly appreciated.