Ejemplo n.º 1
0
    protected override void Awake()
    {
        base.Awake();
        base.SetEnabled(false);
        this.m_buttonText.Text = (SceneMgr.Get().GetMode() != SceneMgr.Mode.TAVERN_BRAWL) ? GameStrings.Get("GLUE_COLLECTION_NEW_DECK") : string.Empty;
        UIBScrollableItem component = base.GetComponent <UIBScrollableItem>();

        if (component != null)
        {
            component.SetCustomActiveState(new UIBScrollableItem.ActiveStateCallback(this.IsUsable));
        }
    }
    private void Awake()
    {
        if (this.m_deckBox != null)
        {
            this.m_deckBox.transform.localPosition    = CollectionDeckBoxVisual.POPPED_DOWN_LOCAL_POS;
            this.m_deckBox.transform.localScale       = new Vector3(0.95f, 0.95f, 0.95f);
            this.m_deckBox.transform.localEulerAngles = new Vector3(90f, 180f, 0f);
        }
        this.m_wasTouchModeEnabled = UniversalInputManager.Get().IsTouchMode();
        UIBScrollableItem component = base.GetComponent <UIBScrollableItem>();

        if (component != null)
        {
            component.SetCustomActiveState(new UIBScrollableItem.ActiveStateCallback(this.IsDeckBoxShown));
        }
    }
    protected override void Awake()
    {
        base.Awake();
        string     name = (UniversalInputManager.UsePhoneUI == null) ? "DeckCardBar" : "DeckCardBar_phone";
        GameObject obj2 = AssetLoader.Get().LoadActor(name, false, false);

        if (obj2 == null)
        {
            Debug.LogWarning(string.Format("DeckTrayDeckTileVisual.OnDeckTileActorLoaded() - FAILED to load actor \"{0}\"", name));
        }
        else
        {
            this.m_actor = obj2.GetComponent <CollectionDeckTileActor>();
            if (this.m_actor == null)
            {
                Debug.LogWarning(string.Format("DeckTrayDeckTileVisual.OnDeckTileActorLoaded() - ERROR game object \"{0}\" has no CollectionDeckTileActor component", name));
            }
            else
            {
                GameUtils.SetParent((Component)this.m_actor, (Component)this, false);
                this.m_actor.transform.localEulerAngles = new Vector3(0f, 180f, 0f);
                UIBScrollableItem component = this.m_actor.GetComponent <UIBScrollableItem>();
                if (component != null)
                {
                    component.SetCustomActiveState(new UIBScrollableItem.ActiveStateCallback(this.IsInUse));
                }
                this.SetUpActor();
                if (base.gameObject.GetComponent <BoxCollider>() == null)
                {
                    this.m_collider        = base.gameObject.AddComponent <BoxCollider>();
                    this.m_collider.size   = this.BOX_COLLIDER_SIZE;
                    this.m_collider.center = this.BOX_COLLIDER_CENTER;
                }
                this.Hide();
                SceneUtils.SetLayer(base.gameObject, LAYER);
                base.SetDragTolerance(5f);
            }
        }
    }
 public UnopenedPack AcquireDraggedPack()
 {
     if ((this.m_boosterStack.Id == 10) && !Options.Get().GetBool(Option.HAS_HEARD_TGT_PACK_VO, false))
     {
         Options.Get().SetBool(Option.HAS_HEARD_TGT_PACK_VO, true);
         NotificationManager.Get().CreateTirionQuote("VO_TIRION_INTRO_02", "VO_TIRION_INTRO_02", true);
     }
     if (this.m_draggedPack == null)
     {
         this.m_draggedPack = (UnopenedPack)UnityEngine.Object.Instantiate(this, base.transform.position, base.transform.rotation);
         TransformUtil.CopyWorldScale((Component)this.m_draggedPack, (Component)this);
         this.m_draggedPack.transform.parent = base.transform.parent;
         UIBScrollableItem component = this.m_draggedPack.GetComponent <UIBScrollableItem>();
         if (component != null)
         {
             component.m_active = UIBScrollableItem.ActiveState.Inactive;
         }
         this.m_draggedPack.m_creatorPack = this;
         this.m_draggedPack.gameObject.AddComponent <DragRotator>().SetInfo(this.m_DragRotatorInfo);
         this.m_draggedPack.m_DragStartEvent.Activate();
     }
     return(this.m_draggedPack);
 }