コード例 #1
0
    private void OnRetreated(Leader leader)
    {
        KingdomAudio.Play();
        BattleAudio.Stop();
        FollowCam.MakeCurrent();
        // BattleCam.ClearCurrent();
        CurrentState = State.Kingdom;

        Unit[] playerUnits = Battle.GetPlayerUnits().ToArray();
        foreach (Unit playerUnit in playerUnits)
        {
            playerUnit.CollisionMask  = 4;
            playerUnit.CollisionLayer = 4;
        }
        Battle.RemovePlayerUnits();
        Kingdom.AddPlayerUnits(new List <Unit>(playerUnits), true);
        Unit[] enemyUnits = Battle.GetEnemyUnits().ToArray();
        foreach (Unit enemyUnit in enemyUnits)
        {
            enemyUnit.CollisionMask  = 4;
            enemyUnit.CollisionLayer = 4;
        }
        Battle.RemoveEnemyUnits();
        leader.AddUnits(new List <Unit>(enemyUnits));
        Kingdom.RaiseDebt();
    }