From bc1cb6da854cb2e9144f10ed55330a537ecdca16 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 04 三月 2026 14:35:57 +0800
Subject: [PATCH] 466 h5版本 资源规则修改 打包修改(未完成 勿拉取)
---
Main/System/Sound/SoundUtility.cs | 296 +++++++++++++++++++++++++++++-----------------------------
1 files changed, 148 insertions(+), 148 deletions(-)
diff --git a/Main/System/Sound/SoundUtility.cs b/Main/System/Sound/SoundUtility.cs
index f727a0e..56d2c20 100644
--- a/Main/System/Sound/SoundUtility.cs
+++ b/Main/System/Sound/SoundUtility.cs
@@ -1,180 +1,180 @@
-锘�//--------------------------------------------------------
-// [Author]: 鐜╀釜娓告垙
-// [ Date ]: Tuesday, January 30, 2018
-//--------------------------------------------------------
-using UnityEngine;
-using System.Collections;
-using UnityEngine.UI;
-using System;
+锘�// //--------------------------------------------------------
+// // [Author]: 鐜╀釜娓告垙
+// // [ Date ]: Tuesday, January 30, 2018
+// //--------------------------------------------------------
+// using UnityEngine;
+// using System.Collections;
+// using UnityEngine.UI;
+// using System;
-using System.Collections.Generic;
+// using System.Collections.Generic;
-public class SoundUtility
-{
- static DateTime lastHitAudioPlayTime = DateTime.Now;
- static int hitAudioTimeInterval = 50;//姣
+// public class SoundUtility
+// {
+// static DateTime lastHitAudioPlayTime = DateTime.Now;
+// static int hitAudioTimeInterval = 50;//姣
- static int hitAudioPoolMax = 2;
- static int hitAudioCountPool = 2;
+// static int hitAudioPoolMax = 2;
+// static int hitAudioCountPool = 2;
- static Dictionary<int, List<int>> jobHitAudio = new Dictionary<int, List<int>>() {
- { 1,new List<int>(){101,102,103,104} },
- { 2,new List<int>(){146,147,148,149} },
- { 3,new List<int>(){101,102,103,104} },
- };
+// static Dictionary<int, List<int>> jobHitAudio = new Dictionary<int, List<int>>() {
+// { 1,new List<int>(){101,102,103,104} },
+// { 2,new List<int>(){146,147,148,149} },
+// { 3,new List<int>(){101,102,103,104} },
+// };
- public static void PlayHitAudio(AudioSource _audioSource)
- {
- if (_audioSource == null)
- {
- return;
- }
+// public static void PlayHitAudio(AudioSource _audioSource)
+// {
+// if (_audioSource == null)
+// {
+// return;
+// }
- if (hitAudioCountPool < hitAudioPoolMax)
- {
- hitAudioCountPool = Mathf.Clamp(hitAudioCountPool + (int)((DateTime.Now - lastHitAudioPlayTime).TotalMilliseconds / hitAudioTimeInterval), 0, hitAudioPoolMax);
- }
+// if (hitAudioCountPool < hitAudioPoolMax)
+// {
+// hitAudioCountPool = Mathf.Clamp(hitAudioCountPool + (int)((DateTime.Now - lastHitAudioPlayTime).TotalMilliseconds / hitAudioTimeInterval), 0, hitAudioPoolMax);
+// }
- if (hitAudioCountPool > 0)
- {
- var job = PlayerDatas.Instance.baseData.Job;
- if (jobHitAudio.ContainsKey(job))
- {
- var audios = jobHitAudio[job];
- var index = UnityEngine.Random.Range(0, audios.Count);
- SoundPlayer.Instance.PlayAudio(_audioSource, audios[index]);
- lastHitAudioPlayTime = DateTime.Now;
- hitAudioCountPool--;
- }
- }
- }
+// if (hitAudioCountPool > 0)
+// {
+// var job = PlayerDatas.Instance.baseData.Job;
+// if (jobHitAudio.ContainsKey(job))
+// {
+// var audios = jobHitAudio[job];
+// var index = UnityEngine.Random.Range(0, audios.Count);
+// SoundPlayer.Instance.PlayAudio(_audioSource, audios[index]);
+// lastHitAudioPlayTime = DateTime.Now;
+// hitAudioCountPool--;
+// }
+// }
+// }
- static Dictionary<int, int[]> fightRoars = new Dictionary<int, int[]>() {
- { 1,new int[]{ 97,98,99 } },
- { 2,new int[]{ 142,143,144 } },
- };
+// static Dictionary<int, int[]> fightRoars = new Dictionary<int, int[]>() {
+// { 1,new int[]{ 97,98,99 } },
+// { 2,new int[]{ 142,143,144 } },
+// };
- public static void PlayFightRoar(AudioSource _audioSource, int _job)
- {
- var ableIndex = UnityEngine.Random.Range(0, 3);
- if (ableIndex != 1)
- {
- return;
- }
+// public static void PlayFightRoar(AudioSource _audioSource, int _job)
+// {
+// var ableIndex = UnityEngine.Random.Range(0, 3);
+// if (ableIndex != 1)
+// {
+// return;
+// }
- int[] audioList = null;
- if (fightRoars.ContainsKey(_job))
- {
- audioList = fightRoars[_job];
- }
+// int[] audioList = null;
+// if (fightRoars.ContainsKey(_job))
+// {
+// audioList = fightRoars[_job];
+// }
- if (audioList == null)
- {
- return;
- }
+// if (audioList == null)
+// {
+// return;
+// }
- var randomIndex = UnityEngine.Random.Range(0, audioList.Length);
- var audio = audioList[randomIndex];
+// var randomIndex = UnityEngine.Random.Range(0, audioList.Length);
+// var audio = audioList[randomIndex];
- SoundPlayer.Instance.PlayAudio(_audioSource, audio);
+// SoundPlayer.Instance.PlayAudio(_audioSource, audio);
- }
+// }
- static Dictionary<int, int> deadAudios = new Dictionary<int, int>()
- {
- { 1,100},
- { 2,145},
- { 3,100},
- };
+// static Dictionary<int, int> deadAudios = new Dictionary<int, int>()
+// {
+// { 1,100},
+// { 2,145},
+// { 3,100},
+// };
- public static void PlayDeadAudio(AudioSource _audioSource, int _job)
- {
- SoundPlayer.Instance.PlayAudio(_audioSource, deadAudios[_job]);
- }
+// public static void PlayDeadAudio(AudioSource _audioSource, int _job)
+// {
+// SoundPlayer.Instance.PlayAudio(_audioSource, deadAudios[_job]);
+// }
- static Dictionary<int, int[]> stateFootAudios = new Dictionary<int, int[]>()
- {
- { 1,new int[]{ 130, 131, 132,133} },
- { 2,new int[]{ 134, 135, 136, 137 } },
- { 3,new int[]{ 138, 139, 140, 141 } },
- };
+// static Dictionary<int, int[]> stateFootAudios = new Dictionary<int, int[]>()
+// {
+// { 1,new int[]{ 130, 131, 132,133} },
+// { 2,new int[]{ 134, 135, 136, 137 } },
+// { 3,new int[]{ 138, 139, 140, 141 } },
+// };
- static Dictionary<int, int[]> rideAudios = new Dictionary<int, int[]>();
+// static Dictionary<int, int[]> rideAudios = new Dictionary<int, int[]>();
- static FootAudioType currentState = FootAudioType.Walk;
- static int audioIndex = 0;
- static Dictionary<int, DateTime> stateFootAudioLastPlayTimes = new Dictionary<int, DateTime>();
+// static FootAudioType currentState = FootAudioType.Walk;
+// static int audioIndex = 0;
+// static Dictionary<int, DateTime> stateFootAudioLastPlayTimes = new Dictionary<int, DateTime>();
- const float overTime = 2f;
+// const float overTime = 2f;
- public static void PlayFootAudio(AudioSource _audioSource, FootAudioType _state, int _horseId = 0)
- {
- var stateInt = (int)_state;
- if (!stateFootAudios.ContainsKey(stateInt))
- {
- return;
- }
+// public static void PlayFootAudio(AudioSource _audioSource, FootAudioType _state, int _horseId = 0)
+// {
+// var stateInt = (int)_state;
+// if (!stateFootAudios.ContainsKey(stateInt))
+// {
+// return;
+// }
- if (currentState != _state)
- {
- audioIndex = 0;
- currentState = _state;
- }
+// if (currentState != _state)
+// {
+// audioIndex = 0;
+// currentState = _state;
+// }
- if (stateFootAudioLastPlayTimes.ContainsKey(stateInt))
- {
- var lastPlayTime = stateFootAudioLastPlayTimes[stateInt];
- if ((DateTime.Now - lastPlayTime).TotalSeconds > 2f)
- {
- audioIndex = 0;
- }
- }
- else
- {
- audioIndex = 0;
- }
+// if (stateFootAudioLastPlayTimes.ContainsKey(stateInt))
+// {
+// var lastPlayTime = stateFootAudioLastPlayTimes[stateInt];
+// if ((DateTime.Now - lastPlayTime).TotalSeconds > 2f)
+// {
+// audioIndex = 0;
+// }
+// }
+// else
+// {
+// audioIndex = 0;
+// }
- int[] audios = null;
- switch (stateInt)
- {
- case 1:
- case 3:
- audios = stateFootAudios[(int)_state];
- break;
- // case 2:
- // if (rideAudios.ContainsKey(_horseId))
- // {
- // audios = rideAudios[_horseId];
- // }
- // else
- // {
- // var config = HorseConfig.Get(_horseId);
- // audios = new int[config.RideAudios.Length];
- // Array.Copy(config.RideAudios, audios, config.RideAudios.Length);
- // rideAudios[_horseId] = audios;
- // }
- // break;
- default:
- break;
- }
+// int[] audios = null;
+// switch (stateInt)
+// {
+// case 1:
+// case 3:
+// audios = stateFootAudios[(int)_state];
+// break;
+// // case 2:
+// // if (rideAudios.ContainsKey(_horseId))
+// // {
+// // audios = rideAudios[_horseId];
+// // }
+// // else
+// // {
+// // var config = HorseConfig.Get(_horseId);
+// // audios = new int[config.RideAudios.Length];
+// // Array.Copy(config.RideAudios, audios, config.RideAudios.Length);
+// // rideAudios[_horseId] = audios;
+// // }
+// // break;
+// default:
+// break;
+// }
- if (audioIndex < audios.Length)
- {
- var audio = audios[audioIndex];
- SoundPlayer.Instance.PlayAudio(_audioSource, audio);
- stateFootAudioLastPlayTimes[stateInt] = DateTime.Now;
- audioIndex++;
- }
+// if (audioIndex < audios.Length)
+// {
+// var audio = audios[audioIndex];
+// SoundPlayer.Instance.PlayAudio(_audioSource, audio);
+// stateFootAudioLastPlayTimes[stateInt] = DateTime.Now;
+// audioIndex++;
+// }
- if (audioIndex >= audios.Length)
- {
- audioIndex = 0;
- }
- }
+// if (audioIndex >= audios.Length)
+// {
+// audioIndex = 0;
+// }
+// }
-}
+// }
--
Gitblit v1.8.0