public BulletPartsInfo(UserPartsData partsData) : base(partsData)
        {
            this.master = Masters.BulletDB.FindById(partsData.itemId);

            var gearCount = partsData.gearMasterIds.Length;

            // 装着中のギアの能力値
            for (int i = 0; i < gearCount; i++)
            {
                this.gearMaster = Masters.GearDB.FindById(partsData.gearMasterIds[i]);

                this.gearFvPointGetValue = +this.gearMaster.fvPoint;
                this.gearBulletSpeed    += this.gearMaster.speed;
                this.gearPower          += this.gearMaster.power;
            }
        }
示例#2
0
        public BulletPartsInfo(UserPartsData partsData) : base(partsData)
        {
            this.master = Masters.BulletDB.FindById(partsData.itemId);

            // 現在パーツと所有するパーツを比較の上、同数
            uint[] bulletIds = UserData.Get().bulletData.Select(x => x.itemId).ToArray();
            for (int i = 0; i < bulletIds.Length; i++)
            {
                var userPartsIds   = bulletIds[i].ToString();
                var currentPartsId = partsData.itemId.ToString();

                if (currentPartsId == userPartsIds)
                {
                    this.count++;
                }
            }
        }
    /// <summary>
    /// 報酬情報の設定
    /// </summary>
    public void SetInfo(uint itemType, uint itemId, uint itemNum)
    {
        var  itemInfo = CommonIconUtility.GetItemInfo(itemType, itemId);
        bool isCannon = true;
        var  config   = Masters.ConfigDB.FindById(1);

        switch ((ItemType)itemType)
        {
        case ItemType.CannonSet:
            var cannonSet = itemInfo as Master.CannonSetData;
            Master.BatteryData       batteryData  = Masters.BatteryDB.FindById(cannonSet.batteryId);
            Master.BarrelData        barrelData   = Masters.BarrelDB.FindById(cannonSet.barrelId);
            Master.BulletData        bulletData   = Masters.BulletDB.FindById(cannonSet.bulletId);
            Master.TurretSerieseData cannonSeries = Masters.TurretSerieseDB.FindById(batteryData.seriesId);

            this.nameText.text = cannonSeries.name;

            // ゲージセット
            SetStatusGauge(
                itemType,
                bulletData.power, config.maxBulletPower,
                barrelData.speed, config.maxBarrelSpeed,
                batteryData.fvPoint, config.maxBatteryFvPoint);
            isCannon = true;
            break;

        case ItemType.Gear:
            nameText.text = itemInfo.GetName();

            // ゲージセット
            var gear = itemInfo as Master.GearData;
            SetStatusGauge(
                itemType,
                gear.power, config.maxGearPower,
                gear.speed, config.maxGearSpeed,
                gear.fvPoint, config.maxGearFvPoint);
            isCannon = true;
            break;

        case ItemType.BattleItem:
            this.nameText.text = itemInfo.GetName() + string.Format("×{0}", itemNum);
            isCannon           = false;
            break;

        case ItemType.FreeGem:
            this.nameText.text = Masters.LocalizeTextDB.GetFormat("UnitGem", itemNum);
            isCannon           = false;
            break;

        case ItemType.Coin:
            this.nameText.text = Masters.LocalizeTextDB.GetFormat("UnitCoin", itemNum);
            isCannon           = false;
            break;

        default:
            Debug.LogError("到達報酬に想定外のItemTypeが指定されています   ItemType = " + (ItemType)itemType);
            return;
        }

        this.commonIcon.Set(itemInfo, false);
        //砲台系のコンテンツの表示・非表示切り替え
        cannonContent.SetActive(isCannon);
    }