You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
684 B
C#
23 lines
684 B
C#
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
namespace CleverCrow.Fluid.BTs.Examples {
|
|
public class SpawnSpeedPowerup : MonoBehaviour {
|
|
public GameObject speedBoostPrefab;
|
|
|
|
void Start () {
|
|
StartCoroutine(SpawnPowerup());
|
|
}
|
|
|
|
IEnumerator SpawnPowerup () {
|
|
while (true) {
|
|
yield return new WaitForSeconds(Random.Range(3, 20));
|
|
|
|
if (FlagManager.current.speedBoost == null) {
|
|
FlagManager.current.speedBoost = Instantiate(
|
|
speedBoostPrefab, transform.position, Quaternion.identity, transform);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |