unity协同程序带参数并延迟执行_逐·風的博客
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DaiCanShu : MonoBehaviour
{
void Start()
{
StartCoroutine(CanShu(2f));
}
IEnumerator CanShu(float arr)
{
yield return new WaitForSeconds(arr);
Debug.Log("xxx");
}
}
挂载在物体上变回实现延迟2秒输出xxx。

登录后可发表评论
点击登录