protected virtual void SellObject() { panel.Hide(); room.info.objectsInRoom.Remove(GetComponent <Constructible>()); if (objectToMerge != null && objectToMerge.GetComponent <SceneObject>()) { room.info.objectsInRoom.Remove(objectToMerge.GetComponent <Constructible>()); Destroy(objectToMerge.gameObject); } GameController.instance.player.resources.ChangeBalance(description.sellPrice); Destroy(gameObject); Abort(); }
public override void SetPanel() { if (constructor.isActive) { constructor.ConstructOFF(); } if (descriptionPanel.lastTouched.lvl >= 2) { upgradeBtn.interactable = false; return; } descriptionPanel.Hide(); gameObject.SetActive(true); GameController.instance.IsGameSceneEnabled = false; descriptionPanel.lastTouched.ConfirmUpgrade(this); }
/// <summary> /// Help Button On Click handler. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HelpButton_Click(object sender, EventArgs e) { // Keep focus on game this.ActiveControl = null; HelpButton.TabStop = false; // Enable or disable panel if (!HelpPanel.Visible) { HelpPanel.Show(); } else { HelpPanel.Hide(); } }
/// <summary> /// Constructor for the View. /// </summary> /// <param name="ctl"></param> public GameView(GameController ctl) { // Initalize InitializeComponent(); FormClosed += OnExit; theController = ctl; theWorld = theController.GetWorld(); HelpPanel.Hide(); // Register handlers for the controller's events theController.Error += ShowError; theController.UpdateArrived += OnFrame; theController.Connected += HandleConnected; // Set up key handlers this.KeyDown += HandleKeyDown; this.KeyUp += HandleKeyUp; }