Ejemplo n.º 1
0
    public void StopLANClient()
    {
        if (NetworkClient.active)
        {
            this.networkManager.StopClient();
        }
        this.LANClientReady.SetActive(false);
        this.LANClientNotReady.SetActive(false);
        this.LANClientNotConnected.SetActive(false);
        this.initialMenu.SetActive(true);
        this.optionsMenu.SetActive(true);
        EnableAttributeEditor enableEditorObj = this.optionsMenu.GetComponentInChildren <EnableAttributeEditor>();

        if (enableEditorObj != null && enableEditorObj.isCustomOptionSelected)
        {
            enableEditorObj.TurnOnCanvasGroup();
        }

        GameMetricLogger.DisableLoggerHotkey();
        GameMetricLogger.SetGameLogger(GameLoggerOptions.GameIsOver);
    }
Ejemplo n.º 2
0
    public void StopLANHost()
    {
        //NOTE(Thompson): This is the official method of resetting the LAN session if the
        //player wants to play a new LAN session after ending a previous LAN session.
        SceneManager.LoadScene("new_multiplayer");

        //NOTE(Thompson): When reloading a scene, the GUIs are not reset to its initial states. Therefore
        //the following reinitialization codes are necessary.
        this.networkManager.StopHost();
        this.LANHost.SetActive(false);
        this.LANClientReady.SetActive(false);
        this.LANClientNotReady.SetActive(false);
        this.LANClientNotConnected.SetActive(false);
        this.initialMenu.SetActive(true);
        this.optionsMenu.SetActive(true);
        EnableAttributeEditor enableEditorObj = this.optionsMenu.GetComponentInChildren <EnableAttributeEditor>();

        if (enableEditorObj != null && enableEditorObj.isCustomOptionSelected)
        {
            enableEditorObj.TurnOnCanvasGroup();
        }

        MinimapStuffs stuffs = GameObject.FindObjectOfType <MinimapStuffs>();

        if (stuffs != null)
        {
            stuffs.playerCameraPanning = Camera.main.GetComponent <CameraPanning>();
            Camera minimapCamera = stuffs.GetComponent <Camera>();
            minimapCamera.enabled = false;
        }

        if (Taskbar.Instance != null)
        {
            Taskbar.Instance.ShowTaskbar(false);
        }

        GameMetricLogger.DisableLoggerHotkey();
        //GameMetricLogger.SetGameLogger(GameLoggerOptions.StopGameMetrics);
    }