Exemplo n.º 1
0
    public void BuildTurret()
    {
        GameObject newTurret = Instantiate(turretPrefab, transform.position, transform.rotation);

        turret = newTurret.GetComponent <EmplacementTurret> ();
        turret.transform.SetParent(transform, true);
    }
Exemplo n.º 2
0
 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();
         }
     }
 }