Пример #1
0
    private IEnumerator HandleGameLoading()
    {
        // fire ge_loading_start event handled by ui module, display splash screen & change to loading state
        LogicSystem.BeginLoading();
        yield return(new WaitForSeconds(.1f));

        // if in shipping version, update resource from server
        if (GlobalVariables.Instance.IsPublish)
        {
            yield return(StartCoroutine(HandleGameLoadingPublish()));
        }

#if UNITY_ANDROID || UNITY_WEBGL
        // if not play game in editor, extract config data to disk
        else if (!UnityEngine.Application.isEditor)
        {
            string destPath = UnityEngine.Application.persistentDataPath + "/Tables";
            if (!Directory.Exists(destPath))
            {
                yield return(StartCoroutine(HandleGameLoadingNonEditor()));
            }
        }
#endif

        LogicSystem.UpdateLoadingProgress(0.45f);

        // init all game system and start game
        StartLogic();

        // fire ge_loading_finish event handled by ui module, notify ui finished
        LogicSystem.EndLoading();
    }