/// <summary> /// 現在なっている音に変更後の音量を適用させる /// </summary> public void SoundVolumeApplication() { soundInfo.MainVolume = MainVolume; soundInfo.BackMusicVolume = BackMusicVolume; soundInfo.SfxVolume = SfxVolume; SaveLoadSystem.Save(soundInfo, SAVE_FILE_NAME); //バックミュージックがなければ処理しない if (backMusicObject != null) { //音量再適用 backMusicObject.GetComponent <AudioSource>().volume = MainVolume * BackMusicVolume; } //音量再適用 for (int i = 0; i < sfxList.Count; i++) { if (sfxList[i] == null) { continue; } else { sfxList[i].volume = MainVolume * BackMusicVolume; } } }
public void LoadGameSlots() { saveSlot1 = SaveLoadSystem.LoadGameData(1); saveSlot2 = SaveLoadSystem.LoadGameData(2); saveSlot3 = SaveLoadSystem.LoadGameData(3); saveSlot4 = SaveLoadSystem.LoadGameData(4); }
public void SetUp() { width = new int[5]; width[0] = 1920; width[1] = 1600; width[2] = 1280; width[3] = 960; width[4] = 800; height = new int[5]; height[0] = 1080; height[1] = 900; height[2] = 720; height[3] = 540; height[4] = 450; OptionsData data = SaveLoadSystem.LoadOptions(); qualityDropdown.value = data.quality; resolutionDropdown.value = data.resolution; fullscreenToggle.isOn = data.fullscreen; music.value = data.music; ambience.value = data.ambience; effects.value = data.effects; //SetGraphicsSettings(); SetAudioSettings(); }
private void Start() { subject = Subject.getInstance(); if (!observerDifficultAI.observerState && !observerVoice.observerState) { new observerDifficultAI(subject); new observerVoice(subject); } if (!File.Exists(Application.persistentDataPath + "save.binary")) { SettingData data = new SettingData(.5f, "MID"); SaveLoadSystem.Save(data); diff = "MID"; voi = .5f; } else { diff = SaveLoadSystem.Load().difficult; voi = SaveLoadSystem.Load().voice; } subject.setDifficultAndVoice(diff, voi); }
private void Awake() { GetComponent <GUIWindow>().OnClose.AddListener(() => { SaveLoadSystem.SaveConfig(); }); }
public void battleDialogCallback() { SaveLoadSystem.getInstance().currentSceneType = SaveLoadSystem.SceneType.ATRIUM; SaveLoadSystem.getInstance().atriumSceneStateArr[(int)SaveLoadSystem.AtriumSceneState.FROMLG2] = true; SaveLoadSystem.getInstance().save(); gameObject.SendMessage("changeScene", "LG2_stage"); }
void groupBattle() { GetComponent <sceneInterface>().gotoBattle(); Destroy(this.gameObject); SaveLoadSystem.getInstance().lg2SceneStateArr[(int)SaveLoadSystem.Lg2SceneState.BEGANDIALOG] = true; SaveLoadSystem.getInstance().save(); }
private void Start() { GameData gameData = SaveLoadSystem.LoadGameData(); hasNoAds = gameData.hasNoAds; SetCorrectSprite(); }
public void UserDataCreate() { if (!controller.CheckFile("UserData")) { LocalSave(); return; } button.SetActive(false); note.SetActive(true); userData = new UserData(name.text, controller.GetLength("UserData")); string[] userDataStr = new string[3]; userDataStr[0] = userData.userName; userDataStr[1] = userData.id.ToString(); userDataStr[2] = userData.bestTime.ToString(); StartCoroutine(controller.AddSave("UserData", userDataStr, MyDestroy)); TitleManager titleManager = FindObjectOfType <TitleManager>(); SaveLoadSystem.Save((object)userData, "UserData"); if (titleManager != null) { titleManager.Initialization(); } }
void Start() { Map = new List <List <Location> >(); RecLoc = new List <Location>(); Survivors = new List <Survivor>(); SelectedSurv = new List <Survivor>(); ActiveMissions = new List <Mission>(); DefenseSurv = new List <Survivor>(); TempDefenseSurv = new List <Survivor>(); CurLocId = new Index(0, 0); CurMissionId = 0; MapSize = 10; Days = 0; IdleSurv = 0; LivingSpace = 0; Food = 0; Happiness = 0; Defense = 0; DefenseFromBuildings = 0; FoodExtraction = 0; FoodIntake = 0; for (int i = 0; i < MapSize; i++) { Map.Add(new List <Location>()); for (int j = 0; j < MapSize; j++) { Map[i].Add(null); } } _saveLoadSysem = GetComponent <SaveLoadSystem>(); }
public void LoadGameData() { GameData gameData = SaveLoadSystem.LoadGameData(); if (gameData != null) { bestDistance = gameData.bestDistance; collectedCoins = gameData.coin; selectedCar = gameData.selectedCar; //Cars Lock/Unlock Data lockList = gameData.lockList; for (int i = 0; i < lockList.Count; i++) { carDatas[i].unlocked = lockList[i]; } } else { bestDistance = 0.0f; collectedCoins = 0; selectedCar = CarModel.Polo; //Cars Lock/Unlock Data for (int i = 0; i < carDatas.Length; i++) { lockList.Add(carDatas[i].unlocked); } SaveGameData(); } }
void OnMouseUp() { renderer.material.color = new Color(renderer.material.color.r, renderer.material.color.g, renderer.material.color.b, 1f); gameObject.audio.Play(); SaveLoadSystem.getInstance().load(); if (SaveLoadSystem.getInstance().currentSceneType == SaveLoadSystem.SceneType.LAB) { Debug.Log("MainMenu: Loading Lab scene"); AutoFade.LoadLevel("lab_stage", 0.5f, 0.5f, Color.black); } else if (SaveLoadSystem.getInstance().currentSceneType == SaveLoadSystem.SceneType.ATRIUM) { AutoFade.LoadLevel("atrium_stage", 0.5f, 0.5f, Color.black); } else if (SaveLoadSystem.getInstance().currentSceneType == SaveLoadSystem.SceneType.LG2) { AutoFade.LoadLevel("LG2_stage", 0.5f, 0.5f, Color.black); } else if (SaveLoadSystem.getInstance().currentSceneType == SaveLoadSystem.SceneType.SUNDIAL) { AutoFade.LoadLevel("sundial", 0.5f, 0.5f, Color.black); } else if (SaveLoadSystem.getInstance().currentSceneType == SaveLoadSystem.SceneType.UNDERSUN1) { AutoFade.LoadLevel("SecretChamberBefore", 0.5f, 0.5f, Color.black); } else if (SaveLoadSystem.getInstance().currentSceneType == SaveLoadSystem.SceneType.UNDERSUN2) { AutoFade.LoadLevel("SecretChamberAfter", 0.5f, 0.5f, Color.black); } }
public static void Save() { gameData.playerPosition = new float[] { GetPlayer().transform.position.x, GetPlayer().transform.position.y }; gameData.sceneAlias = SceneManager.GetActiveScene().name; SaveLoadSystem.Save(gameData); }
public void SetupChallenge() { List <ChallengeInfo> challengeInfo = GuessManager.Instance.ChallengeInfos; challengeItemObjectPool.ReturnAllObjectsToPool(); PlayerData playerData = SaveLoadSystem.Load(); if (playerData != null) { for (int i = 0; i < challengeListContainer.childCount; i++) { GameObject challengeGO = challengeListContainer.GetChild(i).gameObject; challengeGO.SetActive(true); ChallengeListItem challenge = challengeGO.transform.GetComponent <ChallengeListItem>(); challenge.Setup(challengeInfo[i].title, playerData.challengeList[i].curGoal, challengeInfo[i].goal, challengeInfo[i].challengeDescription); } } else { for (int i = 0; i < challengeListContainer.childCount; i++) { GameObject challengeGO = challengeListContainer.GetChild(i).gameObject; challengeGO.SetActive(true); ChallengeListItem challenge = challengeGO.transform.GetComponent <ChallengeListItem>(); challenge.Setup(challengeInfo[i].title, 0, challengeInfo[i].goal, challengeInfo[i].challengeDescription); } } }
// Use this for initialization void Start() { if (SaveLoadSystem.getInstance().lg2SceneStateArr [(int)SaveLoadSystem.Lg2SceneState.SAVEPRED]) { Destroy(this.gameObject); } }
public void Show(string titleText) { gameObject.SetActive(true); title.text = titleText; btnLoad.interactable = SaveLoadSystem.CheckForDataFile(); }
private void Start() { GameData gameData = SaveLoadSystem.LoadGameData(); musicEnabled = gameData.hasMusic; SetCorrectSprite(); }
public void Initialize(List <ItemObject> itemObjects, SaveLoadSystem saveLoadSystem) { _saveLoadSystem = saveLoadSystem; _itemObjects = itemObjects; foreach (var item in _inventorySlots) { item.Initialzie(); item.OnPointerEnterEvent += OnPoinerEnterItem; item.OnPointerExitEvent += OnPointerExitItem; } foreach (var item in _itemObjects) { if (item.Item.InInventory) { PushItemInInventory(item, true); } } _dragger.OnItemDropEvent += OnItemDropInInventory; _inventoryObject.OnInventoryOpen += InventoryOpen; _inventoryObject.OnInventoryClose += InventoryClose; }
public void ButtonPressYes() { // delete selected save file SaveLoadSystem.Delete(_mainMenuLoadSelectedMenuController.GetSaveFileNumber()); // switch to main menu's load menu ((MainMenuController)menuMaster).SwitchToLoadMenu(); }
void OnMouseUp() { renderer.material.color = new Color(renderer.material.color.r, renderer.material.color.g, renderer.material.color.b, 1f); gameObject.audio.Play(); SaveLoadSystem.getInstance().resetSave(); AutoFade.LoadLevel(startStageName, 0.5f, 0.5f, Color.black); }
private void Awake() { Instance = this; titleScreenBack = GetComponent <Image>(); saveLoadSystem = GetComponentInParent <SaveLoadSystem>(); }
void LoadInvetory() { if (SaveLoadSystem.SaveExists("Inventory")) { GiveItems(SaveLoadSystem.Load <List <Item> >("Inventory")); } }
void Load() { if (SaveLoadSystem.SaveExists("CollectedItems")) { CollectedItems = SaveLoadSystem.Load <HashSet <string> >("CollectedItems"); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Target") { FindObjectOfType <AudioManager>().Play("GameOver"); gamesPlayed++; if (gamesPlayed >= 3) { FindObjectOfType <AdController>().ShowVideoLost(); gamesPlayed = 0; } gameOverScreen.gameObject.SetActive(true); gameLost = true; endGameScoreText.text = "Score: " + inGameScoreText.text; coinsText.text = "Coins: " + FindObjectOfType <CoinsPerGameCounter>().coinsPerGame; int score = GameObject.FindGameObjectWithTag("UI").GetComponent <UIController>().score; if (score > GlobalVariables.highestScore) { GlobalVariables.highestScore = score; } highestScoreText.text = "Highest Score: " + GlobalVariables.highestScore; SaveLoadSystem.SaveData(); foreach (GameObject enemy in GameObject.FindGameObjectsWithTag("Target")) { enemy.transform.rotation = Quaternion.Euler(0, 0, 0); Instantiate(glasses, enemy.transform, false); } } }
public void RestartUI() { gameData = SaveLoadSystem.LoadGameData(); HideContinueButton(); newHighScoreImage.gameObject.SetActive(false); SetAllScoresTexts(); if (!shouldKeepContinueButtonHidden) { ShowContinueButtonByChance(); } else { shouldKeepContinueButtonHidden = false; } EnableRetryButtonTouch(); EnableMenuButtonTouch(); if (!gameData.hasNoAds) { if (interstitialAdScore <= 1.0f) { LoadIntersitialAd(); } } }
//return if answer correct public override bool openTable(int tableNo) { if (tableNo >= 0 && tableNo < tablesOpen.Length) { tablesOpen [tableNo] = !tablesOpen [tableNo]; Debug.Log("Big Table Array: " + this.getTablesOpen()); sl_OpenDoorChecker = false; issueTurnOnOffDialog(tableNo); if (checkArray()) { Debug.Log("get it right!"); GameObject.Find("Door").gameObject.SendMessage("openDoor", true, SendMessageOptions.DontRequireReceiver); SaveLoadSystem.getInstance().labSceneStateArr[(int)SaveLoadSystem.LabSceneState.PUZZLESOLVED] = true; SaveLoadSystem.getInstance().save(); issueSuccessPuzzlingDialog(); return(true); } } else { Debug.LogError("tableNo " + tableNo + " not valid"); } return(false); }
private void Start() { GameData gameData = SaveLoadSystem.LoadGameData(); soundEffectsEnabled = gameData.hasSoundEffects; SetCorrectSprite(); }
void Save() { GameObject player = GameObject.FindGameObjectWithTag("Player"); GameObject[] drones = GameObject.FindGameObjectsWithTag("Mortal"); GameState state = new GameState(); state.SceneName = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name; float playerHealth = player.GetComponent <Health>().currentHealth; state.Player = new GameState.Actor(playerHealth, player); List <GameState.Drone> dronesData = new List <GameState.Drone>(); for (int i = 0; i < drones.Length; i++) { if (drones[i] != null) { Health droneHealthObj = drones[i].GetComponent <Health>(); if (droneHealthObj != null) { float droneHealth = droneHealthObj.currentHealth; if (droneHealth > 0) { dronesData.Add(new GameState.Drone(droneHealth, drones[i])); } } } } state.Drones = dronesData.ToArray(); state.checkpointId = id; SaveLoadSystem.Save(state); Debug.Log(SaveLoadSystem.gameState.Drones.Length); }
void Start() { subject = Subject.getInstance(); diff = SaveLoadSystem.Load().difficult; voi = SaveLoadSystem.Load().voice; toggles[0].isOn = false; toggles[1].isOn = false; toggles[2].isOn = false; if (diff.Equals("EASY")) { toggles[0].isOn = true; } else if (diff.Equals("MID")) { toggles[1].isOn = true; } else { toggles[2].isOn = true; } voiceScrollBar.value = voi; }
private void Awake() { GetComponent <GUIButton>().onClick.AddListener(() => { SaveLoadSystem.LoadGame(); SaveLoadSystem.LoadStash(); }); }