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。