Beispiel #1
0
    /// <summary>
    /// 必要リソースの読み込み
    /// </summary>
    private void Load(Action onCompleted)
    {
        var items = Masters.ShopGroupDB
                    .GetList()
                    .SelectMany(x1 => Masters.ShopDB.GetList().FindAll(x2 => x2.shopGroupId == x1.id))
                    .SelectMany(x1 => Masters.ShopItemDB.GetList().FindAll(x2 => x2.shopItemId == x1.shopItemId))
                    .Select(x => CommonIconUtility.GetItemInfo(x.itemType, x.itemId))
                    .Concat(Masters.BillingGroupDB
                            .GetList()
                            .SelectMany(x1 => Masters.BillingDB.GetList().FindAll(x2 => x2.billingGroupId == x1.id))
                            .SelectMany(x1 => Masters.BillingItemDB.GetList().FindAll(x2 => x2.billingItemId == x1.billingItemId))
                            .Select(x => CommonIconUtility.GetItemInfo(x.itemType, x.itemId)))
                    .Where(x => !x.IsCommonSprite())
                    .ToArray();

        foreach (var item in items)
        {
            if (item is Master.CannonSetData)
            {
                var cannonSet   = item as Master.CannonSetData;
                var batteryData = Masters.BatteryDB.FindById(cannonSet.batteryId);
                var barrelData  = Masters.BarrelDB.FindById(cannonSet.barrelId);
                var bulletData  = Masters.BulletDB.FindById(cannonSet.bulletId);
                var fvaData     = Masters.FvAttackDB.FindById(batteryData.fvAttackId);

                //砲台サムネロード
                this.assetLoader.Add <Sprite>(SharkDefine.GetTurretSetSpritePath(batteryData.key));

                //砲台パーツスプライトロード
                this.assetLoader.Add <Sprite>(SharkDefine.GetBatterySpritePath(batteryData.key));
                this.assetLoader.Add <Sprite>(SharkDefine.GetBarrelSpritePath(barrelData.key));
                this.assetLoader.Add <Sprite>(SharkDefine.GetBulletThumbnailPath(bulletData.key));

                //砲台パーツプレハブロード
                this.assetLoader.Add <GameObject>(SharkDefine.GetBatteryPrefabPath(batteryData.key));
                this.assetLoader.Add <GameObject>(SharkDefine.GetBarrelPrefabPath(barrelData.key));
                this.assetLoader.Add <BulletBase>(SharkDefine.GetBulletPrefabPath(bulletData.key));

                //FVAアイコンスプライトロード
                this.assetLoader.Add <Sprite>(SharkDefine.GetFvAttackTypeIconSpritePath((FvAttackType)fvaData.type));

                //シリーズスキルスプライトロード
                if (batteryData.seriesId == barrelData.seriesId && batteryData.seriesId == bulletData.seriesId)
                {
                    var serieseData      = Masters.TurretSerieseDB.FindById(batteryData.seriesId);
                    var serieseSkillData = Masters.SerieseSkillDB.FindById(serieseData.seriesSkillId);
                    this.assetLoader.Add <Sprite>(SharkDefine.GetSeriesSkillIconSpritePath(serieseSkillData.key));
                }
            }
            else
            {
                var spritePath = item.GetSpritePath();
                this.assetLoader.Add <Sprite>(spritePath);
            }
        }

        //読み込み開始
        this.assetLoader.Load(onCompleted);
    }
Beispiel #2
0
 string IItemInfo.GetSpritePath() => SharkDefine.GetTurretSetSpritePath(Masters.BatteryDB.FindById(this.batteryId).key);
Beispiel #3
0
 public override string GetSpritePath(string key)
 {
     return(SharkDefine.GetTurretSetSpritePath(key));
 }