public void OnTriggerEnter2D(Collider2D other) { if (other.name == "Morgane") { RpgManager.ZoneDisplayName(zoneName); } }
private void ToggleKey(SaveKey key, bool defaultIsZero = false) { if (defaultIsZero) { SetKey(key, GetKey(key) == 1 ? 0 : 1); } else { SetKey(key, GetKey(key) == 0 ? 1 : 0); } RpgManager.ZoneDisplayName("Cheat\n" + key.ToString() + " set to " + GetKey(key)); dataDebug.SetData(RpgManager.Data); }
private void Interaction() { counter++; if (counter >= audioClips.Count) { counter = 0; } RpgManager.CurrentStory.SetMusic(audioClips[counter]); //player.Talk(audioNames[counter], () => player.EndTalk()); RpgManager.ZoneDisplayName(audioNames[counter]); }
private void Update() { // F1 : Unset all keys // F2 : Toggle facebookDone // F3 : Toggle SeenBull & SeenSnake // F4 : Toggle MetAltea // F5 : Toggle MetOrion // F6 : Toggle SeenMontgeron // F7 : Toggle SeenHouse // F8 : Toggle DefeatedCerberus // F11 : Force save // F12 : Toggle collisions if (Input.GetButtonDown("Back") && gameState != GameState.MainMenu) { ToggleMenu(); } else if (Input.GetKeyDown(KeyCode.F1)) { /*RpgManager.Data = new GameData(); * dataDebug.SetData(RpgManager.Data); * RpgManager.ZoneDisplayName("Cheat \n Unset all save keys");*/ RefillHP(); RpgManager.ZoneDisplayName("Cheat\nHeal"); } else if (Input.GetKeyDown(KeyCode.F2)) { ToggleKey(SaveKey.facebookDone, true); } else if (Input.GetKeyDown(KeyCode.F3)) { int value = (GetKey(SaveKey.seenBull) == 1 && GetKey(SaveKey.seenSnake) == 1) ? 0 : 1; SetKey(SaveKey.seenBull, value); SetKey(SaveKey.seenSnake, value); RpgManager.ZoneDisplayName("Cheat\n" + "seenBull and seenSnake\n" + " set to " + value); dataDebug.SetData(RpgManager.Data); } else if (Input.GetKeyDown(KeyCode.F4)) { ToggleKey(SaveKey.metAltea); } else if (Input.GetKeyDown(KeyCode.F5)) { ToggleKey(SaveKey.metOrion); } else if (Input.GetKeyDown(KeyCode.F6)) { ToggleKey(SaveKey.seenMontgeron); } else if (Input.GetKeyDown(KeyCode.F7)) { ToggleKey(SaveKey.seenHouse); } else if (Input.GetKeyDown(KeyCode.F8)) { ToggleKey(SaveKey.defeatedCerberus, true); } else if (Input.GetKeyDown(KeyCode.F11)) { if (Input.GetKey(KeyCode.LeftShift)) { RpgManager.Data = GameData.LoadFromFile(); RpgManager.ZoneDisplayName("Cheat\nForce load"); dataDebug.SetData(RpgManager.Data); LoadScene(dataDebug.scene, dataDebug.place); } else { GameData.SaveToFile(RpgManager.Data); RpgManager.ZoneDisplayName("Cheat\nForce save"); } } else if (Input.GetKeyDown(KeyCode.F12)) { Collider2D c = player.GetComponent <Collider2D>(); c.enabled = !c.enabled; RpgManager.ZoneDisplayName("Cheat\nCollisions " + (c.enabled ? "Activées" : "Désactivées")); } }