/// <summary>
    /// 内容構築
    /// </summary>
    public void Set(TurretViewer turretViewerPrefab, ProductIcon icon, ProductBase product, SimpleDialog dialog, Action <UserBillingData, UserShopData, ProductIcon, ProductBase> onPurchaseCompleted, Action onNonPurchase)
    {
        base.Set(icon, product, dialog, onPurchaseCompleted, onNonPurchase);

        //砲台表示設定
        this.turretContent.SetInfo(product as ProductCannon, turretViewerPrefab);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 内容構築
    /// </summary>
    public virtual void Set(ProductIcon icon, ProductBase product, SimpleDialog dialog, Action <UserBillingData, UserShopData, ProductIcon, ProductBase> onPurchaseCompleted, Action onNonPurchase)
    {
        this.icon    = icon;
        this.product = product;
        this.dialog  = dialog;
        //現状では購入数の指定を行う仕様がないため、定数で設定
        this.buyNum = 1;

        this.onPurchaseCompleted = onPurchaseCompleted;
        this.onNonPurchase       = onNonPurchase;

        //確認メッセージ設定
        this.SetConfirmMessage();

        //コインコンテンツ設定
        this.SetCoinContent();

        //ジェムコンテンツ設定
        this.SetGemContent();

        if (this.product is ProductBilling)
        {
            //購入ボタンを表示
            this.PurchaseProduct();
        }
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 商品アイコンクリック時
    /// </summary>
    private void OnClickProductIcon(ProductBase product, ProductIcon icon)
    {
        //購入確認ダイアログ開く
        var dialog  = SharedUI.Instance.ShowSimpleDialog();
        var content = dialog.AddContent(this.purchaseConfirmDialogContentPrefab);

        content.Set(icon, product, dialog, this.OnPurchaseCompleted, null);
    }
    /// <summary>
    /// 内容構築
    /// </summary>
    public override void Set(ProductIcon icon, ProductBase product, SimpleDialog dialog, Action <UserBillingData, UserShopData, ProductIcon, ProductBase> onPurchaseCompleted, Action onNonPurchase)
    {
        base.Set(icon, product, dialog, onPurchaseCompleted, onNonPurchase);

        //CommonIcon表示構築
        this.commonIcon.Set(this.product.addItems[0].itemType, this.product.addItems[0].itemId, false);

        //商品説明
        this.productInfoText.text = this.product.description;
    }
Ejemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 private void DrawIcon(ProductIcon icon)
 {
     EditorGUILayout.BeginVertical();
     GUI.color = new Color(1.0f, 1.0f, 1.0f, icon.Alpha);
     if (GUILayout.Button(new GUIContent(icon.Icon, (!icon.Name.Contains("Opsive") ? "Click for info, screens & videos" : "View all of our Unity products")), "Label"))
     {
         icon.Open();
     }
     GUILayout.Label(icon.Name, IconLabelStyle);
     GUI.color = Color.white;
     EditorGUILayout.EndVertical();
 }
Ejemplo n.º 6
0
    public GameObject MakeIcon(Variant variant)
    {
        GameObject IconGO = Instantiate(ProductIconPrefab);

        IconGO.SetActive(false);

        ProductIcon icon = IconGO.GetComponent <ProductIcon>();

        icon.AddEventListener("onload", () => { ItemLoaded(); });
        AddLoadingItem();
        icon.Build(variant);

        icon.ClickBox.AddEventListener("onclick", () => {
            App.MoveToARView(variant.GetDefaultModelTexture());
        });

        return(IconGO);
    }
Ejemplo n.º 7
0
    /// <summary>
    /// 商品購入完了時コールバック
    /// </summary>
    private void OnPurchaseCompleted(
        UserBillingData userBillingData,
        UserShopData userShopData,
        ProductIcon icon,
        ProductBase product)
    {
        //商品購入成功通知
        (SceneChanger.currentScene as Battle.MultiBattleScene)?.RefleshCoinCount();

        //購入回数更新
        if (userShopData != null)
        {
            product.buyCount = userShopData.BuyNum;
        }
        else if (userBillingData != null)
        {
            product.buyCount = userBillingData.BuyNum;
        }

        //購入上限に達した
        if (product.isOverPurchaseLimit)
        {
            //商品をソート
            this.selectedTab.products = this.selectedTab.products
                                        .OrderBy(x => x.isOverPurchaseLimit ? 1 : 0)
                                        .ToArray();

            //スクロールビュー更新
            this.scrollView.Initialize(this.productIconPrefab.gameObject, this.selectedTab.products.Length, this.OnUpdateElement);
        }
        else
        {
            //購入回数のみ更新
            icon.SetPurchasesCountText(product.remainCount);
        }

        //購入完了ダイアログ表示
        var dialog  = SharedUI.Instance.ShowSimpleDialog();
        var content = dialog.AddContent(this.purchaseCompletedDialogContentPrefab);

        content.Set(product, dialog);
    }
Ejemplo n.º 8
0
 /// <summary>
 /// 
 /// </summary>
 private void DrawIcon(ProductIcon icon)
 {
     EditorGUILayout.BeginVertical();
     GUI.color = new Color(1.0f, 1.0f, 1.0f, icon.Alpha);
     if (GUILayout.Button(new GUIContent(icon.Icon, (!icon.Name.Contains("VisionPunk") ? "Click for info, screens & videos" : "View all of our Unity products")), "Label"))
         icon.Open();
     GUILayout.Label(icon.Name, IconLabelStyle);
     GUI.color = Color.white;
     EditorGUILayout.EndVertical();
 }