feat: 新增音效资源并优化音效选择功能
1. 新增Arc、Ion、Sonic、Plasma、Quantum、Hardlight共6种音效资源及导入配置 2. 为多选弹窗组件添加点击回调事件,支持选项点击预览音效 3. 为音画设置页面添加音效预览功能,绑定新增的音效资源 4. 修复iOS构建脚本的编译宏条件问题 5. 更新.gitignore忽略灭蚊_mapping.txt文件
This commit is contained in:
parent
89609dea58
commit
a01ff23268
1
.gitignore
vendored
1
.gitignore
vendored
@ -77,3 +77,4 @@ crashlytics-build.properties
|
||||
ProjectSettings/ProjectVersion.txt
|
||||
Assets/Resources/BillingMode.json
|
||||
Assets/Resources/BillingMode.json.meta
|
||||
灭蚊_mapping.txt
|
||||
|
||||
@ -1,12 +1,15 @@
|
||||
using UnityEditor;
|
||||
using UnityEditor.Callbacks;
|
||||
#if UNITY_IOS
|
||||
using UnityEditor.iOS.Xcode;
|
||||
#endif
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEngine;
|
||||
|
||||
public class iOSFixDuplicateShellScript
|
||||
{
|
||||
#if UNITY_IOS
|
||||
[PostProcessBuild(999)]
|
||||
public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
|
||||
{
|
||||
@ -89,4 +92,5 @@ public class iOSFixDuplicateShellScript
|
||||
Debug.Log("[PostProcess] Added NetworkExtension.framework");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
8
Assets/Res/common/sound.meta
Normal file
8
Assets/Res/common/sound.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d156be506603a414398d6d5fec7c1fa2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Res/common/sound/Arc.wav
Normal file
BIN
Assets/Res/common/sound/Arc.wav
Normal file
Binary file not shown.
23
Assets/Res/common/sound/Arc.wav.meta
Normal file
23
Assets/Res/common/sound/Arc.wav.meta
Normal file
@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 61ccfe9aadf649b42b2faf6ccb997a47
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Res/common/sound/Hardlight.wav
Normal file
BIN
Assets/Res/common/sound/Hardlight.wav
Normal file
Binary file not shown.
23
Assets/Res/common/sound/Hardlight.wav.meta
Normal file
23
Assets/Res/common/sound/Hardlight.wav.meta
Normal file
@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a0688af0cf8c3749ae7d730b04cc01f
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Res/common/sound/Ion.wav
Normal file
BIN
Assets/Res/common/sound/Ion.wav
Normal file
Binary file not shown.
23
Assets/Res/common/sound/Ion.wav.meta
Normal file
23
Assets/Res/common/sound/Ion.wav.meta
Normal file
@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d5f8e0f686d22594984235d7ad3b18b6
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Res/common/sound/Plasma.wav
Normal file
BIN
Assets/Res/common/sound/Plasma.wav
Normal file
Binary file not shown.
23
Assets/Res/common/sound/Plasma.wav.meta
Normal file
23
Assets/Res/common/sound/Plasma.wav.meta
Normal file
@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd5da0c171cf30b48b6db8ba1bedb8a3
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Res/common/sound/Quantum.wav
Normal file
BIN
Assets/Res/common/sound/Quantum.wav
Normal file
Binary file not shown.
23
Assets/Res/common/sound/Quantum.wav.meta
Normal file
23
Assets/Res/common/sound/Quantum.wav.meta
Normal file
@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9dc4be19ac7e0964d885644ec9fb9c63
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Res/common/sound/Sonic.wav
Normal file
BIN
Assets/Res/common/sound/Sonic.wav
Normal file
Binary file not shown.
23
Assets/Res/common/sound/Sonic.wav.meta
Normal file
23
Assets/Res/common/sound/Sonic.wav.meta
Normal file
@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 58cb2f93b954b344dbbb4e3f645d061e
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -3099,6 +3099,81 @@ MonoBehaviour:
|
||||
- {fileID: 985684051599768521}
|
||||
confirmBtn: {fileID: 3720356942245563436}
|
||||
cancelBtn: {fileID: 6862151831119729504}
|
||||
--- !u!1 &4063750344453730590
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8487372639034134025}
|
||||
- component: {fileID: 7724526897570399728}
|
||||
- component: {fileID: 5184914561970242851}
|
||||
m_Layer: 5
|
||||
m_Name: Image
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8487372639034134025
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4063750344453730590}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3740080819997029991}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 60}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7724526897570399728
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4063750344453730590}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &5184914561970242851
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4063750344453730590}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &4126862431282601540
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -3917,6 +3992,7 @@ GameObject:
|
||||
- component: {fileID: 7313573539971680994}
|
||||
- component: {fileID: 5422309356217015212}
|
||||
- component: {fileID: 2229569971690620424}
|
||||
- component: {fileID: 352176194064245779}
|
||||
m_Layer: 5
|
||||
m_Name: "\u89C6\u9891\u548C\u97F3\u6548"
|
||||
m_TagString: Untagged
|
||||
@ -4006,6 +4082,110 @@ MonoBehaviour:
|
||||
videoLengthValueText: {fileID: 1587088661933351005}
|
||||
soundEffectValueText: {fileID: 2536644071785666491}
|
||||
volumeValueText: {fileID: 0}
|
||||
audioSource: {fileID: 352176194064245779}
|
||||
audioClips:
|
||||
- {fileID: 8300000, guid: 61ccfe9aadf649b42b2faf6ccb997a47, type: 3}
|
||||
- {fileID: 8300000, guid: 3a0688af0cf8c3749ae7d730b04cc01f, type: 3}
|
||||
- {fileID: 8300000, guid: d5f8e0f686d22594984235d7ad3b18b6, type: 3}
|
||||
- {fileID: 8300000, guid: bd5da0c171cf30b48b6db8ba1bedb8a3, type: 3}
|
||||
- {fileID: 8300000, guid: 9dc4be19ac7e0964d885644ec9fb9c63, type: 3}
|
||||
- {fileID: 8300000, guid: 58cb2f93b954b344dbbb4e3f645d061e, type: 3}
|
||||
--- !u!82 &352176194064245779
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4951192156289694182}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 8300000, guid: 61ccfe9aadf649b42b2faf6ccb997a47, type: 3}
|
||||
m_PlayOnAwake: 0
|
||||
m_Volume: 1
|
||||
m_Pitch: 1
|
||||
Loop: 0
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
Priority: 128
|
||||
DopplerLevel: 1
|
||||
MinDistance: 1
|
||||
MaxDistance: 500
|
||||
Pan2D: 0
|
||||
rolloffMode: 0
|
||||
BypassEffects: 0
|
||||
BypassListenerEffects: 0
|
||||
BypassReverbZones: 0
|
||||
rolloffCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
panLevelCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
spreadCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
reverbZoneMixCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!1 &5022691807665670243
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -4734,6 +4914,7 @@ RectTransform:
|
||||
- {fileID: 8420813239879453148}
|
||||
- {fileID: 6744941744931312576}
|
||||
- {fileID: 8189068922639428999}
|
||||
- {fileID: 8487372639034134025}
|
||||
m_Father: {fileID: 8949572052819847237}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
|
||||
@ -15,9 +15,10 @@ namespace Kill.UI.Components
|
||||
public List<Button> options = new List<Button>();
|
||||
int nowSelectedIndex = -1;
|
||||
public Action<int> onConfirm;
|
||||
public Action<int> onClick;
|
||||
public Button confirmBtn;
|
||||
public Button cancelBtn;
|
||||
public void Init(int selectedIndex, Action<int> onConfirm)
|
||||
public void Init(int selectedIndex, Action<int> onConfirm,Action<int> onClick=null)
|
||||
{
|
||||
confirmBtn.onClick.AddListener(() =>
|
||||
{
|
||||
@ -28,6 +29,7 @@ namespace Kill.UI.Components
|
||||
Cancel();
|
||||
});
|
||||
this.onConfirm = onConfirm;
|
||||
this.onClick=onClick;
|
||||
nowSelectedIndex = selectedIndex;
|
||||
for (int i = 0; i < options.Count; i++)
|
||||
{
|
||||
@ -52,6 +54,7 @@ namespace Kill.UI.Components
|
||||
}
|
||||
public void OnClickOption(int index)
|
||||
{
|
||||
onClick?.Invoke(index);
|
||||
if (nowSelectedIndex == index)
|
||||
{
|
||||
return;
|
||||
@ -73,6 +76,7 @@ namespace Kill.UI.Components
|
||||
options[i].GetComponent<Image>().color = bgColors[0];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public void Confirm()
|
||||
{
|
||||
|
||||
@ -36,12 +36,14 @@ namespace Kill.UI.Pages
|
||||
SoundEffectType.Quantum,
|
||||
SoundEffectType.Sonic
|
||||
};
|
||||
|
||||
public AudioSource audioSource;
|
||||
public AudioClip[] audioClips;
|
||||
private MultimediaControl multimediaSetting;
|
||||
private Action callback;
|
||||
|
||||
public void Init(Action callback)
|
||||
{
|
||||
audioSource=GetComponent<AudioSource>();
|
||||
this.callback = callback;
|
||||
InitLanguageText();
|
||||
ReadMultimediaSettings();
|
||||
@ -265,7 +267,7 @@ namespace Kill.UI.Pages
|
||||
{
|
||||
MutiSelectPage m = Instantiate(soundEffectSelect.gameObject, transform).GetComponent<MutiSelectPage>();
|
||||
int currentIndex = GetSoundEffectIndexFromValue(multimediaSetting.SoundType);
|
||||
m.Init(currentIndex, OnSoundEffectSelected);
|
||||
m.Init(currentIndex, OnSoundEffectSelected,OnSoundEffectClick);
|
||||
m.gameObject.SetActive(true);
|
||||
UIManager.Instance.RegisterBackAction(m.Cancel);
|
||||
}
|
||||
@ -281,6 +283,16 @@ namespace Kill.UI.Pages
|
||||
WriteMultimediaSetting();
|
||||
}
|
||||
}
|
||||
private void OnSoundEffectClick(int index)
|
||||
{
|
||||
if(audioSource==null)
|
||||
audioSource=GetComponent<AudioSource>();
|
||||
if (index >= 0 && index < audioClips.Length)
|
||||
{
|
||||
audioSource.clip = audioClips[index];
|
||||
audioSource.Play();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据视频时长值获取选项索引
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user