Commit 3dc972d7 authored by SherryChaos's avatar SherryChaos

new bgm logic

parent ae4e04cf
......@@ -3,7 +3,7 @@
MDPro3 v1.1.8.3更新:
1.语音功能支持所有支持的语言。
2.修复语音功能部分角色的台词错误。
3.
3.设置中新增场地背景音乐由哪方决定的选项。
MDPro3 v1.1.8.2更新:
1.语音功能新增全卡语音。
......
This diff is collapsed.
......@@ -14,6 +14,7 @@ using YgomSystem.YGomTMPro;
using MDPro3.YGOSharp;
using MDPro3.YGOSharp.OCGWrapper.Enums;
using MDPro3.UI;
using static UnityEngine.Rendering.DebugUI;
namespace MDPro3
{
......@@ -135,6 +136,9 @@ namespace MDPro3
{
StopCoroutine(autoPlay);
autoPlay = null;
foreach(var cutin in cutins)
Destroy(cutin);
cutins.Clear();
UIManager.ShowExitButton(transitionTime);
cg.alpha = 1;
cg.blocksRaycasts = true;
......@@ -174,7 +178,7 @@ namespace MDPro3
return;
playing = true;
if (Program.I().ocgcore.isShowed)
AudioManager.PlayBGMKeyCard(Program.I().ocgcore.field1Manager.name);
AudioManager.PlayBgmKeyCard();
DOTween.To(v => { }, 0, 0, 1.6f).OnComplete(() =>
{
playing = false;
......@@ -340,10 +344,14 @@ namespace MDPro3
StartCoroutine(autoPlay);
}
bool randomBGMPlayed;
List<GameObject> cutins = new List<GameObject>();
IEnumerator AutoPlayAsync()
{
while (playing)
yield return null;
if(!isShowed)
yield break;
AudioManager.PlayRandomKeyCardBGM();
randomBGMPlayed = true;
cg.alpha = 0f;
......@@ -361,10 +369,10 @@ namespace MDPro3
ie = ABLoader.LoadFromFileAsync("MonsterCutin2/" + card.Id, false, true);
diy = true;
}
StartCoroutine(ie);
while (ie.MoveNext())
yield return null;
ie.Current.SetActive(false);
cutins.Add(ie.Current);
while (playing)
yield return null;
ie.Current.SetActive(true);
......
......@@ -3439,7 +3439,7 @@ namespace MDPro3
cg.blocksRaycasts = true;
buttons.SetActive(true);
messagePass = true;
AudioManager.PlayBGMNormal(field1.name);
AudioManager.PlayBgmNormal(Config.GetBool("BGMbyMySide", true) ? field0.name : field1.name);
};
};
});
......@@ -3592,7 +3592,7 @@ namespace MDPro3
cg.interactable = true;
cg.blocksRaycasts = true;
buttons.SetActive(true);
AudioManager.PlayBGMNormal(field1.name);
AudioManager.PlayBgmNormal(Config.GetBool("BGMbyMySide", true) ? field0.name : field1.name);
};
for (var i = 0; i < cards.Count; i++)
......@@ -8768,7 +8768,7 @@ namespace MDPro3
grave0Manager.PlayAnimatorTrigger(TriggerLabelDefine.DamagePhase3ToPhase4);
if (stand0Manager != null)
stand0Manager.PlayAnimatorTrigger(TriggerLabelDefine.DamagePhase3ToPhase4);
AudioManager.PlayBGMClimax(field1.name);
AudioManager.PlayBgmClimax();
}
if (bgPhase0 == 4 && life0 <= 0)
{
......@@ -8812,7 +8812,7 @@ namespace MDPro3
grave1Manager.PlayAnimatorTrigger(TriggerLabelDefine.DamagePhase3ToPhase4);
if (stand1Manager != null)
stand1Manager.PlayAnimatorTrigger(TriggerLabelDefine.DamagePhase3ToPhase4);
AudioManager.PlayBGMClimax(field1.name);
AudioManager.PlayBgmClimax();
}
if (bgPhase1 == 4 && life1 <= 0)
{
......
......@@ -50,6 +50,8 @@ namespace MDPro3
public Text uiScaleValue;
public Button background;
public Text backgroundValue;
public Button bgmBy;
public Text bgmByValue;
public Button cardLanguage;
public Text cardLanguageValue;
public Button language;
......@@ -212,6 +214,7 @@ namespace MDPro3
language.onClick.AddListener(OnLanguageChange);
confirm.onClick.AddListener(OnConfirmClicked);
autoRPS.onClick.AddListener(OnAutoRPS);
bgmBy.onClick.AddListener(OnBgmByClicked);
duelAppearance.onClick.AddListener(OnDuelAppearcanceClick);
watchAppearance.onClick.AddListener(OnWatchAppearcanceClick);
......@@ -323,6 +326,7 @@ namespace MDPro3
InitializeCardLanguage();
InitializeLanguage();
InitializeSwitches();
InitializeBgmBy();
}
public override void Show(int preDepth)
......@@ -902,6 +906,31 @@ namespace MDPro3
}
}
public void InitializeBgmBy()
{
var value = Config.GetBool("BGMbyMySide", true);
if (value)
bgmByValue.text = InterString.Get("我方");
else
bgmByValue.text = InterString.Get("对方");
}
public void OnBgmByClicked()
{
var value = Config.GetBool("BGMbyMySide", true);
if (value)
{
bgmByValue.text = InterString.Get("对方");
Config.SetBool("BGMbyMySide", false);
}
else
{
bgmByValue.text = InterString.Get("我方");
Config.SetBool("BGMbyMySide", true);
}
}
public void OnAutoRPS()
{
if (autoRPSValue.text == InterString.Get("关"))
......
......@@ -36,12 +36,12 @@ namespace MDPro3.UI
private void PlayAudio(string path)
{
if (path == "")
if (string.IsNullOrEmpty(path))
return;
if (audioType == AudioType.SE)
AudioManager.PlaySE(path);
else if (audioType == AudioType.Voice)
AudioManager.PlayVoiceByPath(path);
AudioManager.PlayVoiceByResourcePath(path);
}
}
......
......@@ -639,3 +639,6 @@ YDK 内容不合法,主卡组必须满 40 张->YDK 内容不合法,主卡组
自定义游戏->自定义游戏
检测到新版先行卡,请至 [游戏设置]-[扩展卡包]-[更新先行卡] 处进行更新。->检测到新版先行卡,请至 [游戏设置]-[扩展卡包]-[更新先行卡] 处进行更新。
SMAA High->SMAA High
决斗场地背景音乐->决斗场地背景音乐
场地背景音乐->场地背景音乐
场地背景音乐由哪方决定->场地背景音乐由哪方决定
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment