_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Battle_Royale/Allother.cs

36 lines
760 B
C#
Raw Normal View History

2024-11-18 16:53:39 +08:00
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(1);
item.OtherWoniuMove();
}
}
public async void ControWoniuToMove()
{
foreach (otherWoniu item in otherWonius)
{
await Task.Delay(1000);
item.OtherWoniuMove();
}
}
}