Exemple #1
0
    public void SellCitizen(GameObject citizen)
    {
        Citizen info = citizen.GetComponent <Citizen>();

        info.ClearLocation();
        LevelManager.Instance.Player.Money += Mathf.FloorToInt(info.CitizenRole.Cost * LevelManager.Instance.Constants.CitizenSellRatio);

        if (info.EquipedWeapon != null)
        {
            AddWeapon(info.EquipedWeapon);
        }

        LevelManager.Instance.Player.Citizens.Remove(citizen);
        Destroy(citizen);
    }