Exemple #1
0
    IEnumerator _LoadAllScenes()
    {
        AsyncOperation async;

        string[]      enums   = Enum.GetNames(typeof(SceneType));
        BundleManager bundleM = BundleManager.instance;

        for (int i = 2; i < enums.Length; i++)
        {
            bundleM.txtStatusBar.text = "Memuat permainan " + Mathf.RoundToInt(((float)i / (float)enums.Length) * 100).ToString() + "%";
            string loadPath = BundleManager.instance.GetSceneLoadPath(i);
            //Logger.E ("loading scene: " + loadPath);
            AssetBundle ab        = AssetBundle.LoadFromFile(loadPath);
            string[]    scenePath = ab.GetAllScenePaths();
            //Logger.E (scenePath[0]);
            async = SceneManager.LoadSceneAsync(scenePath[0], LoadSceneMode.Additive);
            while (!async.isDone)
            {
                yield return(_WFSUtility.wef);
                //Logger.E ("name: " + scenePath[0] + " | progress: " + async.progress);
            }
            ab.Unload(false);
            //add progress here
        }
        yield return(_WFSUtility.wef);

        homeM = HomeManager.instance;
        yield return(_WFSUtility.wef);

        profileM = ProfileManager.instance;
        yield return(_WFSUtility.wef);

        verifyM = VerifyManager.instance;
        yield return(_WFSUtility.wef);

        vipM = VipManager.instance;
        yield return(_WFSUtility.wef);

        pokerM = PokerManager.instance;
        yield return(_WFSUtility.wef);

        beginM = BeginManager.instance;
        yield return(_WFSUtility.wef);

        loginM = LoginManager.instance;
        yield return(_WFSUtility.wef);

        shopM = ShopManager.instance;
        yield return(_WFSUtility.wef);

        proomM = PokerRoomManager.instance;
        yield return(_WFSUtility.wef);

        slotoM = FindObjectOfType <SlotoManagerScript> ();
        yield return(_WFSUtility.wef);

        sicboM = SicboManager.instance;
        yield return(_WFSUtility.wef);

        settingsM = SettingsManager.instance;
        yield return(_WFSUtility.wef);

        heroM = HeroManager.instance;
        yield return(_WFSUtility.wef);

        leaderboardM = LeaderboardManager.instance;
        yield return(_WFSUtility.wef);

        friendM = FriendManager.instance;
        yield return(_WFSUtility.wef);

        inboxM = InboxManager.instance;
        yield return(_WFSUtility.wef);

        transferM = TransferManager.instance;
        yield return(_WFSUtility.wef);

        redeemM = RedeemManager.instance;
        yield return(_WFSUtility.wef);

        dailyRewardsM = DailyRewardsManager.instance;
        yield return(_WFSUtility.wef);

        weeklyRewardsM = WeeklyRewardsManager.instance;
        yield return(_WFSUtility.wef);

        moneySlotM = MoneySlotManager.instance;
        yield return(_WFSUtility.wef);

        dailyQuestM = DailyQuestManager.instance;
        yield return(_WFSUtility.wef);

        watchAdsM = WatchAdsManager.instance;

        PhotonNetwork.ConnectUsingSettings("v1.0");
        yield return(_WFSUtility.wef);

        SetActiveScene(SceneType.SLOTO, false);
        yield return(_WFSUtility.wef);

        int    playerID = PlayerPrefs.GetInt(PrefEnum.PLAYER_ID.ToString(), 0);
        string token    = PlayerPrefs.GetString(PrefEnum.TOKEN.ToString(), string.Empty);

        if (playerID != 0 && token != string.Empty)
        {
            ApiManager.instance.GetHome();
        }
        else
        {
            SetActiveScene(SceneType.LOGIN, true);
        }
        yield return(_WFSUtility.wef);

        BundleManager.instance.bLoadingScenes = true;
        yield return(_WFSUtility.wef);

        SceneManager.UnloadSceneAsync("SeSplash");
    }
Exemple #2
0
    IEnumerator _LoadLocalScenes()
    {
        AsyncOperation async;
        BundleManager  bundleM = BundleManager.instance;

        for (int i = 2; i < SceneManager.sceneCountInBuildSettings; i++)
        {
            bundleM.txtStatusBar.text = "Memuat permainan " + Mathf.RoundToInt(((float)i / (float)SceneManager.sceneCountInBuildSettings) * 100).ToString() + "%";
            async = SceneManager.LoadSceneAsync(i, LoadSceneMode.Additive);
            while (!async.isDone)
            {
                yield return(_WFSUtility.wef);
            }
        }

        yield return(_WFSUtility.wef);

        homeM = HomeManager.instance;
        yield return(_WFSUtility.wef);

        profileM = ProfileManager.instance;
        yield return(_WFSUtility.wef);

        verifyM = VerifyManager.instance;
        yield return(_WFSUtility.wef);

        vipM = VipManager.instance;
        yield return(_WFSUtility.wef);

        pokerM = PokerManager.instance;
        PhotonNetwork.ConnectUsingSettings("v1.0");
        yield return(_WFSUtility.wef);

        beginM = BeginManager.instance;
        yield return(_WFSUtility.wef);

        loginM = LoginManager.instance;
        yield return(_WFSUtility.wef);

        shopM = ShopManager.instance;
        yield return(_WFSUtility.wef);

        proomM = PokerRoomManager.instance;
        yield return(_WFSUtility.wef);

        slotoM = FindObjectOfType <SlotoManagerScript> ();
        yield return(_WFSUtility.wef);

        sicboM = SicboManager.instance;
        yield return(_WFSUtility.wef);

        settingsM = SettingsManager.instance;
        yield return(_WFSUtility.wef);

        heroM = HeroManager.instance;
        yield return(_WFSUtility.wef);

        leaderboardM = LeaderboardManager.instance;
        yield return(_WFSUtility.wef);

        friendM = FriendManager.instance;
        yield return(_WFSUtility.wef);

        inboxM = InboxManager.instance;
        yield return(_WFSUtility.wef);

        transferM = TransferManager.instance;
        yield return(_WFSUtility.wef);

        redeemM = RedeemManager.instance;
        yield return(_WFSUtility.wef);

        dailyRewardsM = DailyRewardsManager.instance;
        yield return(_WFSUtility.wef);

        weeklyRewardsM = WeeklyRewardsManager.instance;
        yield return(_WFSUtility.wef);

        moneySlotM = MoneySlotManager.instance;
        yield return(_WFSUtility.wef);

        dailyQuestM = DailyQuestManager.instance;
        yield return(_WFSUtility.wef);

        watchAdsM = WatchAdsManager.instance;


        yield return(_WFSUtility.wef);

        SetActiveScene(SceneType.SLOTO, false);
        yield return(_WFSUtility.wef);

        int    playerID = PlayerPrefs.GetInt(PrefEnum.PLAYER_ID.ToString(), 0);
        string token    = PlayerPrefs.GetString(PrefEnum.TOKEN.ToString(), string.Empty);

        if (playerID != 0 && token != string.Empty)
        {
            ApiManager.instance.GetHome();
        }
        else
        {
            SetActiveScene(SceneType.LOGIN, true);
        }
        yield return(_WFSUtility.wef);

        BundleManager.instance.bLoadingScenes = true;
        yield return(_WFSUtility.wef);

        SceneManager.UnloadSceneAsync("SeSplash");
    }