public void BuildTurret() { GameObject newTurret = Instantiate(turretPrefab, transform.position, transform.rotation); turret = newTurret.GetComponent <EmplacementTurret> (); turret.transform.SetParent(transform, true); }
public override void Purchase() { if (emplacement.turret) { OpenEmplacementMenu(emplacement); } else { EmplacementTurret turret = emplacement.turretPrefab.GetComponent <EmplacementTurret> (); if (PlayerInput.TryUseCredits(turret.Cost)) { emplacement.BuildTurret(); menu.Open(); } } }