Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class FireController : MonoBehaviour {
  6. public static bool fireburning,fireglowing;
  7. static float burntime = 100;
  8.  
  9.  
  10.  
  11. // Use this for initialization
  12. void Awake()
  13. {
  14. Debug.Log(fireburning);
  15. }
  16.  
  17. void Update()
  18. {
  19. StartCoroutine("FireStarter");
  20. }
  21.  
  22. IEnumerator FireStarter()
  23. {
  24. if (fireburning)
  25. {
  26. burntime -= Time.deltaTime;
  27. if (burntime <= 0)
  28. {
  29. burntime = 100;
  30. fireburning = false;
  31. fireglowing = true;
  32. }
  33. }
  34. else{
  35. yield return null;
  36. } }
  37.  
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement