Exemplo n.º 1
0
 public void OnHostStartGame()
 {
     this.SetLoadingText("Starting Server ...");
     if (TitleScreen.StartGameSetup.Type == TitleScreen.GameSetup.InitTypes.New)
     {
         PlaneCrashAudioState.Spawn();
     }
     base.gameObject.AddComponent <CoopSteamServerStarter>().gui = this;
 }
Exemplo n.º 2
0
 public void OnHostStartGame()
 {
     this.SetLoadingText(UiTranslationDatabase.TranslateKey("STARTING_SERVER___", "Starting Server...", this._allCapsTexts));
     if (GameSetup.IsNewGame)
     {
         PlaneCrashAudioState.Spawn();
     }
     base.gameObject.AddComponent <CoopSteamServerStarter>().gui = this;
 }
Exemplo n.º 3
0
 private void OnDisable()
 {
     if (this.snapshotInstance != null)
     {
         UnityUtil.ERRCHECK(this.snapshotInstance.stop(STOP_MODE.ALLOWFADEOUT));
         UnityUtil.ERRCHECK(this.snapshotInstance.release());
     }
     if (PlaneCrashAudioState.sInstance == this)
     {
         PlaneCrashAudioState.sInstance = null;
     }
 }
Exemplo n.º 4
0
 private void OnDisable()
 {
     if (this.snapshotInstance != null)
     {
         UnityUtil.ERRCHECK(this.snapshotInstance.stop(STOP_MODE.ALLOWFADEOUT));
         UnityUtil.ERRCHECK(this.snapshotInstance.release());
     }
     if (PlaneCrashAudioState.sInstance == this)
     {
         PlaneCrashAudioState.sInstance = null;
     }
 }
Exemplo n.º 5
0
 private void UpdateLobby()
 {
     if (!CoopLobby.IsInLobby)
     {
         this.OnBack();
         return;
     }
     if (CoopLobby.Instance == null || CoopLobby.Instance.Info == null || CoopLobby.Instance.Info.Destroyed)
     {
         this.SetErrorText(UiTranslationDatabase.TranslateKey("LOBBY_DESTROYED", "Lobby Destroyed", this._allCapsTexts));
         this.OnBack();
         CoopLobby.LeaveActive();
         return;
     }
     if (!CoopLobby.Instance.Info.IsOwner && CoopLobby.Instance.Info.ServerId.IsValid())
     {
         if (!BoltNetwork.isClient && !base.gameObject.GetComponent <CoopSteamClientStarter>())
         {
             base.gameObject.AddComponent <CoopSteamClientStarter>().gui = this;
             if (GameSetup.IsNewGame)
             {
                 PlaneCrashAudioState.Spawn();
             }
             this.SetLoadingText(UiTranslationDatabase.TranslateKey("STARTING_CLIENT___", "Starting Client...", this._allCapsTexts));
         }
     }
     else
     {
         bool  foundHost = false;
         ulong ownerId   = SteamMatchmaking.GetLobbyOwner(CoopLobby.Instance.Info.LobbyId).m_SteamID;
         this._lobbyScreen._playerCountLabel.text = StringEx.TryFormat(UiTranslationDatabase.TranslateKey("PLAYER_CURRENT_OVER_MAX", "PLAYERS: {0} / {1}", this._allCapsTexts), new object[]
         {
             CoopLobby.Instance.MemberCount,
             CoopLobby.Instance.Info.MemberLimit
         });
         this._lobbyScreen._playerListLabel.text = CoopLobby.Instance.AllMembers.Select(delegate(CSteamID x)
         {
             string text = SteamFriends.GetFriendPersonaName(x);
             bool flag   = x.m_SteamID == ownerId;
             if (flag)
             {
                 text     += " (Host)";
                 foundHost = true;
             }
             return(text);
         }).Aggregate((string a, string b) => a + "\n" + b);
         if (!foundHost)
         {
             this.OnBack();
         }
     }
 }
