Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class FireController : MonoBehaviour {
- public static bool fireburning,fireglowing;
- static float burntime = 100;
- // Use this for initialization
- void Awake()
- {
- Debug.Log(fireburning);
- }
- void Update()
- {
- StartCoroutine("FireStarter");
- }
- IEnumerator FireStarter()
- {
- if (fireburning)
- {
- burntime -= Time.deltaTime;
- if (burntime <= 0)
- {
- burntime = 100;
- fireburning = false;
- fireglowing = true;
- }
- }
- else{
- yield return null;
- } }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement