public void Start()
    {
        INSTANCE = this;
        SelectCardInHandOverlay.Hide();
        ShowDeckScreen.Hide();

        GameObject.FindObjectOfType <UtilityObjectHolder>().Start();

        PotentialBattleEntityEnemySpots      = EnemyUnitSpotsParent.GetComponentsInChildren <BattleUnitPrefab>().ToList();
        PotentialBattleEntityAllySpots       = AllyUnitSpotsParent.GetComponentsInChildren <BattleUnitPrefab>().ToList();
        PotentialBattleEntityLargeEnemySpots = LargeEnemyUnitSpotsParent.GetComponentsInChildren <BattleUnitPrefab>().ToList();
        PotentialBattleEntityHugeEnemySpots  = HugeEnemyUnitSpotsParent.GetComponentsInChildren <BattleUnitPrefab>().ToList();

        state.Deck = new BattleDeck();
        foreach (var character in state.AllyUnitsInBattle)
        {
            character.InitForBattle();
            foreach (var card in character.BattleDeck)
            {
                state.Deck.AddNewCardToDiscardPile(card.CopyCard(logicallyIdenticalToExistingCard: true));
            }
        }

        action.DrawCards(5);

        /// END TODO
        Setup(ServiceLocator.GameState().EnemyUnitsInBattle, ServiceLocator.GameState().AllyUnitsInBattle);

        PotentialBattleEntityAllySpots.ForEach(item => item.HideOrShowAsAppropriate());
        PotentialBattleEntityEnemySpots.ForEach(item => item.HideOrShowAsAppropriate());
        PotentialBattleEntityLargeEnemySpots.ForEach(item => item.HideOrShowAsAppropriate());
        PotentialBattleEntityHugeEnemySpots.ForEach(item => item.HideOrShowAsAppropriate());

        state.EnemyUnitsInBattle.ForEach(item => item.InitForBattle());
        state.AllyUnitsInBattle.ForEach(item => item.InitForBattle());


        BattleStarter.StartBattle(this);
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     instance = this;
     StartBattle();
 }