Esempio n. 1
0
    private IEnumerator LoadSceneAsync(string levelName)
    {
        if (this.loadLevelAsyncOperation != null)
        {
            yield break;
        }
        Amplitude.Unity.Gui.IGuiService guiService = Services.GetService <Amplitude.Unity.Gui.IGuiService>();
        LoadingScreen loadingScreen = guiService.GetGuiPanel <LoadingScreen>();

        if (loadingScreen != null)
        {
            object dontDisplayAnyLoadingTip = new LoadingScreen.DontDisplayAnyLoadingTip();
            loadingScreen.Show(new object[]
            {
                dontDisplayAnyLoadingTip
            });
        }
        Diagnostics.Log("Loading the outgame view...");
        Diagnostics.Progress.SetProgress(1f, "%GameClientStateLoadingOutgameView");
        this.loadLevelAsyncOperation = SceneManager.LoadSceneAsync(levelName, LoadSceneMode.Additive);
        while (!this.loadLevelAsyncOperation.isDone)
        {
            yield return(null);
        }
        this.SceneObject = GameObject.Find("[OutGameView_Layout]");
        if (this.SceneObject == null)
        {
            Diagnostics.LogError("Cannot locate the root object '{0}' after loading the scene '{1}'.", new object[]
            {
                "[OutGameView_Layout]",
                levelName
            });
        }
        else
        {
            GameObject sceneObject = this.SceneObject;
            sceneObject.name += "(scene: additive, async)";
            this.SceneObject.transform.parent        = base.transform;
            this.SceneObject.transform.localPosition = Vector3.zero;
            this.SceneObject.transform.localRotation = Quaternion.identity;
            this.SceneObject.SetActive(true);
        }
        this.loadLevelAsyncOperation = null;
        Resources.UnloadUnusedAssets();
        if (Amplitude.Unity.Framework.Application.Bootstrapper != null)
        {
            Amplitude.Unity.Framework.Application.Bootstrapper.gameObject.SetActive(false);
        }
        guiService.Hide(typeof(LoadingScreen));
        if (this.Parameters.Length == 1)
        {
            Type typeOfPanelToShow = this.Parameters[0] as Type;
            Diagnostics.Assert(typeOfPanelToShow != null);
            guiService.Show(typeOfPanelToShow, new object[0]);
        }
        Amplitude.Unity.Audio.IAudioLayeredMusicService musicService = Services.GetService <Amplitude.Unity.Audio.IAudioLayeredMusicService>();
        musicService.PlayLayeredMusic("OutGameMusic", OutGameView.OutGameMusicName, 1);
        yield break;
    }
Esempio n. 2
0
    private void OnValidateCB(GameObject obj)
    {
        IRuntimeService service = Services.GetService <IRuntimeService>();
        IRuntimeModulePlaylistService     service2 = Services.GetService <IRuntimeModulePlaylistService>();
        List <RuntimeModuleConfiguration> list     = new List <RuntimeModuleConfiguration>();

        if (this.guiModules.Count == 0 || this.guiModules[0].Module.Type != RuntimeModuleType.Standalone)
        {
            list.Add(new RuntimeModuleConfiguration(service.VanillaModuleName));
        }
        int i     = 0;
        int count = this.guiModules.Count;

        while (i < count)
        {
            list.Add(new RuntimeModuleConfiguration(this.guiModules[i].Module.Name));
            i++;
        }
        ModulePlaylist anonymousModulePlaylist = ModulePlaylist.GetAnonymousModulePlaylist(list.ToArray());

        Amplitude.Unity.Framework.Application.Registry.SetValue(global::Application.Registers.LastModulePlaylistActivated, anonymousModulePlaylist.Name);
        Amplitude.Unity.Framework.Application.Registry.SetValue(global::Application.Registers.AnonymousModulePlaylist, ModulePlaylist.GetConfigurationUrl(anonymousModulePlaylist.Configuration));
        service2.CurrentModulePlaylist   = anonymousModulePlaylist;
        global::RuntimeManager.LobbyData = this.LobbyData;
        service.ReloadRuntime(anonymousModulePlaylist.Configuration);
        this.Hide(false);
        Diagnostics.Progress.Clear();
        Diagnostics.Progress.SetProgress(0.9f, "%LoadingRuntimeModules");
        object obj2 = new LoadingScreen.DontDisplayAnyLoadingTip();

        base.GuiService.Show(typeof(LoadingScreen), new object[]
        {
            "GUI/DynamicBitmaps/Backdrop/Pov_Auriga",
            obj2
        });
    }