using UnityEngine; using System.Collections; using System; using System.Collections.Generic; using System.IO; public class GetVersionInfoTask : LaunchTask { public override float expectTime { get { return LocalSave.GetFloat("GetVersionInfoTask_ExpectTime", 1f); } protected set { LocalSave.SetFloat("GetVersionInfoTask_ExpectTime", value); } } public override void Begin() { LaunchInHot.m_CurrentStage = LaunchStage.ClientVersion; duration = Mathf.Max(0.5f, expectTime); if (Application.isEditor) { if (InGameDownTestUtility.enable) { VersionUtility.Instance.RequestVersionCheck(); done = false; progress = 0f; } else { done = true; } } else { if (!VersionUtility.Instance.InIosAuditTime()) { VersionUtility.Instance.RequestVersionCheck(); done = false; progress = 0f; } else { done = true; } } } public override void End() { expectTime = timer; Debug.LogFormat("{0}执行时长:{1};", this.GetType().Name, timer); } public override void Update() { if (done) { return; } timer += Time.deltaTime; if (!VersionUtility.Instance.completed) { done = false; progress = timer / expectTime; } else { done = true; } ExceptionReport(); } }