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

56 lines
1.3 KiB
C#

using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
public class Allother : MonoBehaviour
{
public List<otherWoniu> otherWonius=new List<otherWoniu>();
public List<HouseBtn> House;//蜗牛进入的父物体
public GameObject OtherWoniuPre;//其他蜗牛预制体
// Start is called before the first frame update
void Start()
{
//ControWoniuToMove();
//StartCoroutine(WoniuToMove());
}
//public IEnumerator WoniuToMove()
//{
// CreateWoniu();//创建蜗牛
//}
//public async void ControWoniuToMove()
// {
// foreach (otherWoniu item in otherWonius)
// {
// await Task.Delay(1000);
// item.OtherWoniuMove();
// }
// }
//蜗牛全部刷新到笼子里面
public void RefrashAllWoniu()
{
}
public void CreateWoniu()
{
foreach (HouseBtn house in House)
{
for (int i = 0; i < house.roomUserNo; i++)
{
GameObject ot=Instantiate(OtherWoniuPre, transform);
otherWonius.Add(ot.GetComponent<otherWoniu>());
ot.GetComponent<otherWoniu>().OtherWoniuMove(house.roomNo);//进房间
}
}
}
}