private void SaveCustomizations()
    {
        GameSetting2.SaveCharacterScale(scale.x, scale.y);
        GameObject   cc = GameObject.FindWithTag("CharColor");
        ChangingRoom go = cc.GetComponent <ChangingRoom>();

        go.SaveCharacterColor();
        GameSetting2.SaveGameVersion();
    }
Ejemplo n.º 2
0
    void OnGUI()
    {
        if (_displayDialogWindow)
        {
            _dialogWindowRect = GUI.Window(DIALOG_WINDOW_ID, new Rect(_offset, Screen.height - (_offset + lootWindowHeight), Screen.width - (_offset * 2), lootWindowHeight), DialogWindow, "Dialog");
        }

        if (_displayLootWindow)
        {
            _lootWindowRect = GUI.Window(LOOT_WINDOW_ID, new Rect(_offset, Screen.height - (_offset + lootWindowHeight), Screen.width - (_offset * 2), lootWindowHeight), LootWindow, "Loot Window");
        }

        if (_displayCharacterWindow)
        {
            _characterWindowRect = GUI.Window(CHARACTER_WINDOW_ID, _characterWindowRect, CharacterWindow, "Character");
        }

        if (_displayInventory)
        {
            _inventoryWindowRect = GUI.Window(INVENTORY_WINDOW_ID, _inventoryWindowRect, InventoryWindow, "Inventory");
        }

        DisplayToolTip();

        if (GUI.Button(new Rect(Screen.width - 95, Screen.height - 120, 85, 25), "Character(C)"))
        {
            _displayCharacterWindow = !_displayCharacterWindow;
        }

        if (GUI.Button(new Rect(Screen.width - 95, Screen.height - 90, 85, 25), "Inventory(I)"))
        {
            _displayInventory = !_displayInventory;
        }

        if (GUI.Button(new Rect(Screen.width - 95, Screen.height - 60, 85, 25), "Main Menu"))
        {
            GameSetting2.SavePlayerPosition(PC.Instance.transform.position);
            GameObject   cc = GameObject.FindWithTag("CharColor");
            ChangingRoom go = cc.GetComponent <ChangingRoom>();
            go.SaveCharacterColor();
            Application.LoadLevel(GameSetting2.levelNames[0]);
        }

        if (GUI.Button(new Rect(Screen.width - 95, Screen.height - 30, 85, 25), "Exit(ESC)"))
        {
            GameSetting2.SavePlayerPosition(PC.Instance.transform.position);
            GameObject cc = GameObject.FindWithTag("CharColor");
            if (cc != null)
            {
                ChangingRoom go = cc.GetComponent <ChangingRoom>();
                go.SaveCharacterColor();
            }
            Debug.Log("myGUI: save pos and color");
            Application.Quit();
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            GameSetting2.SavePlayerPosition(PC.Instance.transform.position);
            Application.Quit();
            Debug.Log("myGUI: save pos");
            Debug.Log("exit_esc");
        }
    }