public void Ok_Pressed() { IStreet street = this.streetPoint.GetPathByPosition(player.Position, streetPoint.GetGameObject()); GameEvents.Current.TicketSelection_Approved(null, new TicketEventArgs(player.Data.ID, selectedTicket, street)); this.gameObject.SetActive(false); UnselectAll(); }
private void Current_OnDestinationSelected(object sender, MovementEventArgs e) { this.player = e.Player; this.streetPoint = e.TargetPosition; foreach (TicketButton tb in ticketButtons) { tb.SetTicketCount(this.player.GetTicketCount(tb.GetTicket())); } IStreet street = this.streetPoint.GetPathByPosition(player.Position, streetPoint.GetGameObject()); var costs = street.Costs; foreach (TicketButton tb in ticketButtons) { if (tb.gameObject.activeSelf == true && !costs.Contains(tb.GetTicket())) { tb.gameObject.SetActive(false); } } this.gameObject.SetActive(true); }