public void StartBattle(BattlePool pool) { /* * SceneManager.LoadScene("BattleScene"); * nextBattlePool = pool; */ battleObject.SetActive(true); player.GetComponent <OverworldPlayerController>().frozen = true; BattleManager.instance.StartBattle(pool); }
public void Init() { //士兵Group m_SoldierGroupPool = new BattlePool <SoldierGroup, TroopData>(); m_SoldierGroupPool.Init(m_SoldierGroupPrefab); //士兵 m_SoldierObjectPools = new BattlePool <SoldierObject, SoldierData> [m_SoldierPrefab.Length]; for (int i = 0; i < m_SoldierObjectPools.Length; i++) { m_SoldierObjectPools[i] = new BattlePool <SoldierObject, SoldierData>(); m_SoldierObjectPools[i].Init(m_SoldierPrefab[i]); } InitCache(); }
public void StartBattle(BattlePool startingPool) { Debug.Log(startingPool); List <BattleParticipant> pool = new List <BattleParticipant>(); foreach (BattleParticipantTemplate battlerTemplate in startingPool.pool) { BattleParticipant participant = Instantiate(battlerTemplate).participant; pool.Add(participant); } foreach (BattleParticipant partyBattler in PlayerManager.instance.party) { pool.Add(partyBattler); } battle = new Battle(pool); SetupUI(); RefreshUI(); battle.activeParticipant = battle.participants[0]; inBattle = true; SetState(new BattleStateStart(this)); }