You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
669 B
29 lines
669 B
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
|
|
public class FireFlow : MonoBehaviour |
|
{ |
|
private void Start() |
|
{ |
|
transform.localScale = Vector3.zero; |
|
} |
|
/// <summary> |
|
/// 是否开始火蔓延 |
|
/// </summary> |
|
//[HideInInspector] |
|
public bool fireFlow; |
|
/// <summary> |
|
/// 火蔓延速度 |
|
/// </summary> |
|
//[HideInInspector] |
|
public float flowSpeed = 2; |
|
private float value = 0; |
|
void Update () { |
|
if (fireFlow && value < 1) |
|
{ |
|
value += Time.deltaTime * flowSpeed / 10; |
|
transform.localScale = new Vector3(value, value, value); |
|
} |
|
} |
|
}
|
|
|