コード例 #1
0
 // Saves the settings
 public void SaveSettings()
 {
     MemoryDataService.Distance = distance;
     MemoryDataService.Language = language = languagesShort[languageDropdown.value];
     MemoryDataService.DirectSave();
     CloseSettings();
 }
コード例 #2
0
        public void MemoryDataServiceShouldSaveLanguage()
        {
            string language = "de";

            // Makes sure initial value is returned
            MemoryDataService.ClearData();

            // Should return English as initial value
            Assert.AreEqual("en", MemoryDataService.Language);
            MemoryDataService.Language = language;

            // Save directly instead saving on closure
            MemoryDataService.DirectSave();
            Assert.AreEqual(language, MemoryDataService.Language);
        }
コード例 #3
0
        public void Setup()
        {
            settingsMenu = new GameObject().AddComponent <SettingsMenu>();

            settingsMenu.saveButton       = new GameObject().AddComponent <Button>();
            settingsMenu.distanceAmount   = new GameObject().AddComponent <Text>();
            settingsMenu.languageDropdown = new GameObject().AddComponent <Dropdown>();
            settingsMenu.radiusSlider     = new GameObject().AddComponent <Slider>();
            settingsMenu.radiusImage      = new GameObject().AddComponent <SVGImage>();

            settingsMenu.radiusSlider.minValue = 1;
            settingsMenu.radiusSlider.maxValue = 20;

            MemoryDataService.Language = "de";
            MemoryDataService.Distance = 1000;
            MemoryDataService.DirectSave();
        }