using System.Collections; using System.Collections.Generic; using System.Threading.Tasks; using UnityEngine; public class Allother : MonoBehaviour { public List 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(); } } }