//Bring the cursor back and freeze the player
 public void Sell()
 {
     if (_currentObject == null)
     {
         return;
     }
     _credits += _currentObject.GetPrice();
     _currentObject.TurnIntoEmpty();
     ReturnPlayerControl();
     _currentObject = null;
     _uiManager.ClosePopUp();
     _audioSource.PlayOneShot(_SfxSell);
 }
Ejemplo n.º 2
0
 public void SetUpPopUp(PurchasableObject _object)
 {
     if (_object.tag == "EmptyObject")
     {
         MainText.text = _object.buyText + " Buy it for " + _object.GetPrice() + " neurons?";
         BuyButton.gameObject.SetActive(true);
         SellButton.gameObject.SetActive(false);
     }
     else
     {
         MainText.text = _object.sellText + " Sell it for " + _object.GetPrice() + " neurons?";
         BuyButton.gameObject.SetActive(false);
         SellButton.gameObject.SetActive(true);
     }
 }