LightFlash.as 420 B

123456789101112131415161718
  1. #include "Scripts/NinjaSnowWar/GameObject.as"
  2. class LightFlash : GameObject
  3. {
  4. LightFlash()
  5. {
  6. duration = 2.0;
  7. }
  8. void FixedUpdate(float timeStep)
  9. {
  10. Light@ light = node.GetComponent("Light");
  11. light.brightness = light.brightness * Max(1.0 - timeStep * 10.0, 0.0);
  12. // Call superclass to handle lifetime
  13. GameObject::FixedUpdate(timeStep);
  14. }
  15. }