Esempio n. 1
0
    public void SetSpecialStageItem(
        SpecialStageLifetimeVg specialStage, LevelSelectCreator levelSelect, SpecialStageSelectButton selectStageButton)
    {
        this.specialStageVG           = specialStage;
        this.levelSelectCreator       = levelSelect;
        this.specialStageSelectButton = selectStageButton;

        PurchaseWithVirtualItem purchaseType = (PurchaseWithVirtualItem)specialStage.PurchaseType;

        this.Message.text = string.Format("Would you like to purchase this stage for {0} tokens?", purchaseType.Amount);
    }
Esempio n. 2
0
    private void CreateSpecialStageButtons()
    {
        UIPanel uiPanel     = this.StageSelectScrollViewer.GetComponent <UIPanel>();
        Vector2 viewSize    = uiPanel.GetViewSize();
        int     buttonWidth = (int)viewSize.x - this.StageSelectButtonTrimSize;

        foreach (VirtualGood virtualGood in ShopManager.VirtualGoods)
        {
            SpecialStage readSpecialStage = SpecialStageXmlIo.ReadSpecialStage(virtualGood.ItemId);

            GameObject item = NGUITools.AddChild(this.StageSelectGrid.gameObject, this.SpecialStageSelectButton);

            SpecialStageSelectButton stageSelectButton = item.GetComponent <SpecialStageSelectButton>();

            if (stageSelectButton != null)
            {
                stageSelectButton.SetStage(
                    this,
                    readSpecialStage,
                    this.StageSelectOverrideActivateTarget,
                    this.StageSelectOverrideDeactivateTarget,
                    this.PurchaseStagePopUp,
                    this.RewardOnlyStagePopUp);
            }

            UIWidget uiWidget = item.GetComponent <UIWidget>();

            if (uiWidget != null)
            {
                uiWidget.SetDimensions(buttonWidth, uiWidget.height);
            }
        }

        this.StageSelectGrid.enabled       = true;
        this.StageSelectGrid.repositionNow = true;

        UIScrollView scrollView = this.StageSelectScrollViewer.GetComponent <UIScrollView>();

        scrollView.enabled = true;
        scrollView.ResetPosition();

        this.refreshGrid = true;
    }