public void OpenChest() { chestUI.SetActive(true); inventoryUI.SetActive(true); equipmentUI.SetActive(true); chestMode = true; onUpdateUICallback.Invoke(); chest.StartCoroutine("PlayerNearChest"); }
private void Delete() { Console.Clear(); ConsoleUI.AddHeader("Delete Save", ConsoleColor.Yellow); for (int i = 0; i < SaveManager.Instance.GetValidIndex().Length; i++) { int index = SaveManager.Instance.GetValidIndex()[i]; string option = $"{SaveManager.Instance.GetSaveName(index)}"; ConsoleUI.AddOption(option, $"{index}", ConsoleColor.Red); } SaveManager.Instance.DeleteAt(InputNumber()); OnUpdateUI.Invoke(); }
void SetClass() { Console.Clear(); ConsoleUI.AddHeader("Select Class", ConsoleColor.Yellow); string[] classList = { "Warrior", "Mage", "Ranger", "Thief", "Priest", "Archer", "Orc", "Demon" }; ConsoleUI.AddList(classList, 1, ConsoleColor.Cyan); CharacterClass characterClass = new Warrior(); string classInput = Console.ReadLine(); if (GetKeyInput(classInput, "1", "warrior")) { characterClass = new Warrior(250, 100, 100, 0); } else if (GetKeyInput(classInput, "2", "mage")) { characterClass = new Mage(200, 75, 75, 100); } else if (GetKeyInput(classInput, "3", "ranger")) { characterClass = new Ranger(200, 50, 100, 50);; } else if (GetKeyInput(classInput, "4", "thief")) { characterClass = new Thief(150, 50, 125, 75); } GameManager.Instance.PlayerCharacter.CharacterClass = characterClass; OnUpdateUI?.Invoke(); ConsoleUI.Warning("You have selected : " + characterClass.GetType().Name); Console.WriteLine(); }
void Update() { if (Input.GetButtonDown("Inventory") && !GameManager.instance.gameOver) { contextMenu.SetActive(!contextMenu.activeSelf); if (GameManager.instance.isTutorial && !contextMenu.activeSelf) { TutorialManager.instance.ChallengeTrigger(TutorialState.INVENTORY); } if (contextMenu.activeSelf && onUpdateUICallback != null) { onUpdateUICallback.Invoke(); } } }
void SetName() { InputName: Console.Write("Character Name : "); string name = Console.ReadLine(); if (name == string.Empty) { OnUpdateUI?.Invoke(); ConsoleUI.Error("\nPlease select a valid option...\n"); goto InputName; } GameManager.Instance.PlayerCharacter.Name = name; OnUpdateUI?.Invoke(); ConsoleUI.Warning("Character name has been set to : " + GameManager.Instance.PlayerCharacter.Name); Console.WriteLine(); }
public MainMenuState(Stack <State> states) : base(states) { OnUpdateUI?.Invoke(); }
public override void Update() { ConsoleUI.ColorText("Choice : ", ConsoleColor.Green); string keyInput = Console.ReadLine(); if (GetKeyInput(keyInput, "0")) { PopState(); } else if (GetKeyInput(keyInput, "1")) { OnUpdateUI?.Invoke(); Console.WriteLine("IMPLEMENT GAME STATE..."); Console.ReadKey(); } else if (GetKeyInput(keyInput, "2")) { PushState(new CreateCharacterState(States)); } else if (GetKeyInput(keyInput, "3")) { if (SaveManager.Instance.SaveCount() > 0) { PushState(new SelectCharacterState(States)); } else { OnUpdateUI?.Invoke(); ConsoleUI.Error("Unable to find any save, please create one..."); } } else if (GetKeyInput(keyInput, "4")) { OnUpdateUI?.Invoke(); Save(); } else if (GetKeyInput(keyInput, "5")) { OnUpdateUI?.Invoke(); Load(); } else if (GetKeyInput(keyInput, "6")) { if (SaveManager.Instance.SaveCount() >= 1) { Delete(); } else { ConsoleUI.Error("There is no save to delete..."); } } else if (GetKeyInput(keyInput, "7")) { GameManager.Instance.PlayerCharacter.DisplayInfo(); Console.WriteLine("Press Any Key..."); Console.ReadKey(); OnUpdateUI?.Invoke(); } else { OnUpdateUI?.Invoke(); ConsoleUI.Error("Please select a valid option..."); } }
public CreateCharacterState(Stack <State> states) : base(states) { OnUpdateUI.Invoke(); GameManager.Instance.PlayerCharacter = new Character(); }
public SelectCharacterState(Stack <State> states) : base(states) { OnUpdateUI?.Invoke(); }
public void UpdateUI() { OnUpdateUI?.Invoke(); }