Exemple #1
0
        /// <summary>
        /// Saves the changes made and returns to the main menu...
        /// </summary>
        public void Menu()
        {
            audioManager.Play("MenuButton", .75f);

            // Apply changes for gameData
            if (playerColour.GetColourPicked() != Color.black)
            {
                gameData.playerColour      = Converters.ConvertColorToFloatArray(playerColour.GetColourPicked());
                gameData.playerPipPosition = ExtraSerialize.Vector3Serialize(playerColour.GetPipPosition());
            }

            if (crusherColour.GetColourPicked() != Color.black)
            {
                gameData.crusherColour      = Converters.ConvertColorToFloatArray(crusherColour.GetColourPicked());
                gameData.crusherPipPosition = ExtraSerialize.Vector3Serialize(crusherColour.GetPipPosition());
            }

            ApplyChanges();

            // Save and change to main menu
            StartCoroutine(sceneChangerInterface.ChangeScene("MainMenu"));
            SaveManager.SaveGame(gameData);
        }