SHARE
TWEET

Untitled

a guest Aug 20th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class gsFlashLightExplosion : MonoBehaviour
  2.      
  3. [SerializeField] int LightEndRange;
  4.  
  5. [SerializeField] float LightStartIntensity;
  6.  
  7. [SerializeField] float LightEndIntensity;
  8.  
  9. [SerializeField] float Speed;
  10.  
  11. private bool blnRun=true;
  12.  
  13. private Light light;
  14.  
  15. // Start is called before the first frame update
  16. void Start()
  17. {
  18.     light=GetComponent<Light>();
  19.     light.range = LightStartRange;
  20.     light.intensity = LightStartIntensity;
  21. }
  22.  
  23. // Update is called once per frame
  24. void Update()
  25. {
  26.  
  27.     if(LightEndRange>light.range)
  28.         light.range = (int)(light.range + (light.range * Speed / 100));
  29.     else
  30.         light.range = (int)(light.range - (light.range * Speed / 100));
  31.  
  32.     if (LightEndIntensity > light.intensity)
  33.         light.intensity = light.intensity + (light.intensity * Speed / 100);
  34.     else
  35.         light.intensity = light.intensity - (light.intensity * Speed / 100);
  36.  
  37.  
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top