先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
using UnityEngine;
|
|
using System.Collections;
|
|
using System;
|
|
using System.Threading;
|
|
|
|
namespace ThinkingSDK.PC.Time
|
|
{
|
|
public class TDTimeout : MonoBehaviour
|
|
{
|
|
// Use this for initialization
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public static void SetTimeout(int timeout, Action<object> action, object obj)
|
|
{
|
|
GameObject gameObject = new GameObject("TDTimeout");
|
|
var tdTimeout = gameObject.AddComponent<TDTimeout>();
|
|
tdTimeout._setTimeout(timeout, action, obj);
|
|
}
|
|
|
|
private void _setTimeout(int timeout, Action<object> action, object obj)
|
|
{
|
|
StartCoroutine(_wait(timeout, action, obj));
|
|
}
|
|
|
|
private IEnumerator _wait(int timeout, Action<object> action, object obj)
|
|
{
|
|
yield return new WaitForSeconds(timeout);
|
|
if (action != null)
|
|
{
|
|
action(obj);
|
|
}
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|