Exemple #1
0
    void BuildTurret(TurretBlueprint blueprint)
    {
        if (PlayerStats.Money < blueprint.cost)
        {
            UIManager.FlashText();
            return;
        }
        PlayerStats.Money -= blueprint.cost;



        GameObject _turret = (GameObject)Instantiate(blueprint.prefab, GetBuildPosition(), Quaternion.identity);

        _turret.AddComponent(typeof(Collision2D));
        turret = _turret;

        turretBlueprint = blueprint;
    }