29 lines
564 B
C#
29 lines
564 B
C#
|
|
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<ParticleSystem>().main;
|
|||
|
|
main.startColor = RenderSettings.fogColor;
|
|||
|
|
yield return new WaitForSeconds(2.0f);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|