1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using SC;
- namespace SC.Tools.UpdateAPKSystem.UpdateSystem
- {
- public class UpdateSystem : SystemBase {
- public UpdateSystemData UpdateSystemDataSubSystem;
- public UpdateSystemGetData UpdateSystemGetDataSubSystem;
- public ProcessData UpdateSystemProcessDataSubSystem;
- public CanvasUI CanvasUI;
- private static UpdateSystem mInstant;
- public static UpdateSystem getInstant {
- get {
- if (mInstant == null) {
- Debug.Log("[UpdateSystem=====================================]: " + "Instantiate Start");
- mInstant = Instantiate((GameObject)Resources.Load("Prefabs/UpdateSystem")).GetComponent<UpdateSystem>();
- Debug.Log("[" + mInstant.GetType().ToString() + "]: " + "Instantiate Finish:" + mInstant);
- }
-
- return mInstant;
- }
- }
- public void RegisterDownStartCallBack(Action callback) {
- AndroidPluginUpdateAPK.getInstant.DownLoadStartCallBack.CallBack += callback;
- }
- public void RegisterDownCancelCallBack(Action callback) {
- AndroidPluginUpdateAPK.getInstant.DownLoadCancelCallBack.CallBack += callback;
- }
- public void RegisterDownFinishCallBack(Action callback) {
- AndroidPluginUpdateAPK.getInstant.DownLoadFinishCallBack.CallBack += callback;
- }
- public void UnRegisterDownStartCallBack(Action callback) {
- AndroidPluginUpdateAPK.getInstant.DownLoadStartCallBack.CallBack -= callback;
- }
- public void UnRegisterDownCancelCallBack(Action callback) {
- AndroidPluginUpdateAPK.getInstant.DownLoadCancelCallBack.CallBack -= callback;
- }
- public void UnRegisterDownFinishCallBack(Action callback) {
- AndroidPluginUpdateAPK.getInstant.DownLoadFinishCallBack.CallBack -= callback;
- }
- public override void Awake() {
- base.Awake();
- mInstant=this;
- AddSubSystem(UpdateSystemDataSubSystem = UpdateSystemData.getInstant);
- AddSubSystem(UpdateSystemGetDataSubSystem = new UpdateSystemGetData());
- AddSubSystem(UpdateSystemProcessDataSubSystem = new ProcessData());
- AddSubSystem(CanvasUI = CanvasUI.getInstant);
- //CanvasUI.SystemStop();
- }
- //public override void SystemStart() {
- // base.SystemStart();
- // CanvasUI.SystemStop();
- //}
- }
- }
|