Exemplo n.º 1
0
    private void OnBattleInitiated(Leader leader)
    {
        KingdomAudio.Stop();
        BattleAudio.Play();
        BattleCam.MakeCurrent();
        // FollowCam.ClearCurrent();
        CurrentState = State.Battle;
        Battle.SetEnemyLeader(leader);

        Unit[] playerUnits = Kingdom.GetPlayerUnits().ToArray();
        foreach (Unit playerUnit in playerUnits)
        {
            playerUnit.CollisionMask  = 16;
            playerUnit.CollisionLayer = 16;
        }
        Kingdom.RemovePlayerUnits();
        Battle.AddPlayerUnits(new List <Unit>(playerUnits));
        Unit[] enemyUnits = leader.GetUnits().ToArray();
        foreach (Unit enemyUnit in enemyUnits)
        {
            enemyUnit.CollisionMask  = 16;
            enemyUnit.CollisionLayer = 16;
        }
        leader.RemoveUnits();
        Battle.AddEnemyUnits(new List <Unit>(enemyUnits));
    }