public void OnUpdate() { if (!isactive) { return; } else { float dt = FrameController.DT() * pulseRate; if (fadeOut) { currAtt -= dt; compLight.SetAtt(currAtt); if (currAtt < endAtt) { fadeOut = false; } } else { currAtt += dt; compLight.SetAtt(currAtt); if (currAtt > startAtt) { fadeOut = true; } } } }
public void OnUpdate() { if (activated) { timer += FrameController.DT() * _frequency; light.SetAtt(((float)Math.Sin(timer) + 1.0f) * _amplitude); } }
public void OnUpdate() { if (!activated || finished) { return; } // if (timer > 0.0f) { timer -= FrameController.DT(); //break; } else { lightScript.activated = false; light.setEnabled(true); light.SetAtt(0.03f); scaryRender.setEnabled(false); finished = false; } //light.setEnabled(false); }
public void OnStart() { compLight = gameObject.RequireComponent <CLight>(); compLight.SetAtt(startAtt); currAtt = startAtt; }