public void OpenBattleUI() { GameState.State.tournament.gameObject.SetActive(false); SwapPopup.Close(); Inventory.Close(); Shop.Close(); playerAnimation.gameObject.SetActive(true); enemyAnimation.gameObject.SetActive(true); StartCoroutine(BattleStart()); }
IEnumerator BattleStart() { yield return(new WaitForSeconds(0.1f)); RefreshStatus(true); FlashText.Flash("Fight!", Color.red); AudioPlayer.PlayFight(); yield return(new WaitForSeconds(0.1f)); battleUI.SetActive(true); GameState.State.tournament.gameObject.SetActive(false); SwapPopup.Close(); Inventory.Close(); Shop.Close(); }
public void RemoveEquipment(EquipmentWrapper e) { if (equipment.Remove(e)) { strength -= e.equipment.strength; agility -= e.equipment.agility; constitution -= e.equipment.constitution; intelligence -= e.equipment.intelligence; if (e.durability > 0 && this == GameState.State.player) { SwapPopup.Popup(e.ToString(), (b) => { if (b) { AddInventory(e); } else { GameState.State.battleManager.ThrowEquipment(e); } }); } if (e.equipment.type == Equipment.Type.weapon && character.baseWeapon != null) { bool hasWeapon = false; for (int i = 0; i < equipment.Count; i++) { if (equipment[i].equipment.type == Equipment.Type.weapon) { hasWeapon = true; break; } } if (!hasWeapon) { AddEquipment(character.baseWeapon); } } } }
void Awake() { instance = this; gameObject.SetActive(false); }