using System.Collections; using System.Collections.Generic; using UnityEngine; public class Smoke : MonoBehaviour { // Start is called before the first frame update void Start() { StartCoroutine(changeSmokeColor()); } // Update is called once per frame void Update() { } IEnumerator changeSmokeColor() { while (true) { var main = GetComponent().main; main.startColor = RenderSettings.fogColor; yield return new WaitForSeconds(2.0f); } } }