Exemplo n.º 1
0
 protected DownloaderBase(string[] hosts, int maxProcessing, string outputPath, DownloadDoneFunc downloadDone, StartCoroutineFunc coroutine)
 {
     this.hosts         = hosts;
     this.maxProcessing = maxProcessing;
     this.outputPath    = outputPath;
     this.downloadDone  = downloadDone;
     this.coroutine     = coroutine;
 }
Exemplo n.º 2
0
 public ResUpdater(string[] hosts, int thread, Reporter reporter, string projectPlatform, UpdateType type, StartCoroutineFunc coroutine)
 {
     this.UpdateType = type;
     this.Coroutine  = coroutine;
     this.Path       = new ResUpdaterPath(projectPlatform);
     this.Reporter   = reporter;
     this.downloader = new WwwDownloader(hosts, thread, Application.persistentDataPath, DownloadDone, coroutine);
 }
Exemplo n.º 3
0
    private void Awake()
    {
        if (_inited)
        {
            return;
        }

        Instance = this;

#if !UNITY_EDITOR
        AssetBundleManager.Initialize();
#endif

        var spriteMgr = Resources.FindObjectsOfTypeAll <SpriteAtlasMgr>();
        if (spriteMgr.Length == 0)
        {
            gameObject.AddComponent <SpriteAtlasMgr>();
        }

        //读取存档
        SaveDataMgr.PreloadGameData();

        //初始化游戏设置
        GameSetting.InitSetting();

        //初始化sound模块
        SoundListenter.Init();

        //初始化资源管理器
        ResourceMgr.InitInstance();


        CoroutineStart = StartCoroutine;
        DefaultRes     = GetComponent <DefaultRes>();

        //初始化UI
        var uguiRoot = FindObjectOfType <UiRootScript>();
        uguiRoot.Init();
        UiManager.Init(uguiRoot);
        DontDestroyOnLoad(uguiRoot);
        DontDestroyOnLoad(gameObject);

        //清理缓存
        Caching.ClearCache();


        UnityEngine.Random.InitState(DateTime.Now.Second);

#if !UNITY_EDITOR && UNITY_ANDROID
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
#endif
        _inited = true;


        FirstStartGame();
    }
Exemplo n.º 4
0
        public ResUpdater(string[] hosts, int thread, Reporter reporter, StartCoroutineFunc startCoroutine)
        {
            downloader     = new Downloader(hosts, thread, Application.persistentDataPath, DownloadDone);
            Reporter       = reporter;
            StartCoroutine = startCoroutine;

            CheckVersion = new CheckVersionState(this);
            CheckMd5     = new CheckMd5State(this);
            DownloadRes  = new DownloadResState(this);
        }
Exemplo n.º 5
0
 public WwwDownloader(string[] hosts, int maxProcessingCount, string outputPath, DownloadDoneFunc func, StartCoroutineFunc coroutine) : base(hosts, maxProcessingCount, outputPath, func
                                                                                                                                             , coroutine)
 {
 }
Exemplo n.º 6
0
 public HttpDownloader(string[] hosts, int maxProcessing, string outputPath, DownloadDoneFunc downloadDone, StartCoroutineFunc coroutine) : base(hosts, maxProcessing, outputPath, downloadDone, coroutine)
 {
     buffer = new byte[BUFFER_SIZE];
 }