23 lines
691 B
C#
23 lines
691 B
C#
|
using System.Collections;
|
||
|
using UnityEngine;
|
||
|
|
||
|
// ReSharper disable once CheckNamespace
|
||
|
namespace BlueWaterProject
|
||
|
{
|
||
|
public class BoidsManager : Singleton<BoidsManager>
|
||
|
{
|
||
|
public void RespawnBoids(Boids boids, float delay, Vector3 respawnPos)
|
||
|
{
|
||
|
StartCoroutine(RespawnBoidsCoroutine(boids, delay, respawnPos));
|
||
|
}
|
||
|
|
||
|
private IEnumerator RespawnBoidsCoroutine(Boids boids, float delay, Vector3 respawnPos)
|
||
|
{
|
||
|
yield return new WaitForSeconds(delay);
|
||
|
|
||
|
boids.BoundMeshRenderer.transform.position = respawnPos;
|
||
|
boids.gameObject.SetActive(true);
|
||
|
boids.CreateBoids();
|
||
|
}
|
||
|
}
|
||
|
}
|