// Use this for initialization void Start() { handle = transform.Find("Scrollbar/Sliding Area/Handle") as RectTransform; handleMessage = transform.Find("Scrollbar/Text").GetComponent <Text>(); parentSize = (handle.parent.parent as RectTransform).sizeDelta; //开启自更新 downLoadModel = AssetBundleDownloadManager.Instance.StarUpdateAssetBundle(); }
// Update is called once per frame void Update() { if (downLoadModel != null) { handleMessage.text = downLoadModel.taskMessage; if (downLoadModel.taskState != TaskState.None) { handleSize.x = parentSize.x * downLoadModel.Schedule; handle.sizeDelta = handleSize; } if (downLoadModel.taskState == TaskState.TaskOk) { DebugManager.LogWarning("ab 下载完成!卸载ab下载器!"); AssetBundleDownloadManager.Instance.ExitUpdateAssetBundle(); Invoke("LoadMainGame", 2f); downLoadModel = null; } } }