LightRangeChanger.cs 505 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using CIS;
  3. using UnityEngine;
  4. public class LightRangeChanger : MonoBehaviour
  5. {
  6. private void Awake()
  7. {
  8. this.myLight = base.GetComponent<Light>();
  9. }
  10. private void Update()
  11. {
  12. this.timer += SingletonMonoBehaviourClass<TimeMgr>.instance.deltaTime * this.speed;
  13. this.myLight.range = this.min + Mathf.PingPong(this.timer, this.max - this.min);
  14. }
  15. public float speed;
  16. public float max;
  17. public float min;
  18. private float timer;
  19. private Light myLight;
  20. }