// -----------------------------------------------------------------------------------
    //
    // -----------------------------------------------------------------------------------
    public void OnClientSwitchServerRequested(NetworkConnection connection, SwitchServerMsg message)
    {
        print("OnClientSwitchServerRequested: " + message.scenePath);

        // only on client
        if (!NetworkServer.active)
        {
            UCE_UI_Tools.FadeOutScreen(false);

            print("[Zones]: disconnecting from current server");
            manager.StopClient();

            NetworkClient.Shutdown();
            NetworkManager.Shutdown();          // clears singleton too
            NetworkManager.singleton = manager; // setup singleton again

            print("[Zones]: loading required scene: " + message.scenePath);
            autoSelectCharacter = message.characterName;

            string sceneName = Path.GetFileNameWithoutExtension(message.scenePath);

            SceneManager.LoadScene(sceneName);
            autoConnectClient = true;
        }
    }
    // -----------------------------------------------------------------------------------
    // Show
    // -----------------------------------------------------------------------------------
    public void Show()
    {
        Player player = Player.localPlayer;

        if (!player)
        {
            return;
        }

        for (int i = 0; i < content.childCount; ++i)
        {
            Destroy(content.GetChild(i).gameObject);
        }

        UCE_Area_Timegate Timegate = player.UCE_myTimegate;

        if (Timegate)
        {
            validateTimegate();
            if (okTimegate)
            {
                TimegateButton.GetComponentInChildren <Text>().text = MSG_TIMEGATE + Timegate.teleportationTarget.name;
            }

            TimegateButton.interactable = okTimegate;

            TimegateButton.onClick.SetListener(() =>
            {
                UCE_UI_Tools.FadeOutScreen();
                player.Cmd_UCE_SimpleTimegate();
            });
        }

        updateTextbox();
        panel.SetActive(true);
    }
示例#3
0
 public override void OnInteractClient(Player player)
 {
     UCE_UI_Tools.FadeOutScreen(false, 0.25f);
 }