/// <summary> /// ロード /// </summary> private void Load() { //ワールドID順に並び変えておく this.response.tSingleWorld = this.response.tSingleWorld.OrderBy(x => x.worldId).ToArray(); //ワールドデータ this.worldData = new WorldData[this.response.tSingleWorld.Length]; for (int i = 0; i < this.worldData.Length; i++) { uint worldId = this.response.tSingleWorld[i].worldId; this.worldData[i] = new WorldData(); this.worldData[i].worldServerData = this.response.tSingleWorld[i]; this.worldData[i].worldMasterData = Masters.SingleWorldDB.FindById(worldId); this.worldData[i].stageMasterData = Masters.SingleStageDB.GetList().Where(x => x.worldId == worldId).ToArray(); } for (int i = 0; i < this.worldData.Length; i++) { /*uint worldId = this.response.tSingleWorld[i].worldId; * this.worldData[i] = new WorldData(); * this.worldData[i].worldServerData = this.response.tSingleWorld[i]; * this.worldData[i].worldMasterData = Masters.SingleWorldDB.FindById(worldId); * this.worldData[i].stageMasterData = Masters.SingleStageDB.GetList().Where(x => x.worldId == worldId).ToArray();*/ this.worldData[i].stageServerData = this.worldData[i].stageMasterData .Select(stageMaster => { var result = this.response.tSingleStage.FirstOrDefault(stageServer => stageServer.stageId == stageMaster.id); if (result == null) { result = new SinglePlayApi.TSingleStage(); result.stageId = stageMaster.id; result.stageStatus = (uint)SinglePlayApi.Status.NotOpen; result.clearRank = (uint)Rank.None; } else if (stageMaster.type == (uint)Master.SingleStageData.StageType.Battle && result.IsOpen()) { this.loader.Add <Sprite>(SharkDefine.GetSingleStageIconSpritePath(stageMaster.key)); } return(result); }) .ToArray(); if (this.worldData[i].worldMasterData.isComingSoon > 0) { //ComingSoonワールドの場合、ComingSoonじゃないワールドの背景を利用する var prev = this.worldData.Last(x => x.worldMasterData.isComingSoon == 0); this.worldData[i].bgAssetLoader = prev.bgAssetLoader; } else { //背景の読み込み string bgPath = SharkDefine.GetStageSelectBgSpritePath(this.worldData[i].worldMasterData.key); this.loader.Add(this.worldData[i].bgAssetLoader = new AssetLoader <Sprite>(bgPath)); } } //ロード実行 this.loader.Load(this.OnLoaded); }
/// <summary> /// Init /// </summary> protected void Init(uint batteryId, uint barrelId, uint bulletId) { this.batteryData = Masters.BatteryDB.FindById(batteryId); this.barrelData = Masters.BarrelDB.FindById(barrelId); this.bulletData = Masters.BulletDB.FindById(bulletId); this.fvAttackData = Masters.FvAttackDB.FindById(this.batteryData.fvAttackId); this.turretBase.batteryKey = this.batteryData.key; this.turretBase.barrelKey = this.barrelData.key; this.turretBase.bulletKey = this.bulletData.key; this.loader.Add<GameObject>(SharkDefine.GetBatteryPrefabPath(this.turretBase.batteryKey)); this.loader.Add<GameObject>(SharkDefine.GetBarrelPrefabPath(this.turretBase.barrelKey)); this.loader.Add<BulletBase>(SharkDefine.GetBulletPrefabPath(this.turretBase.bulletKey)); this.fvaAsset = this.loader.Add<FvAttackBase>(SharkDefine.GetFvAttackPrefabPath((FvAttackType)this.fvAttackData.type)); this.fvaBulletAsset = this.loader.Add<BulletBase>(SharkDefine.GetFvAttackBulletPrefabPath(this.fvAttackData.key)); this.loader.Add<Sprite>(SharkDefine.GetFvAttackTypeIconSpritePath((FvAttackType)this.fvAttackData.type)); this.loader.Add<AudioClip>(SharkDefine.GetSeClipPath(this.barrelData.seName)); this.loader.Add<AudioClip>(SharkDefine.GetSeClipPath(this.bulletData.seName)); string fvAttackSeName = SeName.FvAttackSeName[(int)this.fvAttackData.type]; if (!string.IsNullOrEmpty(fvAttackSeName)) { this.loader.Add<AudioClip>(SharkDefine.GetSeClipPath(fvAttackSeName)); } if (this.fvAttackData.type == (uint)FvAttackType.Penetration) { this.fvaPenetrationChargeEffectAsset = this.loader.Add<GameObject>(SharkDefine.GetFVAChargeEffectPrefabPath(this.fvAttackData.key)); } }
/// <summary> /// セットアップ /// </summary> private void Setup(SimpleDialog dialog, List <FishDataEx> fishDataList, AssetListLoader loader, Master.ModelBase master) { this.dialog = dialog; this.fishDataList = fishDataList; this.loader = loader; //シングルモード内容構築 if (master is Master.SingleStageData) { var stageData = master as Master.SingleStageData; //ワールド名 this.worldNameText.text = Masters.SingleWorldDB.FindById(stageData.worldId).name; //ステージ名 this.stageNameText.text = stageData.name; //特殊魚マーク表示OFF this.focusedFishSubTextBg.gameObject.SetActive(false); // シングルワールドマスターデータキー var worldKey = Masters.SingleWorldDB.FindById(stageData.worldId).key; // 図鑑の背景イメージ、パース string spritePath = SharkDefine.GetZukanBgSpritePath(worldKey); // 図鑑の背景イメージ、ロード this.worldBgImage.sprite = this.loader[spritePath].handle.asset as Sprite; } //マルチモード内容構築 else if (master is Master.MultiWorldData) { var worldData = master as Master.MultiWorldData; //ワールド名 this.worldNameText.text = worldData.name; //ステージ名非表示 this.stageNameText.gameObject.SetActive(false); // 図鑑の背景イメージ、パース string spritePath = SharkDefine.GetZukanBgSpritePath(worldData.key); // 図鑑の背景イメージ、ロード this.worldBgImage.sprite = this.loader[spritePath].handle.asset as Sprite; } //ダイアログタイトル「図鑑」 this.dialog.titleText.text = Masters.LocalizeTextDB.Get("Dictionary"); //Closeボタン表示ON this.dialog.closeButtonEnabled = true; //ワールド名、ステージ名の幅に合わせてレイアウト調整 LayoutRebuilder.ForceRebuildLayoutImmediate(this.nameArea); //初期フォーカス魚設定 if (this.fishDataList.Count > 0) { this.SetFocusedFish(this.fishDataList[0]); } //スクロールビュー構築 this.scrollView.Initialize( this.thumbnailIconPrefab.gameObject, this.fishDataList.Count, this.OnUpdateFishThumbnailIconView ); }
/// <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); }
/// <summary> /// FVA情報の設定 /// </summary> public void SetFVAInfo(uint fvaId) { var fvaData = Masters.FvAttackDB.FindById(fvaId); this.iconImage.sprite = AssetManager.FindHandle <Sprite>(SharkDefine.GetFvAttackTypeIconSpritePath((FvAttackType)fvaData.type)).asset as Sprite; this.nameText.text = fvaData.name; this.descriptionText.text = fvaData.description; }
/// <summary> /// アイコン差し替え /// </summary> public void RefleshIconSprite() { var batteryData = Masters.BatteryDB.FindById(userData.turretData.batteryMasterId); var fvAttackData = Masters.FvAttackDB.FindById(batteryData.fvAttackId); var iconSpritePath = SharkDefine.GetFvAttackTypeIconSpritePath((FvAttackType)fvAttackData.type); var iconSpriteHandle = AssetManager.FindHandle <Sprite>(iconSpritePath); this.typeIconImage.sprite = iconSpriteHandle.asset as Sprite; }
/// <summary> /// セットアップ /// </summary> public void Setup(FishDataEx fishData, bool isSelected, Action <FishThumbnailIcon> onClick) { //選択中マーク this.selectedImage.enabled = isSelected; if (this.fishData == fishData) { return; } this.fishData = fishData; //魚の名前 this.nameText.text = this.fishData.Item1.name; //クリック時コールバック設定 this.onClick = onClick; //特殊魚かどうか bool isSpecialFish = false; //マルチモードの場合 if (this.fishData.Item2 is Master.MultiStageFishData) { var multiFishStatus = this.fishData.Item2 as Master.MultiStageFishData; if (isSpecialFish = multiFishStatus.specialFishId > 0) { this.subText.text = Masters.LocalizeTextDB.Get("Special"); } else { this.subText.text = Masters.LocalizeTextDB.GetFormat("Rate", multiFishStatus.rate * 0.01f); } } //特殊魚の場合赤い下地 if (isSpecialFish) { this.bgImage.sprite = SharedUI.Instance.commonAtlas.GetSprite("CmFrm_010_0033"); this.shadowImage.sprite = SceneChanger.currentScene.sceneAtlas.GetSprite("SsCm_020_0003"); this.frameImage.sprite = SceneChanger.currentScene.sceneAtlas.GetSprite("SsCm_020_0004"); } //普通魚の場合青い下地 else { this.bgImage.sprite = SharedUI.Instance.commonAtlas.GetSprite("CmFrm_010_0030"); this.shadowImage.sprite = SceneChanger.currentScene.sceneAtlas.GetSprite("SsCm_020_0001"); this.frameImage.sprite = SceneChanger.currentScene.sceneAtlas.GetSprite("SsCm_020_0002"); } //スプライトのパス string spritePath = SharkDefine.GetFishThumbnailSpritePath(this.fishData.Item1.key); //ロード済みのはずのスプライトでセット this.thumbnailImage.sprite = AssetManager.FindHandle <Sprite>(spritePath).asset as Sprite; }
/// <summary> /// シリーズスキル情報の設定 /// </summary> public void SetSerieseSkillInfo(uint seriesId) { var serieseData = Masters.TurretSerieseDB.FindById(seriesId); var serieseSkillData = Masters.SerieseSkillDB.FindById(serieseData.seriesSkillId); //砲台ページのセットスキル名、説明文、アイコン画像設定 this.iconImage.sprite = AssetManager.FindHandle <Sprite>(SharkDefine.GetSeriesSkillIconSpritePath(serieseSkillData.key)).asset as Sprite; this.nameText.text = serieseSkillData.name; this.descriptionText.text = serieseSkillData.description; }
/// <summary> /// 開く /// </summary> public static void Open(SingleStageFishDictionaryDialogContent prefab, Master.ModelBase master) { List <FishDataEx> fishDataList = null; string worldKey = null; //シングルモードの場合 if (master is Master.SingleStageData) { var stageData = master as Master.SingleStageData; fishDataList = Masters.SingleStageFishDB .GetList() .Where(x => x.stageId == stageData.id) .Select(x => new FishDataEx(Masters.FishDB.FindById(x.fishId), x)) .ToList(); worldKey = Masters.SingleWorldDB.FindById(stageData.worldId).key; } //マルチモードの場合 else if (master is Master.MultiWorldData) { var worldData = master as Master.MultiWorldData; fishDataList = Masters.MultiStageFishDB .GetList() .Where(x => x.worldId == worldData.id) .Select(x => new FishDataEx(Masters.FishDB.FindById(x.fishId), x)) .ToList(); worldKey = worldData.key; } var loader = new AssetListLoader(fishDataList.Select(x => new AssetLoader <Sprite>(SharkDefine.GetFishThumbnailSpritePath(x.Item1.key)))); loader.Add <Sprite>(SharkDefine.GetZukanBgSpritePath(worldKey)); //ロード中のタッチブロック SharedUI.Instance.DisableTouch(); //ロード loader.Load(() => { //タッチブロック解除 SharedUI.Instance.EnableTouch(); //ダイアログ開く var dialog = SharedUI.Instance.ShowSimpleDialog(); var content = dialog.AddContent(prefab); content.Setup(dialog, fishDataList, loader, master); }); }
/// <summary> /// 弾丸生成 /// </summary> private void CreateBullet(BulletDto data) { var prefab = data.isNormalBullet ? this.turretBase.bulletPrefab : AssetManager.FindHandle <BulletBase>(SharkDefine.GetFvAttackBulletPrefabPath(this.fvAttackData.key)).asset as BulletBase; data.bulletBase = this.turretBase.CreateBullet(prefab, BattleGlobal.instance.bulletArea); data.bulletBase.gameObject.AddComponent <BulletBouncing>(); data.bulletBase.movement.timeStamp = data.timeStamp; data.bulletBase.movement.speed = data.speed; data.bulletBase.transform.localPosition = this.cachedTransform.localRotation * data.bulletLocalPosition; data.bulletBase.transform.rotation = this.cachedTransform.localRotation * Quaternion.Euler(data.bulletLocalEulerAngles); data.bulletBase.SetParticleLayer(BattleGlobal.instance.bulletCanvas); this.bulletList.Add(data); }
/// <summary> /// 内容構築 /// </summary> public void Set( Master.SingleStageData master, SinglePlayApi.TSingleStage server, int battleStageIndex, bool isLastStage, Action <SingleStagePanel> onClick) { this.master = master; this.server = server; this.onClick = onClick; //解放済みかどうかでボタンとして押せるか押せないか切り替え this.button.interactable = this.isOpen; //状態による表示切替 this.battleBase.gameObject.SetActive(this.isBattle); this.storyBase.gameObject.SetActive(this.isStory); this.lockImage.enabled = !this.isOpen; this.fishImage.enabled = this.isOpen; this.starMarkGroup.SetActive(this.isOpen); //クリアランクでの星数表示 if (this.starMarkGroup.activeInHierarchy) { for (int i = 0; i < this.starMarks.Length; i++) { this.starMarks[i].enabled = i < (int)this.server.clearRank - 2; } } //ロックの場合グレースケール表示 foreach (var graphic in this.grayScaleTargets) { graphic.material = this.isOpen ? null : SharedUI.Instance.grayScaleMaterial; } //最終ステージ以外はラインを表示 this.line.SetActive(!isLastStage); //バトルステージ番号 this.stageNoText.text = (battleStageIndex < 0) ? null : (battleStageIndex + 1).ToString(); if (this.isBattle && this.isOpen) { //バトルステージの魚アイコン切り替え this.fishImage.sprite = AssetManager.FindHandle <Sprite>(SharkDefine.GetSingleStageIconSpritePath(this.master.key)).asset as Sprite; } }
/// <summary> /// ロード /// </summary> public void Load(Action onLoaded) { //アイコンスプライト string spritePath = SharkDefine.GetBattleItemIconSpritePath(this.itemMaster.key); this.loader.Add <Sprite>(spritePath); //アイテム使用時SE var item = this.skillGroupManager.Find(x => x is SkillBattleItemBase) as SkillBattleItemBase; if (item != null) { this.loader.Add <AudioClip>(SharkDefine.GetSeClipPath(item.seName)); } //ロード this.loader.Load(onLoaded); }
/// <summary> /// ロード /// </summary> private void Load() { //ワールドID順に並び変えておく this.scene.response.tMultiWorld = this.scene.response.tMultiWorld.OrderBy(x => x.multiWorldId).ToArray(); this.scene.response.tMultiJackpot = this.scene.response.tMultiJackpot.OrderBy(x => x.worldId).ToArray(); this.scene.response.tMultiSoulBall = this.scene.response.tMultiSoulBall.OrderBy(x => x.worldId).ToArray(); //ワールドデータ this.scene.worldData = new WorldData[this.scene.response.tMultiWorld.Length]; for (int i = 0; i < this.scene.worldData.Length; i++) { uint worldId = this.scene.response.tMultiWorld[i].multiWorldId; this.scene.worldData[i] = new WorldData(); this.scene.worldData[i].worldServerData = this.scene.response.tMultiWorld[i]; this.scene.worldData[i].worldMasterData = Masters.MultiWorldDB.FindById(worldId); this.scene.worldData[i].worldJackpotInfoData = this.scene.response.tMultiJackpot[i]; // tMultiSoulBallの配列の長さチェック if (i < this.scene.response.tMultiSoulBall.Length) { this.scene.worldData[i].multiSoulBallData = this.scene.response.tMultiSoulBall[i]; } } for (int i = 0; i < this.scene.worldData.Length; i++) { if (this.scene.worldData[i].worldMasterData.isComingSoon > 0) { //ComingSoonワールドの場合、ComingSoonじゃないワールドの背景を利用する var prev = this.scene.worldData.Last(x => x.worldMasterData.isComingSoon == 0); this.scene.worldData[i].bgAssetLoader = prev.bgAssetLoader; } else { //背景の読み込み string bgPath = SharkDefine.GetStageSelectBgSpritePath(this.scene.worldData[i].worldMasterData.key); this.scene.loader.Add(this.scene.worldData[i].bgAssetLoader = new AssetLoader <Sprite>(bgPath)); } } //ロード実行 this.scene.loader.Load(this.OnLoaded); }
/// <summary> /// Start /// </summary> private void Start() { //アイコンスプライトセット string spritePath = SharkDefine.GetBattleItemIconSpritePath(this.itemMaster.key); this.icon.iconImage.enabled = true; this.icon.SetIconSprite(this.loader[spritePath].handle.asset as Sprite); //所持数テキスト更新 this.RefleshStockCountText(); //ボタンの有効無効更新 this.RefleshButtonInteractable(); //スキルによるアイテム再使用間隔の短縮 float shortenCoolTime = BattleGlobal.instance.userData.skill.ShortenCoolTime(); //Debug.LogFormat("アイテムID{0}:{1} 再使用間隔{2}秒。スキル効果で{3}秒短縮します。", this.itemMaster.id, this.itemMaster.name, this.maxCoolTime, shortenCoolTime); this.maxCoolTime = Mathf.Max(0f, this.maxCoolTime - shortenCoolTime); }
/// <summary> /// construct /// </summary> public Loader(uint fishId, string key) { this.Add<GameObject>(SharkDefine.GetFishFbxPath(key)); this.Add<RuntimeAnimatorController>(SharkDefine.GetFishAnimatorControllerPath(key)); this.Add<FishColliderData>(SharkDefine.GetFishColliderDataPath(key)); var particles = Masters.FishParticleDB.GetList().FindAll(x => x.fishId == fishId); if (particles != null && particles.Count > 0) { this.particleDatas = new List<(string, IAssetLoader)>(); for (int i = 0; particles != null && i < particles.Count; i++) { this.particleDatas.Add(( attachingPosition: particles[i].attachingPosition, assetLoader: this.Add<GameObject>(SharkDefine.GetFishParticlePath(key, particles[i].particleName)) )); } } }
/// <summary> /// 開く /// </summary> public static void Open(UserInformationDialogContent contentPrefab, TurretViewer turretViewerPrefab) { var selectedTurret = UserData.Get().GetSelectedTurretData(); var batteryData = Masters.BatteryDB.FindById(selectedTurret.batteryMasterId); var barrelData = Masters.BarrelDB.FindById(selectedTurret.barrelMasterId); var bulletData = Masters.BulletDB.FindById(selectedTurret.bulletMasterId); var loader = new AssetListLoader(); loader.Add <GameObject>(SharkDefine.GetBatteryPrefabPath(batteryData.key)); loader.Add <GameObject>(SharkDefine.GetBarrelPrefabPath(barrelData.key)); loader.Add <BulletBase>(SharkDefine.GetBulletPrefabPath(bulletData.key)); //ロード中はタッチブロック SharedUI.Instance.DisableTouch(); //ロード loader.Load(() => { //タッチブロック解除 SharedUI.Instance.EnableTouch(); //砲台表示 var turretViewer = Instantiate(turretViewerPrefab, null, false); turretViewer.BatteryKey = batteryData.key; turretViewer.BarrelKey = barrelData.key; turretViewer.BulletKey = bulletData.key; turretViewer.Reflesh(); turretViewer.StartShot(); //ダイアログ開く var dialog = SharedUI.Instance.ShowSimpleDialog(); dialog.closeButtonEnabled = true; dialog.titleText.text = Masters.LocalizeTextDB.Get("UserInformation"); var content = dialog.AddContent(contentPrefab); content.Set(loader, turretViewer); }); }
/// <summary> /// フォーカス中魚をセットする /// </summary> private void SetFocusedFish(FishDataEx fishData) { this.focusedFishData = fishData; //魚の名前 this.focusedFishNameText.text = fishData.Item1.name; //魚の説明文 this.focusedFishDescriptionText.text = fishData.Item1.description; //マルチ魚だったら if (fishData.Item2 is Master.MultiStageFishData) { var multiFishStatus = fishData.Item2 as Master.MultiStageFishData; if (multiFishStatus.specialFishId > 0) { //特殊魚の場合「特殊」表示 this.focusedFishSubTextBg.sprite = SceneChanger.currentScene.sceneAtlas.GetSprite("SsCm_020_0011"); this.focusedFishSubText.text = Masters.LocalizeTextDB.Get("Special"); this.focusedFishSubText.color = this.specialFishTextColor; } else { //普通魚の場合「{0}倍」表示 this.focusedFishSubTextBg.sprite = SceneChanger.currentScene.sceneAtlas.GetSprite("SsCm_020_0010"); this.focusedFishSubText.text = Masters.LocalizeTextDB.GetFormat("Rate", multiFishStatus.rate * 0.01f); this.focusedFishSubText.color = this.normalFishTextColor; } } //スプライトのパス string spritePath = SharkDefine.GetFishThumbnailSpritePath(this.focusedFishData.Item1.key); //スプライトセット this.focusedFishImage.sprite = this.loader[spritePath].handle.asset as Sprite; }
/// <summary> /// ロード /// </summary> public void Load(Action onLoaded = null) { if (this.loader.GetStatus() == AssetListLoader.Status.Empty) { Master.FishData[] whaleMasters = { Masters.FishDB.FindById(100062), //1段階目 Masters.FishDB.FindById(101062), //2段階目 Masters.FishDB.FindById(102062), //3段階目 Masters.FishDB.FindById(103062), //1段階目 Masters.FishDB.FindById(104062), //2段階目 Masters.FishDB.FindById(105062), //3段階目 }; this.fishLoader = new Battle.Fish.Loader[3]; this.fishLoader[0] = new Battle.Fish.Loader(whaleMasters[0].id, whaleMasters[0].key); //1段階目 this.fishLoader[1] = new Battle.Fish.Loader(whaleMasters[1].id, whaleMasters[1].key); //2段階目 this.fishLoader[2] = new Battle.Fish.Loader(whaleMasters[2].id, whaleMasters[2].key); //3段階目 this.slotWhaleLoader = new Battle.Fish.Loader[3]; this.slotWhaleLoader[0] = new Battle.Fish.Loader(whaleMasters[3].id, whaleMasters[3].key); //1段階目 this.slotWhaleLoader[1] = new Battle.Fish.Loader(whaleMasters[4].id, whaleMasters[4].key); //2段階目 this.slotWhaleLoader[2] = new Battle.Fish.Loader(whaleMasters[5].id, whaleMasters[5].key); //3段階目 this.loader.AddRange(this.fishLoader.SelectMany(x => x)); this.loader.AddRange(this.slotWhaleLoader.SelectMany(x => x)); this.loader.Add <AudioClip>(SharkDefine.GetSeClipPath(SeName.BALL_DROP)); this.loader.Add <AudioClip>(SharkDefine.GetSeClipPath(SeName.BALL_GET)); this.loader.Add <AudioClip>(SharkDefine.GetSeClipPath(SeName.SOUL_DROP)); this.loader.Add <AudioClip>(SharkDefine.GetSeClipPath(SeName.SOUL_GET)); this.loader.Add <AudioClip>(SharkDefine.GetSeClipPath(SeName.SOUL_COMP)); this.loader.Add <AudioClip>(SharkDefine.GetSeClipPath(SeName.WHALE_SLOT)); this.loader.Add <AudioClip>(SharkDefine.GetSeClipPath(SeName.SLOT_STOP)); this.loader.Load(onLoaded); } }
/// <summary> /// ロード /// </summary> private void Load() { uint[] batteryIds = UserData.Get().batteryData.Select(x => x.itemId).Distinct().ToArray(); uint[] barrelIds = UserData.Get().barrelData.Select(x => x.itemId).Distinct().ToArray(); uint[] bulletIds = UserData.Get().bulletData.Select(x => x.itemId).Distinct().ToArray(); uint[] accessoryIds = UserData.Get().accessoriesData.Select(x => x.itemId).Distinct().ToArray(); uint[] fvAttackTypes = null; uint[] seriesSkillIds = null; uint[] gearIds = UserData.Get().gearData.Select(x => x.gearId).Distinct().ToArray(); var fvAttackIds = new List <uint>(); var seriesIds = new List <uint>(); foreach (uint id in batteryIds) { //台座スプライトのロード var data = Masters.BatteryDB.FindById(id); this.assetLoader.Add <Sprite>(SharkDefine.GetBatterySpritePath(data.key)); this.assetLoader.Add <GameObject>(SharkDefine.GetBatteryPrefabPath(data.key)); //FVアタックIDを詰める fvAttackIds.Add(data.fvAttackId); //シリーズIDを詰める seriesIds.Add(data.seriesId); } foreach (uint id in barrelIds) { //砲身スプライトのロード var data = Masters.BarrelDB.FindById(id); this.assetLoader.Add <Sprite>(SharkDefine.GetBarrelSpritePath(data.key)); this.assetLoader.Add <GameObject>(SharkDefine.GetBarrelPrefabPath(data.key)); //シリーズIDを詰める seriesIds.Add(data.seriesId); } foreach (uint id in bulletIds) { //砲弾プレハブ、砲弾サムネイルのロード var data = Masters.BulletDB.FindById(id); this.assetLoader.Add <Sprite>(SharkDefine.GetBulletThumbnailPath(data.key)); this.assetLoader.Add <BulletBase>(SharkDefine.GetBulletPrefabPath(data.key)); //シリーズIDを詰める seriesIds.Add(data.seriesId); } foreach (uint id in accessoryIds) { //アクセサリサムネイルのロード var data = Masters.AccessoriesDB.FindById(id); this.assetLoader.Add <Sprite>(SharkDefine.GetAccessoryThumbnailPath(data.key)); } //FVアタックIDからFVアタックタイプに fvAttackTypes = fvAttackIds .Distinct() .Select(id => Masters.FvAttackDB.FindById(id).type) .Distinct() .ToArray(); foreach (uint type in fvAttackTypes) { //FVアタックタイプアイコンのロード this.assetLoader.Add <Sprite>(SharkDefine.GetFvAttackTypeIconSpritePath((FvAttackType)type)); } //砲台シリーズIDからシリーズスキルIDに seriesSkillIds = seriesIds .Distinct() .Select(id => Masters.TurretSerieseDB.FindById(id).seriesSkillId) .Distinct() .ToArray(); foreach (uint id in seriesSkillIds) { //シリーズスキルアイコンのロード var data = Masters.SerieseSkillDB.FindById(id); this.assetLoader.Add <Sprite>(SharkDefine.GetSeriesSkillIconSpritePath(data.key)); } //ロード開始 this.assetLoader.Load(this.OnLoaded); }
public override string GetSpritePath(string key) { return(SharkDefine.GetBulletThumbnailPath(key)); }
/// <summary> /// 必要リソースの読み込み /// </summary> private void Load() { //WAVEデータ読み込み this.waveDataHandle = AssetManager.Load<FishWaveData>(SharkDefine.GetFishWaveDataPath(this.stageData.key), (asset) => { //WAVE準備 this.waveDataController = new FishWaveDataController(new Fish.ID(), asset, 0f); this.waveDataController.onFinished = this.OnAllWaveFinished; //背景リソース読み込み this.loader.Add<Sprite>(SharkDefine.GetBattleBgSpritePath(this.worldData.key)); //WAVE必要リソース読み込み this.loader.AddRange(this.waveDataController.loader); //バトルアイテムアイコンリソース読み込み this.battleItemIconManager.Set( userItemDatas: new UserItemData[]{ new UserItemData{ itemType = ItemType.BattleItem, itemId = this.stageData.itemId1, stockCount = this.stageData.amount1 }, new UserItemData{ itemType = ItemType.BattleItem, itemId = this.stageData.itemId2, stockCount = this.stageData.amount2 }, }, onClick: this.OnClickItemIcon ); this.battleItemIconManager.LoadIfNeed(); //BGM読み込み this.loader.Add<BgmClipData>(SharkDefine.GetBgmClipPath(this.worldData.bgmName)); //SE読み込み this.loader.Add<AudioClip>(SharkDefine.GetSeClipPath(SeName.CAPTURE_SINGLE)); this.loader.Add<AudioClip>(SharkDefine.GetSeClipPath(SeName.FVATTACK_OK)); this.loader.Add<AudioClip>(SharkDefine.GetSeClipPath(SeName.FVATTACK_START)); //砲台リソース読み込み this.loader.AddRange(this.turret.loader); //ロード this.loader.Load(); //ロード完了待ち StartCoroutine(new WaitWhile(AssetManager.IsLoading).AddCallback(() => { //ローディング表示消す SharedUI.Instance.HideSceneChangeAnimation(); //BGM再生 this.bgmTrack = SoundManager.Instance.PlayBgm(this.worldData.bgmName); //背景 this.bgImage.sprite = this.loader[SharkDefine.GetBattleBgSpritePath(this.worldData.key)].handle.asset as Sprite; //バトルWAVEセットアップ this.waveDataController.Setup(); //アイテムアイコンセットアップ this.battleItemIconManager.Setup(); //砲台セットアップ this.turret.Setup(); //FVアタックゲージセットアップ this.uiFvAttackGauge.Setup(); //魚ゲージセットアップ this.uiFishGauge.Setup(this.waveDataController.master); //準備完了したらバトル開始 this.stateManager.ChangeState<BattleStartState>(); })); }); }
/// <summary> /// FBXインポート /// </summary> private static void ImportFBX(ModelImporter importer) { //魚FBXかどうか bool isFish = importer.assetPath.Contains(FishFbxDirectory); //ファイル名、ディレクトリ名 string fbxName = Path.GetFileNameWithoutExtension(importer.assetPath); string directory = Path.GetDirectoryName(importer.assetPath); //テクスチャ吐き出し //importer.ExtractTextures(directory); //アニメーション分割データがあるかチェック AnimationSplitData splitData = null; string[] guids = AssetDatabase.FindAssets("t:AnimationSplitData", new string[]{ directory }); if (guids.Length > 0) { splitData = AssetDatabase.LoadAssetAtPath<AnimationSplitData>(AssetDatabase.GUIDToAssetPath(guids[0])); } //新規クリップ情報 ModelImporterClipAnimation[] newClips = importer.defaultClipAnimations; //アニメーション分割データがあるなら if (splitData != null) { //アニメーション分割データでクリップ情報を上書き newClips = splitData.clips .Select(x => new ModelImporterClipAnimation { name = x.name, takeName = x.name, firstFrame = x.startFrame, lastFrame = x.endFrame, loopTime = x.loop, }) .ToArray(); } //魚FBXなら if (isFish) { foreach (var clip in newClips) { //泳ぎのモーションはループするように if (clip.name == "oyogi") { clip.loopTime = true; } } } //吐き出したテクスチャとアニメーション分割情報を保存 importer.clipAnimations = newClips; importer.SaveAndReimport(); //アニメーターコントローラが無いなら作る var animatorController = AnimatorUtility.FindAnimatorController(directory); if (animatorController == null) { animatorController = AnimatorController.CreateAnimatorControllerAtPath(Path.ChangeExtension(importer.assetPath, "controller")); } //レイヤーが消えていた場合の保険 if (animatorController.layers == null || animatorController.layers.Length == 0) { animatorController.AddLayer("Base Layer"); } //FBXに内包されているモーションをアニメーターコントローラに割り当てる foreach (var subAsset in AssetDatabase.LoadAllAssetRepresentationsAtPath(importer.assetPath)) { if (subAsset is AnimationClip) { var animatorState = animatorController.GetAnimatorState(0, subAsset.name); if (animatorState == null) { //ステートが無いなら作る animatorState = animatorController.layers[0].stateMachine.AddState(subAsset.name); } animatorState.motion = (AnimationClip)subAsset; } } //魚FBXなら if (isFish) { AnimatorState oyogiState = animatorController.GetAnimatorState(0, "oyogi"); if (oyogiState != null) { //泳ぎのモーションをデフォルトにする animatorController.layers[0].stateMachine.defaultState = oyogiState; AnimatorState hirumiState = animatorController.GetAnimatorState(0, "hirumi"); if (hirumiState != null) { //怯みのモーションから泳ぎのモーションへのトランジションを作成 AnimatorStateTransition transition = hirumiState.transitions.FirstOrDefault(x => x.destinationState == oyogiState); if (transition == null) { transition = hirumiState.AddTransition(oyogiState); } transition.hasExitTime = true; } } //コライダデータのパス string colliderDataPath = SharkDefine.GetFishColliderDataPath(fbxName); colliderDataPath = Path.Combine(AssetManager.AssetBundleResourcesDirectory, colliderDataPath); colliderDataPath += ".asset"; //コライダデータが無いなら作る var colliderData = AssetDatabase.LoadAssetAtPath<FishColliderData>(colliderDataPath); if (colliderData == null) { colliderData = ScriptableObject.CreateInstance<FishColliderData>(); AssetDatabase.CreateAsset(colliderData, colliderDataPath); } } }
string IItemInfo.GetSpritePath() => SharkDefine.GetTurretSetSpritePath(Masters.BatteryDB.FindById(this.batteryId).key);
/// <summary> /// 弾丸プレハブ更新 /// </summary> public void RefleshBulletPrefab() { this.bulletPrefab = AssetManager.FindHandle <BulletBase>(SharkDefine.GetBulletPrefabPath(this.bulletKey)).asset as BulletBase; }
string IItemInfo.GetSpritePath() => SharkDefine.GetBatterySpritePath(this.key);
public override string GetSpritePath(string key) { return(SharkDefine.GetTurretSetSpritePath(key)); }
string IItemInfo.GetSpritePath() => SharkDefine.GetAccessoryThumbnailPath(this.key);
public override string GetSpritePath(string key) { return(SharkDefine.GetAccessoryThumbnailPath(key)); }
string IItemInfo.GetSpritePath() => SharkDefine.GetBulletThumbnailPath(this.key);
public override string GetSpritePath(string key) { return(SharkDefine.GetBattleItemIconSpritePath(key)); }