/// <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> 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> 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() { //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>(); })); }); }