Exemplo n.º 6
0
 public void StopSounds()
 {
     this.pEvents.stopFMODEvents();
     if (base.transform && base.transform.parent)
     {
         foreach (FMOD_AnimationEventHandler fmod_AnimationEventHandler in base.transform.parent.GetComponentsInChildren <FMOD_AnimationEventHandler>())
         {
             fmod_AnimationEventHandler.enabled = false;
         }
     }
     FMODCommon.ReleaseIfValid(this.attendantDialogueEvent, STOP_MODE.ALLOWFADEOUT);
     this.attendantDialogueEvent = null;
     this.StopEventEmitter(this.SFX_inplane);
     this.StopEventEmitter(this.SFX_TakeTimmy);
     PlaneCrashAudioState.Disable();
 }
Exemplo n.º 7
0
 public static void Spawn()
 {
     if (PlaneCrashAudioState.sInstance != null)
     {
         return;
     }
     EventInstance @event = FMOD_StudioSystem.instance.GetEvent("snapshot:/amb_off");
     if (@event == null)
     {
         return;
     }
     GameObject gameObject = new GameObject("Plane Crash Audio State");
     PlaneCrashAudioState.sInstance = gameObject.AddComponent<PlaneCrashAudioState>();
     PlaneCrashAudioState.sInstance.snapshotInstance = @event;
     UnityUtil.ERRCHECK(@event.start());
     UnityEngine.Object.DontDestroyOnLoad(gameObject);
 }
Exemplo n.º 8
0
    public static void Spawn()
    {
        if (PlaneCrashAudioState.sInstance != null)
        {
            return;
        }
        EventInstance @event = FMOD_StudioSystem.instance.GetEvent("snapshot:/amb_off");

        if (@event == null)
        {
            return;
        }
        GameObject gameObject = new GameObject("Plane Crash Audio State");

        PlaneCrashAudioState.sInstance = gameObject.AddComponent <PlaneCrashAudioState>();
        PlaneCrashAudioState.sInstance.snapshotInstance = @event;
        UnityUtil.ERRCHECK(@event.start());
        UnityEngine.Object.DontDestroyOnLoad(gameObject);
    }
Exemplo n.º 9
0
 public void OnNewGame()
 {
     TitleScreen.StartGameSetup.Type = TitleScreen.GameSetup.InitTypes.New;
     if (TitleScreen.StartGameSetup.Mode == TitleScreen.GameSetup.PlayerModes.SinglePlayer)
     {
         this.BreadCrumbLevel2();
         PlaneCrashAudioState.Spawn();
         LoadSave.ShouldLoad = (TitleScreen.StartGameSetup.Type == TitleScreen.GameSetup.InitTypes.Continue);
         if (!this.MyLoader)
         {
             this.FixMissingLoaderRef();
         }
         this.MyLoader.SetActive(true);
     }
     else
     {
         this.BreadCrumbLevel3Mp();
         Application.LoadLevel(this.CoopScene);
     }
     this.MenuRoot.gameObject.SetActive(false);
 }
Exemplo n.º 10
0
 public void OnNewGame(DifficultyModes difficulty)
 {
     GameSetup.SetDifficulty(difficulty);
     GameSetup.SetInitType(InitTypes.New);
     if (GameSetup.IsSinglePlayer)
     {
         this.BreadCrumbLevel2();
         PlaneCrashAudioState.Spawn();
         LoadSave.ShouldLoad = (GameSetup.Init == InitTypes.Continue);
         if (!this.MyLoader)
         {
             this.FixMissingLoaderRef();
         }
         this.MyLoader.SetActive(true);
     }
     else
     {
         this.BreadCrumbLevel3Mp();
         this.InitMpScreenScenery();
         SceneManager.LoadScene(this.CoopScene, LoadSceneMode.Single);
     }
     this.MenuRoot.gameObject.SetActive(false);
 }