using UnityEngine; public abstract class LaunchTask { public float timer { get; protected set; } public float duration { get; protected set; } bool exceptionReported = false; public bool done { get; protected set; } public float progress { get; protected set; } public virtual float expectTime { get; protected set; } protected float outTime = 15f; public abstract void Begin(); public abstract void Update(); public abstract void End(); public void ExceptionReport() { if (!exceptionReported && timer > outTime && !done) { var content = string.Format("任务:{0};网络状态:{1}", this.GetType().Name, Application.internetReachability); exceptionReported = true; } } }