3个卡片第一张位置0,间隔0.2s 置第二张位置 100,间隔0.2s,第三张位置 200;不用协程

来源:互联网 发布:室内精确定位算法研究 编辑:程序博客网 时间:2024/04/27 22:13
public GameObject prefab;
public bool isCreat;
public float time = 0.2f;
public int count = 3;

void Update()
{

time -= Time.deltaTime;

if (count>0) {

if (time < 0)
{
time = 0.2f;
GameObject go = Instantiate(prefab) as GameObject;
go.transform.localPosition = new Vector3((3-count) * 100, 0, 0);
}
count--;
}

}
0 0
原创粉丝点击