コード例 #1
0
        public void CreateWindow(WindowType windowType)
        {
            CameraController cameraController = Camera.main.GetComponent <CameraController>();

            cameraController.interfaceSource.PlayOneShot(cameraController.clickSound, PlayerPrefs.GetFloat("interfaceVolume"));
            if (windowType == WindowType.MainMenu)
            {
                UI.document.Run("CreateMenu", !PhotonNetwork.InRoom);
            }
            else if (windowType == WindowType.BigMap)
            {
                UI.document.Run("DisplayBigMapWindow");
                MapScript.CreateOrUpdateMaps(ref cameraController.mapCache, update: true);
            }
            else if (windowType == WindowType.Settings)
            {
                UI.document.Run("DisplaySettingsWindow");
                SettingsScript.CreateSettings("WindowContent");
            }
            else if (windowType == WindowType.LoadSave)
            {
                LoadSaveScript.selectedFile = "";
                UI.document.Run("DisplayLoadSaveWindow");
                LoadSaveScript.UpdateSaveList();
            }
        }
コード例 #2
0
        public void DestroyWindow()
        {
            if (UI.document.getElementsByClassName("menu").length > 0)
            {
                UI.document.getElementsByClassName("menu")[0].innerHTML = "";
            }

            if (UI.document.getElementsByClassName("window").length > 0)
            {
                UI.document.getElementsByClassName("window")[0].remove();
            }

            if (UI.document.getElementsByClassName("secondWindow").length > 0)
            {
                UI.document.getElementsByClassName("secondWindow")[0].remove();
            }

            if (selectedWindowType == WindowType.BigMap)
            {
                MapScript.UpdateMaps();
            }
        }