_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Battle_Royale/Allother.cs
2024-11-19 17:55:35 +08:00

36 lines
763 B
C#

using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
public class Allother : MonoBehaviour
{
public List<otherWoniu> otherWonius;
// Start is called before the first frame update
void Start()
{
//ControWoniuToMove();
//StartCoroutine(WoniuToMove());
}
public IEnumerator WoniuToMove()
{
foreach (otherWoniu item in otherWonius)
{
yield return new WaitForSeconds(0.5f);
item.OtherWoniuMove();
}
}
public async void ControWoniuToMove()
{
foreach (otherWoniu item in otherWonius)
{
await Task.Delay(1000);
item.OtherWoniuMove();
}
}
}