private AlwaysEffectParams[] CreateTransferEffects() { Shader shader = Shader.Find("Effect/Custom_MobileParticlesAdditive"); if (shader != null && shader.isSupported) { this.transferEffectMaterial = new Material(shader); } GameObject resource = AssetDataMng.Instance().LoadObject("AlwaysEffects/transferPVPCharacterEffect/prefab", null, true) as GameObject; AlwaysEffectParams[] array = new AlwaysEffectParams[this.monsterCount]; for (int i = 0; i < this.monsterCount; i++) { GameObject chara = this.monsterRenderTexture.GetChara(i); GameObject transferEffect = this.GetTransferEffect(resource); Transform transform = transferEffect.transform; transform.parent = chara.transform.parent; transform.position = chara.transform.position; transform.localScale = Vector3.one; transform.localRotation = Quaternion.identity; array[i] = transferEffect.GetComponent <AlwaysEffectParams>(); array[i].PlayAnimationTrigger(AlwaysEffectState.In); this.SetBillboard(chara.transform, array[i]); } return(array); }
public void TryPlaySE(AlwaysEffectParams alwaysEffect, AlwaysEffectState state) { if (alwaysEffect == null) { return; } if (state != AlwaysEffectState.In) { if (state != AlwaysEffectState.Always) { if (state == AlwaysEffectState.Out) { this.TryPlaySE(alwaysEffect.outSeId, 0f, false); this.TryStopSE(alwaysEffect.inSeId, 0f); this.TryStopSE(alwaysEffect.alwaysSeId, 0f); } } else { this.TryPlaySE(alwaysEffect.alwaysSeId, 0f, true); } } else { this.TryPlaySE(alwaysEffect.inSeId, 0f, false); this.TryPlaySE(alwaysEffect.alwaysSeId, 0.1f, true); } }
private void OnEnable() { if (this._parentParams == null) { this._parentParams = base.GetComponentInParent <AlwaysEffectParams>(); } }
public static void AddAlwaysEffectParams(string id, AlwaysEffectParams alwaysEffect) { if (!BattleObjectPooler.alwaysEffectParamsCache.ContainsKey(id)) { BattleObjectPooler.alwaysEffectParamsCache.Add(id, new List <AlwaysEffectParams>()); } BattleObjectPooler.alwaysEffectParamsCache[id].Add(alwaysEffect); }
public static bool TryGetAlwaysEffectParams(string id, int index, out AlwaysEffectParams alwaysEffect) { if (BattleObjectPooler.alwaysEffectParamsCache.ContainsKey(id) && BattleObjectPooler.alwaysEffectParamsCache[id].Count > index) { alwaysEffect = BattleObjectPooler.alwaysEffectParamsCache[id][index]; return(true); } alwaysEffect = null; return(false); }
public IEnumerator LoadAlwaysEffect(string effectId, int index, Action <AlwaysEffectParams, int> result) { BattleDebug.Log(string.Concat(new object[] { "--- 常設エフェクト単体ロード effectId[", effectId, "] index[", index, "] : 開始" })); AlwaysEffectParams alwaysParam = null; GameObject effect = null; if (!BattleObjectPooler.TryGetAlwaysEffectParams(effectId, index, out alwaysParam)) { GameObject prefab = base.stateManager.serverControl.GetAlwaysEffectPrefab(effectId); effect = base.Instantiate <GameObject>(prefab); yield return(null); effect.name = effectId; alwaysParam = effect.GetComponent <AlwaysEffectParams>(); BattleObjectPooler.AddAlwaysEffectParams(effectId, alwaysParam); } else { effect = alwaysParam.gameObject; } effect.transform.SetParent(base.battleStateData.alwaysEffectRoot); effect.transform.position = Vector3.zero; effect.transform.rotation = Quaternion.identity; IEnumerator initialize = alwaysParam.Initialize(base.hierarchyData.cameraObject.camera3D); while (initialize.MoveNext()) { yield return(null); } base.stateManager.threeDAction.StopAlwaysEffectAction(new AlwaysEffectParams[] { alwaysParam }); base.stateManager.soundPlayer.AddEffectSe(alwaysParam.inSeId); base.stateManager.soundPlayer.AddEffectSe(alwaysParam.alwaysSeId); base.stateManager.soundPlayer.AddEffectSe(alwaysParam.outSeId); result(alwaysParam, index); BattleDebug.Log(string.Concat(new object[] { "--- 常設エフェクト単体ロード effectId[", effectId, "] index[", index, "] : 完了" })); yield break; }
public static bool ContainAlwaysEffectParams(AlwaysEffectParams c) { foreach (KeyValuePair <string, List <AlwaysEffectParams> > keyValuePair in BattleObjectPooler.alwaysEffectParamsCache) { if (keyValuePair.Value.Contains(c)) { return(true); } } return(false); }
private void SetBillboard(Transform charaTransform, AlwaysEffectParams effect) { BillboardObject[] componentsInChildren = effect.GetComponentsInChildren <BillboardObject>(); if (componentsInChildren != null) { for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].transform.forward = -charaTransform.forward; } } }
private void WaveResetPlayerResetupFunction(int i) { Transform transform = base.battleStateData.playerCharactersSpawnPoint[i]; CharacterParams characterParams = base.battleStateData.playerCharacters[i].CharacterParams; AlwaysEffectParams alwaysEffectParams = base.battleStateData.revivalReservedEffect[i]; characterParams.transform.position = transform.position; characterParams.transform.rotation = transform.rotation; characterParams.gameObject.SetActive(false); alwaysEffectParams.transform.position = transform.position; alwaysEffectParams.transform.rotation = transform.rotation; }
public IEnumerator BigToSmallTransition(CharacterStateControl cState, AlwaysEffectParams insertCharacterEffect) { this.ShowAllCharactersAction(new CharacterStateControl[] { cState }); this.PlayIdleAnimationActiveCharacterAction(new CharacterStateControl[] { cState }); insertCharacterEffect.SetPosition(cState.CharacterParams.transform, null); this.PlayAlwaysEffectAction(insertCharacterEffect, AlwaysEffectState.In); base.stateManager.soundPlayer.TryPlaySE("bt_541", 0f, false); while (insertCharacterEffect.currentState != AlwaysEffectState.Always) { yield return(null); } this.PlayAlwaysEffectAction(insertCharacterEffect, AlwaysEffectState.Out); base.stateManager.soundPlayer.TryPlaySE(insertCharacterEffect, AlwaysEffectState.Out); IEnumerator smooth = this.SmoothIncreaseCharactersAction(-base.stateManager.stateProperty.revivalActionSpeed, new CharacterStateControl[] { cState }); while (smooth.MoveNext()) { yield return(null); } this.HideAllCharactersAction(new CharacterStateControl[] { cState }); this.StopAlwaysEffectAction(new AlwaysEffectParams[] { insertCharacterEffect }); yield break; }
public IEnumerator OnDecisionCharacterRevivalFunction(int revivalCharacterIndex) { if (base.battleStateData.currentDigiStoneNumber < 1) { IEnumerator buyDigistoneFunction = base.stateManager.serverControl.ContinueBuyDigistoneFunction(false); while (buyDigistoneFunction.MoveNext()) { yield return(null); } } if (base.battleStateData.currentDigiStoneNumber >= 1) { base.battleStateData.isShowRevivalWindow = false; BattleStateManager.current.uiControl.ApplyEnableCharacterRevivalWindow(false, false, null); base.battleStateData.isRevivalReservedCharacter[revivalCharacterIndex] = true; AlwaysEffectParams alwaysEffect = base.battleStateData.revivalReservedEffect[revivalCharacterIndex]; base.stateManager.threeDAction.PlayAlwaysEffectAction(alwaysEffect, AlwaysEffectState.In); base.stateManager.soundPlayer.TryPlaySE(alwaysEffect, AlwaysEffectState.In); SoundPlayer.PlayButtonEnter(); base.battleStateData.turnUseDigiStoneCount++; } yield break; }
public void TryStopSE(AlwaysEffectParams alwaysEffect) { this.TryStopSE(alwaysEffect.inSeId, 0f); this.TryStopSE(alwaysEffect.alwaysSeId, 0f); this.TryStopSE(alwaysEffect.outSeId, 0f); }
public void SetPositionAlwaysEffectAction(AlwaysEffectParams alwaysEffect, CharacterStateControl character, Vector3?offsetPosition = null) { Vector3 b = (offsetPosition == null) ? Vector3.zero : offsetPosition.Value; alwaysEffect.SetPosition(character.CharacterParams.transform, new Vector3?(character.CharacterParams.dropItemOffsetPosition + b)); }
public IEnumerator SmallToBigTransition(float delayTime, CharacterStateControl cState, AlwaysEffectParams insertCharacterEffect) { this.HideAllCharactersAction(new CharacterStateControl[] { cState }); IEnumerator wait = base.stateManager.time.WaitForCertainPeriodTimeAction(delayTime, null, null); while (wait.MoveNext()) { yield return(null); } insertCharacterEffect.SetPosition(cState.CharacterParams.transform, null); this.PlayAlwaysEffectAction(insertCharacterEffect, AlwaysEffectState.In); base.stateManager.soundPlayer.TryPlaySE("bt_541", 0f, false); while (insertCharacterEffect.currentState != AlwaysEffectState.Always) { yield return(null); } this.PlayAlwaysEffectAction(insertCharacterEffect, AlwaysEffectState.Out); base.stateManager.soundPlayer.TryPlaySE(insertCharacterEffect, AlwaysEffectState.Out); this.ShowAllCharactersAction(new CharacterStateControl[] { cState }); this.PlayIdleAnimationActiveCharacterAction(new CharacterStateControl[] { cState }); IEnumerator smooth = this.SmoothIncreaseCharactersAction(base.stateManager.stateProperty.revivalActionSpeed, new CharacterStateControl[] { cState }); while (smooth.MoveNext()) { yield return(null); } cState.CharacterParams.PlayAnimation(CharacterAnimationType.attacks, SkillType.Attack, 0, null, null); this.StopAlwaysEffectAction(new AlwaysEffectParams[] { insertCharacterEffect }); yield break; }
public void PlayAlwaysEffectAction(AlwaysEffectParams alwaysEffect, AlwaysEffectState state) { alwaysEffect.PlayAnimationTrigger(state); }
private IEnumerator PlayEffect(CharacterStateControl droppedCharacter, SubStateEnemiesItemDroppingFunction.ItemDropResultData drop, int indexKey) { AlwaysEffectParams effectParams = null; if (!drop.itemDropResult.isRare) { effectParams = base.battleStateData.droppingItemNormalEffect[drop.effectIndex]; base.battleStateData.currentDroppedNormalItem++; } else { effectParams = base.battleStateData.droppingItemRareEffect[drop.effectIndex]; base.battleStateData.currentDroppedRareItem++; } Vector3[] offsetList = new Vector3[] { Vector3.zero, new Vector3(-0.5f, 0f, 0f), new Vector3(0.5f, 0f, 0f), new Vector3(0f, 0f, -0.5f), new Vector3(0f, 0f, 0.5f), new Vector3(-0.25f, 0f, -0.25f), new Vector3(0.25f, 0f, 0.25f), new Vector3(0.25f, 0f, -0.25f), new Vector3(-0.25f, 0f, 0.25f) }; base.stateManager.threeDAction.SetPositionAlwaysEffectAction(effectParams, droppedCharacter, new Vector3?(offsetList[indexKey % offsetList.Length])); base.stateManager.threeDAction.PlayAlwaysEffectAction(effectParams, AlwaysEffectState.In); if (drop.itemDropResult.isRare) { base.stateManager.soundPlayer.TryPlaySE(base.battleStateData.droppingItemRareEffect[0], AlwaysEffectState.In); } else { base.stateManager.soundPlayer.TryPlaySE(base.battleStateData.droppingItemNormalEffect[0], AlwaysEffectState.In); } IEnumerator wait = base.stateManager.time.WaitForCertainPeriodTimeAction(base.stateManager.stateProperty.droppingItemActionWaitSecond, null, null); while (wait.MoveNext()) { object obj = wait.Current; yield return(obj); } base.stateManager.threeDAction.PlayAlwaysEffectAction(effectParams, AlwaysEffectState.Out); Vector3 currentShowEffectPosition = base.hierarchyData.cameraObject.camera3D.WorldToViewportPoint(effectParams.targetPosition.position); if (drop.itemDropResult.isRare) { base.stateManager.soundPlayer.TryPlaySE(base.battleStateData.droppingItemRareEffect[0], AlwaysEffectState.Out); } else { base.stateManager.soundPlayer.TryPlaySE(base.battleStateData.droppingItemNormalEffect[0], AlwaysEffectState.Out); } base.stateManager.uiControl.ApplyDroppedItemNumber(base.battleStateData.currentDroppedNormalItem, base.battleStateData.currentDroppedRareItem); IEnumerator moveUIAction = base.stateManager.uiControl.ApplyDroppedItemMove(currentShowEffectPosition, drop.itemDropResult.isRare, indexKey); Action MoveUIAction = delegate() { moveUIAction.MoveNext(); }; wait = base.stateManager.time.WaitForCertainPeriodTimeAction(base.stateManager.stateProperty.droppingItemHiddenActionWaitSecond, MoveUIAction, null); while (wait.MoveNext()) { object obj2 = wait.Current; yield return(obj2); } this.isEffectPlaying[indexKey] = false; base.stateManager.threeDAction.StopAlwaysEffectAction(new AlwaysEffectParams[] { effectParams }); yield break; }