You've already forked taptap2024_GJ_chidouren
159 lines
7.1 KiB
C#
159 lines
7.1 KiB
C#
using Coffee.UIEffects;
|
||
using Framework.Asset;
|
||
using Game.Data;
|
||
using Sirenix.OdinInspector;
|
||
using UnityEngine;
|
||
using UnityEngine.Serialization;
|
||
|
||
namespace System.AudioHandler
|
||
{
|
||
[CreateAssetMenu(fileName = "AudioCode", order = 0)]
|
||
public class AudioCode : ScriptableObject
|
||
{
|
||
//特殊单例模式
|
||
|
||
#region Instance Logic
|
||
|
||
private const string _CONFIG_PATH = "Config/Audio/AudioCode.asset";
|
||
|
||
private static AudioCode _instance;
|
||
|
||
public static AudioCode Instance
|
||
{
|
||
get
|
||
{
|
||
if (_instance == null)
|
||
{
|
||
// ## ai 记住此处的加载方式, 通过AssetManager加载
|
||
// ## 通过AssetManager加载的资源,会自动缓存,不需要手动释放
|
||
_instance = AssetManager.Instance.LoadAsset<AudioCode>(_CONFIG_PATH);
|
||
}
|
||
|
||
return _instance;
|
||
}
|
||
}
|
||
|
||
#endregion"
|
||
|
||
[BoxGroup("BGM")] public string LobbyBgm = "LobbyBgm";
|
||
public string FightBgm = "WorkBgm";
|
||
public string NormalBgm = "PlayBgm";
|
||
|
||
[BoxGroup("SE")] public string SE_Btn_Click = "UI/Button/Btn_Click";
|
||
public string SE_Btn_Click2 = "UI/Button/Btn_Click2";
|
||
public string SE_Btn_Click3 = "UI/Button/Btn_Click3";
|
||
public string SE_Btn_Back = "UI/Button/Btn_Back";
|
||
public string SE_Btn_Close = "UI/Button/Btn_Close";
|
||
public string SE_Btn_Confirm = "UI/Button/Btn_Confirm";
|
||
public string SE_Btn_Warning = "UI/Button/Btn_Warning";
|
||
public string SE_Complete = "UI/CompleteLevel/Complete_Level_01";
|
||
public string SE_Complete2 = "UI/CompleteLevel/Complete_Level_02";
|
||
public string SE_CompleteTip = "UI/CompleteLevel/Complete_Level_Tip";
|
||
public string SE_CompletePrefect = "UI/CompleteLevel/Complete_Level_Prefect";
|
||
public string SE_Gaming_GetCoin = "UI/Gaming/GetCoin";
|
||
public string SE_Loading_Whoosh01 = "UI/Loading/Whoosh01";
|
||
public string SE_Loading_Whoosh02 = "UI/Loading/Whoosh02";
|
||
public string SE_OverGame_History = "UI/OverGame/HistoryEffect";
|
||
public string SE_OverGame_Prefect = "UI/OverGame/PerfectEffect";
|
||
public string SE_PanelPop_Pop01 = "UI/PanelPop/Pop01";
|
||
public string SE_PanelPop_Pop02 = "UI/PanelPop/Pop02";
|
||
public string SE_PanelPop_Pop03 = "UI/PanelPop/Pop03";
|
||
public string SE_Play_OverGameSuccess = "UI/OverGame/OverGameSuccess";
|
||
public string SE_PropTip = "UI/PropTip";
|
||
public string SE_Play_OverGameFail = "UI/OverGame/OverGameFail";
|
||
public string SE_AD_Complete = "UI/AD_Complete";
|
||
public string SE_Fight_Attack = "UI/Fight/Attack";
|
||
public string SE_Fight_EchoTrigger1 = "UI/Fight/EchoTrigger1";
|
||
public string SE_Fight_EchoTrigger2 = "UI/Fight/EchoTrigger2";
|
||
public string SE_Fight_BossEchoTrigger = "UI/Fight/BossEchoTrigger";
|
||
public string SE_Fight_RealCard = "UI/Fight/RealCard";
|
||
public string SE_Fight_DiscardCard = "UI/Fight/DiscardCard";
|
||
|
||
|
||
public string GetBgmAudio(BgmAudio bgmAudio)
|
||
{
|
||
switch (bgmAudio)
|
||
{
|
||
case BgmAudio.None:
|
||
return null;
|
||
case BgmAudio.LobbyBgm:
|
||
return LobbyBgm;
|
||
case BgmAudio.FightingBgm:
|
||
return FightBgm;
|
||
case BgmAudio.NormalBgm:
|
||
return NormalBgm;
|
||
default:
|
||
return null;
|
||
}
|
||
}
|
||
|
||
public string GetSeAudio(SeAudio seAudio)
|
||
{
|
||
switch (seAudio)
|
||
{
|
||
case SeAudio.None:
|
||
return SE_Btn_Click;
|
||
case SeAudio.Btn_Click:
|
||
return SE_Btn_Click;
|
||
case SeAudio.Btn_Click2:
|
||
return SE_Btn_Click2;
|
||
case SeAudio.Btn_Click3:
|
||
return SE_Btn_Click3;
|
||
case SeAudio.Btn_Back:
|
||
return SE_Btn_Back;
|
||
case SeAudio.Btn_Close:
|
||
return SE_Btn_Close;
|
||
case SeAudio.Btn_Confirm:
|
||
return SE_Btn_Confirm;
|
||
case SeAudio.Btn_Warning:
|
||
return SE_Btn_Warning;
|
||
case SeAudio.Complete:
|
||
return SE_Complete;
|
||
case SeAudio.Complete2:
|
||
return SE_Complete2;
|
||
case SeAudio.CompleteTip:
|
||
return SE_CompleteTip;
|
||
case SeAudio.CompletePrefect:
|
||
return SE_CompletePrefect;
|
||
case SeAudio.Gaming_GetCoin:
|
||
return SE_Gaming_GetCoin;
|
||
case SeAudio.Loading_Whoosh01:
|
||
return SE_Loading_Whoosh01;
|
||
case SeAudio.Loading_Whoosh02:
|
||
return SE_Loading_Whoosh02;
|
||
case SeAudio.OverGame_History:
|
||
return SE_OverGame_History;
|
||
case SeAudio.OverGame_Prefect:
|
||
return SE_OverGame_Prefect;
|
||
case SeAudio.PanelPop_Pop01:
|
||
return SE_PanelPop_Pop01;
|
||
case SeAudio.PanelPop_Pop02:
|
||
return SE_PanelPop_Pop02;
|
||
case SeAudio.PanelPop_Pop03:
|
||
return SE_PanelPop_Pop03;
|
||
case SeAudio.OverGame_Success:
|
||
return this.SE_Play_OverGameSuccess;
|
||
case SeAudio.PropTip:
|
||
return this.SE_PropTip;
|
||
case SeAudio.OverGame_Fail:
|
||
return this.SE_Play_OverGameFail;
|
||
case SeAudio.AD_Complete:
|
||
return this.SE_AD_Complete;
|
||
case SeAudio.Fight_Attack:
|
||
return this.SE_Fight_Attack;
|
||
case SeAudio.Fight_EchoTrigger1:
|
||
return this.SE_Fight_EchoTrigger1;
|
||
case SeAudio.Fight_EchoTrigger2:
|
||
return this.SE_Fight_EchoTrigger2;
|
||
case SeAudio.Fight_BossEchoTrigger:
|
||
return this.SE_Fight_BossEchoTrigger;
|
||
case SeAudio.Fight_RealCard:
|
||
return this.SE_Fight_RealCard;
|
||
case SeAudio.Fight_CardDiscard:
|
||
return this.SE_Fight_DiscardCard;
|
||
default:
|
||
return null;
|
||
}
|
||
}
|
||
}
|
||
} |