FTME01_ScaleLight.cs 477 B

1234567891011121314151617181920212223
  1. using UnityEngine;
  2. using System.Collections;
  3. public class FTME01_ScaleLight : MonoBehaviour {
  4. Light myLight;
  5. float origLightScale;
  6. public float scaleLightRangeSize = 1f;
  7. public void ScaleLightRangeOnEnable () {
  8. myLight = GetComponent<Light>();
  9. origLightScale = myLight.range;
  10. }
  11. public void ScaleLightRangeOnDisable () {
  12. myLight.range = origLightScale;
  13. }
  14. public void ScaleLightRange () {
  15. myLight.range = origLightScale * scaleLightRangeSize;
  16. }
  17. }