public void StartBattle() { if (creatureA != null && creatureB != null && currentState == Battle_Manager_State.Load) { currentState = Battle_Manager_State.Battle; loading.SetActive(false); creatureA.myBattle.currentHealth = 100; creatureB.myBattle.currentHealth = 100; creatureA.myBattle.currentState = Creature_Battle.CreatureBattleState.Start; creatureB.myBattle.currentState = Creature_Battle.CreatureBattleState.Start; } }
public void OpenLoad() { currentState = Battle_Manager_State.Load; for (int i = 0; i < GameSave.current.creatures.Count; i++) { loadPanelContent.GetComponent <RectTransform>().sizeDelta = new Vector2(loadPanelContent.GetComponent <RectTransform>().sizeDelta.x, 200 + (i * 200)); GameObject c = Instantiate(creaturePanel); c.transform.SetParent(loadPanelContent.transform, false); c.transform.localPosition = new Vector2(0, 0); c.GetComponent <Creature_UI>().stats = GameSave.current.creatures[i]; c.GetComponent <Creature_UI>().InitUI(); } loading.SetActive(true); loadButton.SetActive(false); }
void Awake() { currentState = Battle_Manager_State.Pre; }