36 lines
763 B
C#
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();
|
|
|
|
}
|
|
}
|
|
}
|