public TAG_CLASS?GetFirstCardClass() { if (this.m_collectionCardVisuals.Count == 0) { return(null); } CollectionCardVisual visual = this.m_collectionCardVisuals[0]; if (!visual.IsShown()) { return(null); } Actor actor = visual.GetActor(); if (!actor.IsShown()) { return(null); } EntityDef entityDef = actor.GetEntityDef(); if (entityDef == null) { return(null); } return(new TAG_CLASS?(entityDef.GetClass())); }
public bool GrabCard(CollectionCardVisual cardVisual) { Actor actor = cardVisual.GetActor(); if (!this.CanGrabItem(actor)) { return(false); } if (!this.m_heldCardVisual.ChangeActor(actor, cardVisual.GetVisualType())) { return(false); } this.m_scrollBar.Pause(true); PegCursor.Get().SetMode(PegCursor.Mode.DRAG); CollectionCardBack component = actor.GetComponent <CollectionCardBack>(); this.m_heldCardVisual.SetSlot(null); if (component != null) { this.m_heldCardVisual.SetCardBackId(component.GetCardBackId()); } this.m_heldCardVisual.transform.position = actor.transform.position; this.m_heldCardVisual.Show(this.m_mouseIsOverDeck); SoundManager.Get().LoadAndPlay("collection_manager_pick_up_card", this.m_heldCardVisual.gameObject); return(true); }