コード例 #1
0
    /// <summary>
    /// 砲台枠拡張、ダイアログセット
    /// </summary>
    public void Set(SimpleDialog dialog, SimpleDialogButton expansionButton, uint needGem, uint maxPossession, uint nextMaxPossession)
    {
        // 消費確認テキスト
        this.confirmText.text = Masters.LocalizeTextDB.GetFormat("PlusCannonPossessionQuestion", needGem, nextMaxPossession);
        // 現在の砲台枠
        this.beforeCannonCount.text = maxPossession.ToString();
        // 購入後、砲台枠
        this.afterCannonCount.text = nextMaxPossession.ToString();

        UserData userData = UserData.Get();

        // Beforeジェム
        gemContent.BeforeTotalGemText  = userData.totalGem.ToString("#,0");
        gemContent.BeforeChargeGemText = userData.chargeGem.ToString("#,0");
        // Afterジェム
        // gemContent.AfterTotalGemText = (userData.totalGem - needGem).ToString("#,0");
        // gemContent.AfterChargeGemText = userData.chargeGem.ToString("#,0");

        PaymentGem(userData, needGem, 0);

        if (needGem > userData.totalGem)
        {
            //ボタンの設定
            expansionButton.text.text = Masters.LocalizeTextDB.Get("Back");
            expansionButton.onClick   = dialog.Close;
        }
    }
コード例 #2
0
    /// <summary>
    /// データセット
    /// </summary>
    public void Set(uint partType, uint utilityId, SimpleDialog dialog, SimpleDialogButton expansionButton)
    {
        // 拡張時必要ジェム
        uint needGem = 0;
        // 拡張されるスロットの数
        uint expansionValue = 0;
        // ローカライジング·テキスト
        var localize = Masters.LocalizeTextDB;
        // ユーザーデータ
        UserData userData = UserData.Get();

        // タイプがギアの場合
        if (partType == (uint)ItemType.Gear)
        {
            // 現在ID、マスター
            this.gearMaster = Masters.GearExpansionDB.FindById(utilityId);
            // 次のID、マスター
            var nextGearMatser = Masters.GearExpansionDB.FindById(this.gearMaster.nextId);

            // 拡張時必要ジェム
            needGem = this.gearMaster.needGem;
            // 拡張されるスロットの数
            expansionValue = nextGearMatser.maxPossession - this.gearMaster.maxPossession;

            // 質問テキスト
            this.questionText.text = localize.GetFormat("PlusGearPossessionQuestion", needGem, expansionValue);
            // ギアタイプ名前
            this.itemTypeNametext.text = localize.Get("PlusGearPossession");

            // 現在の所持制限テキスト
            this.beforePossessionCount.text = this.gearMaster.maxPossession.ToString();
            // 拡張後の所持制限テキスト
            this.afterPossessionCount.text = nextGearMatser.maxPossession.ToString();

            // Beforeジェム
            this.gemContent.BeforeTotalGemText  = userData.totalGem.ToString("#,0");
            this.gemContent.BeforeChargeGemText = userData.chargeGem.ToString("#,0");
            // Afterジェム
            this.PaymentGem(userData, needGem, 0);

            // ジェムがない場合戻る
            if (needGem > userData.totalGem)
            {
                //ボタンの設定
                expansionButton.text.text = Masters.LocalizeTextDB.Get("Back");
                expansionButton.onClick   = dialog.Close;
            }
        }
        // タイプがパーツの場合
        else
        {
            // 現在ID、マスター
            this.partsMaster = Masters.PartsExpansionDB.FindById(utilityId);
            // 次のID、マスター
            var nextPartMaster = Masters.PartsExpansionDB.FindById(this.partsMaster.nextId);

            // 拡張時必要ジェム
            needGem = this.partsMaster.needGem;
            // 拡張されるスロットの数
            expansionValue = nextPartMaster.maxPossession - this.partsMaster.maxPossession;

            // パーツタイプ名前
            this.itemTypeNametext.text = localize.Get("PlusPartsPossession");
            // 質問テキスト
            this.questionText.text = localize.GetFormat("PlusPartsPossessionQuestion", needGem, expansionValue);

            // 現在の所持制限テキスト
            this.beforePossessionCount.text = this.partsMaster.maxPossession.ToString();
            // 拡張後の所持制限テキスト
            this.afterPossessionCount.text = nextPartMaster.maxPossession.ToString();

            // Beforeジェム
            this.gemContent.BeforeTotalGemText  = userData.totalGem.ToString("#,0");
            this.gemContent.BeforeChargeGemText = userData.chargeGem.ToString("#,0");
            // Afterジェム
            this.PaymentGem(userData, needGem, 0);

            // ジェムがない場合戻る
            if (needGem > userData.totalGem)
            {
                //ボタンの設定
                expansionButton.text.text = Masters.LocalizeTextDB.Get("Back");
                expansionButton.onClick   = dialog.Close;
            }
        }
    }