优化更新
1.精简框架核心代码 2.降低框架扩展功能的依赖耦合 3.更新高性能FSM结构
This commit is contained in:
parent
a7598232cf
commit
5941a2cdb2
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
|||||||
[submodule "Client/Packages/com.alicizax.unity.ui.extension"]
|
|
||||||
path = Client/Packages/com.alicizax.unity.ui.extension
|
|
||||||
url = http://101.34.252.46:3000/AlicizaX/com.alicizax.unity.ui.extension.git
|
|
||||||
@ -1,107 +0,0 @@
|
|||||||
#if ENABLE_HYBRIDCLR
|
|
||||||
using HybridCLR.Editor;
|
|
||||||
using HybridCLR.Editor.Commands;
|
|
||||||
#endif
|
|
||||||
using AlicizaX.Editor;
|
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
[InitializeOnLoad]
|
|
||||||
public static class BuildDLLCommand
|
|
||||||
{
|
|
||||||
private const string EnableHybridClrScriptingDefineSymbol = "ENABLE_HYBRIDCLR";
|
|
||||||
public const string AssemblyTextAssetPath = "Bundles/DLL";
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 禁用HybridCLR宏定义。
|
|
||||||
/// </summary>
|
|
||||||
[MenuItem("HybridCLR/Tools/Define Symbols/Disable HybridCLR", false, 30)]
|
|
||||||
public static void Disable()
|
|
||||||
{
|
|
||||||
ScriptingDefineSymbols.RemoveScriptingDefineSymbol(EnableHybridClrScriptingDefineSymbol);
|
|
||||||
HybridCLR.Editor.SettingsUtil.Enable = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开启HybridCLR宏定义。
|
|
||||||
/// </summary>
|
|
||||||
[MenuItem("HybridCLR/Tools/Define Symbols/Enable HybridCLR", false, 31)]
|
|
||||||
public static void Enable()
|
|
||||||
{
|
|
||||||
ScriptingDefineSymbols.RemoveScriptingDefineSymbol(EnableHybridClrScriptingDefineSymbol);
|
|
||||||
ScriptingDefineSymbols.AddScriptingDefineSymbol(EnableHybridClrScriptingDefineSymbol);
|
|
||||||
HybridCLR.Editor.SettingsUtil.Enable = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if ENABLE_HYBRIDCLR
|
|
||||||
[MenuItem("HybridCLR/Tools/BuildAssets And CopyTo AssemblyTextAssetPath")]
|
|
||||||
public static void BuildAndCopyDlls()
|
|
||||||
{
|
|
||||||
BuildTarget target = EditorUserBuildSettings.activeBuildTarget;
|
|
||||||
CompileDllCommand.CompileDll(target);
|
|
||||||
CopyAOTHotUpdateDlls(target);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public static void GenerateHybridCLRSome()
|
|
||||||
{
|
|
||||||
PrebuildCommand.GenerateAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void BuildAndCopyDlls(BuildTarget target)
|
|
||||||
{
|
|
||||||
#if ENABLE_HYBRIDCLR
|
|
||||||
CompileDllCommand.CompileDll(target);
|
|
||||||
CopyAOTHotUpdateDlls(target);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void CopyAOTHotUpdateDlls(BuildTarget target)
|
|
||||||
{
|
|
||||||
CopyAOTAssembliesToAssetPath();
|
|
||||||
CopyHotUpdateAssembliesToAssetPath();
|
|
||||||
AssetDatabase.Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void CopyAOTAssembliesToAssetPath()
|
|
||||||
{
|
|
||||||
#if ENABLE_HYBRIDCLR
|
|
||||||
var target = EditorUserBuildSettings.activeBuildTarget;
|
|
||||||
string aotAssembliesSrcDir = SettingsUtil.GetAssembliesPostIl2CppStripDir(target);
|
|
||||||
string aotAssembliesDstDir = Application.dataPath + "/" + AssemblyTextAssetPath;
|
|
||||||
|
|
||||||
foreach (var dll in AOTGenericReferences.PatchedAOTAssemblyList)
|
|
||||||
{
|
|
||||||
string srcDllPath = $"{aotAssembliesSrcDir}/{dll}";
|
|
||||||
if (!System.IO.File.Exists(srcDllPath))
|
|
||||||
{
|
|
||||||
Debug.LogError(
|
|
||||||
$"ab中添加AOT补充元数据dll:{srcDllPath} 时发生错误,文件不存在。裁剪后的AOT dll在BuildPlayer时才能生成,因此需要你先构建一次游戏App后再打包。");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
string dllBytesPath = $"{aotAssembliesDstDir}/{dll}.bytes";
|
|
||||||
System.IO.File.Copy(srcDllPath, dllBytesPath, true);
|
|
||||||
Debug.Log($"[CopyAOTAssembliesToStreamingAssets] copy AOT dll {srcDllPath} -> {dllBytesPath}");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void CopyHotUpdateAssembliesToAssetPath()
|
|
||||||
{
|
|
||||||
#if ENABLE_HYBRIDCLR
|
|
||||||
var target = EditorUserBuildSettings.activeBuildTarget;
|
|
||||||
|
|
||||||
string hotfixDllSrcDir = SettingsUtil.GetHotUpdateDllsOutputDirByTarget(target);
|
|
||||||
string hotfixAssembliesDstDir = Application.dataPath + "/" + AssemblyTextAssetPath;
|
|
||||||
foreach (var dll in SettingsUtil.HotUpdateAssemblyFilesExcludePreserved)
|
|
||||||
{
|
|
||||||
string dllPath = $"{hotfixDllSrcDir}/{dll}";
|
|
||||||
string dllBytesPath = $"{hotfixAssembliesDstDir}/{dll}.bytes";
|
|
||||||
System.IO.File.Copy(dllPath, dllBytesPath, true);
|
|
||||||
Debug.Log($"[CopyHotUpdateAssembliesToStreamingAssets] copy hotfix dll {dllPath} -> {dllBytesPath}");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 0761954ba63648b8b73f8ebb736bb9eb
|
|
||||||
timeCreated: 1737524294
|
|
||||||
142
Client/Assets/PlayerController.cs
Normal file
142
Client/Assets/PlayerController.cs
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Threading;
|
||||||
|
using AlicizaX;
|
||||||
|
using AlicizaX.Fsm;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
||||||
|
public enum PlayerState
|
||||||
|
{
|
||||||
|
Idle,
|
||||||
|
Move,
|
||||||
|
Jump,
|
||||||
|
Dead
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class PlayerBlackBoard : IMemory
|
||||||
|
{
|
||||||
|
public float Hp;
|
||||||
|
public bool Grounded;
|
||||||
|
public Vector3 Pos;
|
||||||
|
public Vector3 Vel;
|
||||||
|
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
Hp = 100f;
|
||||||
|
Grounded = true;
|
||||||
|
Pos = Vector3.zero;
|
||||||
|
Vel = Vector3.zero;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class PlayerFSM
|
||||||
|
{
|
||||||
|
public static readonly StateFunc<PlayerBlackBoard>[] Funcs;
|
||||||
|
public static readonly Transition<PlayerBlackBoard>[] Trans;
|
||||||
|
|
||||||
|
static PlayerFSM()
|
||||||
|
{
|
||||||
|
Funcs = new StateFunc<PlayerBlackBoard>[3];
|
||||||
|
|
||||||
|
Funcs[(int)PlayerState.Idle] = StateFunc<PlayerBlackBoard>.Make(
|
||||||
|
(PlayerBlackBoard b) => { },
|
||||||
|
(PlayerBlackBoard b) =>
|
||||||
|
{
|
||||||
|
var h = Input.GetAxisRaw("Horizontal");
|
||||||
|
var v = Input.GetAxisRaw("Vertical");
|
||||||
|
if (h != 0 || v != 0) return (int)PlayerState.Move;
|
||||||
|
if (Input.GetKeyDown(KeyCode.Space) && b.Grounded) return (int)PlayerState.Jump;
|
||||||
|
return -1;
|
||||||
|
},
|
||||||
|
(PlayerBlackBoard b) => { }
|
||||||
|
);
|
||||||
|
|
||||||
|
Funcs[(int)PlayerState.Move] = StateFunc<PlayerBlackBoard>.Make(
|
||||||
|
(PlayerBlackBoard b) => { },
|
||||||
|
(PlayerBlackBoard b) =>
|
||||||
|
{
|
||||||
|
var move = new Vector3(Input.GetAxisRaw("Horizontal"), 0, Input.GetAxisRaw("Vertical"));
|
||||||
|
if (move.sqrMagnitude < 0.001f) return (int)PlayerState.Idle;
|
||||||
|
b.Pos += move.normalized * 5f * Time.deltaTime;
|
||||||
|
if (Input.GetKeyDown(KeyCode.Space) && b.Grounded) return (int)PlayerState.Jump;
|
||||||
|
return -1;
|
||||||
|
},
|
||||||
|
(PlayerBlackBoard b) => { }
|
||||||
|
);
|
||||||
|
|
||||||
|
Funcs[(int)PlayerState.Jump] = StateFunc<PlayerBlackBoard>.Make(
|
||||||
|
(PlayerBlackBoard b) =>
|
||||||
|
{
|
||||||
|
b.Grounded = false;
|
||||||
|
b.Vel = Vector3.up * 5f;
|
||||||
|
},
|
||||||
|
(PlayerBlackBoard b) =>
|
||||||
|
{
|
||||||
|
b.Vel += Physics.gravity * Time.deltaTime;
|
||||||
|
b.Pos += b.Vel * Time.deltaTime;
|
||||||
|
if (b.Pos.y <= 0f)
|
||||||
|
{
|
||||||
|
b.Pos = new Vector3(b.Pos.x, 0f, b.Pos.z);
|
||||||
|
b.Grounded = true;
|
||||||
|
return (int)PlayerState.Idle;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
},
|
||||||
|
(PlayerBlackBoard b) => { }
|
||||||
|
);
|
||||||
|
|
||||||
|
Trans = new Transition<PlayerBlackBoard>[]
|
||||||
|
{
|
||||||
|
new Transition<PlayerBlackBoard>((int)PlayerState.Idle, (int)PlayerState.Dead, (PlayerBlackBoard b) => b.Hp <= 0f, priority: -10),
|
||||||
|
new Transition<PlayerBlackBoard>((int)PlayerState.Move, (int)PlayerState.Dead, (PlayerBlackBoard b) => b.Hp <= 0f, priority: -10),
|
||||||
|
new Transition<PlayerBlackBoard>((int)PlayerState.Jump, (int)PlayerState.Dead, (PlayerBlackBoard b) => b.Hp <= 0f, priority: -10),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FsmConfig<PlayerBlackBoard> CreateConfig(PlayerState defaultState = PlayerState.Idle)
|
||||||
|
{
|
||||||
|
return new FsmConfig<PlayerBlackBoard>(Funcs, Trans, (int)defaultState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PlayerController : MonoBehaviour
|
||||||
|
{
|
||||||
|
private Fsm<PlayerBlackBoard> _fsm;
|
||||||
|
|
||||||
|
void Awake()
|
||||||
|
{
|
||||||
|
// Use pooled blackboard and manager-created FSM (auto debug bind in Editor)
|
||||||
|
var cfg = PlayerFSM.CreateConfig();
|
||||||
|
_fsm = GameApp.Fsm.Create(cfg, owner: this, stateNameGetter: i => ((PlayerState)i).ToString());
|
||||||
|
_fsm.Blackboard.Clear(); // ensure default values on start
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (Input.GetKeyDown(KeyCode.H))
|
||||||
|
{
|
||||||
|
_fsm.Blackboard.Hp -= 50f;
|
||||||
|
Debug.Log("HP: " + _fsm.Blackboard.Hp);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Input.GetKeyDown(KeyCode.P))
|
||||||
|
{
|
||||||
|
_fsm.Blackboard.Hp = 100f;
|
||||||
|
_fsm.Reset((int)PlayerState.Idle);
|
||||||
|
Debug.Log("Revived");
|
||||||
|
}
|
||||||
|
|
||||||
|
transform.position = _fsm.Blackboard.Pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDestroy()
|
||||||
|
{
|
||||||
|
// Return both FSM and BB to their pools via manager helper
|
||||||
|
GameApp.Fsm.DestroyFsm(_fsm);
|
||||||
|
_fsm = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Client/Assets/PlayerController.cs.meta
Normal file
3
Client/Assets/PlayerController.cs.meta
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 467f04e0978c41baa315c54cbf52a295
|
||||||
|
timeCreated: 1756969075
|
||||||
@ -1,90 +0,0 @@
|
|||||||
// 状态定义
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using AlicizaX;
|
|
||||||
using AlicizaX.Fsm.Runtime;
|
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Profiling;
|
|
||||||
|
|
||||||
public class NavigationState : StateBase<EnemyAI.EnemyAIState>
|
|
||||||
{
|
|
||||||
protected override void OnInit()
|
|
||||||
{
|
|
||||||
Debug.Log("Nav1初始化");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnEnter()
|
|
||||||
{
|
|
||||||
Debug.Log("Nav1进入");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnExit()
|
|
||||||
{
|
|
||||||
Debug.Log("Nav1退出");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnUpdate(float deltaTime)
|
|
||||||
{
|
|
||||||
if (Input.GetKeyDown(KeyCode.A))
|
|
||||||
{
|
|
||||||
SwitchState(EnemyAI.EnemyAIState.Navi2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class NavigationState2 : StateBase<EnemyAI.EnemyAIState>
|
|
||||||
{
|
|
||||||
protected override void OnInit()
|
|
||||||
{
|
|
||||||
Debug.Log("Nav2初始化");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnEnter()
|
|
||||||
{
|
|
||||||
Debug.Log("Nav2进入");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnExit()
|
|
||||||
{
|
|
||||||
Debug.Log("Nav2退出");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnUpdate(float deltaTime)
|
|
||||||
{
|
|
||||||
if (Input.GetKeyDown(KeyCode.D))
|
|
||||||
{
|
|
||||||
SwitchState(EnemyAI.EnemyAIState.Navi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class EnemyAI : MonoBehaviour
|
|
||||||
{
|
|
||||||
public enum EnemyAIState
|
|
||||||
{
|
|
||||||
Navi,
|
|
||||||
Navi2
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Start()
|
|
||||||
{
|
|
||||||
// Profiler.BeginSample("FSM");
|
|
||||||
//
|
|
||||||
// var fsm = GameApp.Fsm.Create<EnemyAIState>("EnemyAI");
|
|
||||||
// fsm.Register<NavigationState>(EnemyAIState.Navi);
|
|
||||||
// fsm.SwitchState(0);
|
|
||||||
// GameApp.Fsm.Destroy(fsm);
|
|
||||||
//
|
|
||||||
// Profiler.EndSample();
|
|
||||||
|
|
||||||
Profiler.BeginSample("FSM2");
|
|
||||||
var fsm2 = GameApp.Fsm.Create<EnemyAIState>("EnemyAI2");
|
|
||||||
fsm2.Register<NavigationState>(EnemyAIState.Navi);
|
|
||||||
fsm2.Register<NavigationState2>(EnemyAIState.Navi2);
|
|
||||||
fsm2.SwitchState(0);
|
|
||||||
Profiler.EndSample();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: c707b7c451a649d7b20c79c895cad26b
|
|
||||||
timeCreated: 1745549059
|
|
||||||
@ -9,8 +9,6 @@
|
|||||||
"GUID:5553d74549d54e74cb548b3ab58a8483",
|
"GUID:5553d74549d54e74cb548b3ab58a8483",
|
||||||
"GUID:000cc1eaf688c5246be5328cb0cf16c8",
|
"GUID:000cc1eaf688c5246be5328cb0cf16c8",
|
||||||
"GUID:be2f20a77f3232f44b9711ef43234aac",
|
"GUID:be2f20a77f3232f44b9711ef43234aac",
|
||||||
"GUID:4041d17782e62754ba8777fe2dfb6b27",
|
|
||||||
"GUID:2393d135922de5c4ab12e74f1e397920",
|
|
||||||
"GUID:e9c35c8938f782649bb7e670099ca425",
|
"GUID:e9c35c8938f782649bb7e670099ca425",
|
||||||
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
||||||
"GUID:425703724086804498a0f4888e7e2e6d",
|
"GUID:425703724086804498a0f4888e7e2e6d",
|
||||||
@ -19,7 +17,8 @@
|
|||||||
"GUID:760f1778adc613f49a4394fb41ff0bbc",
|
"GUID:760f1778adc613f49a4394fb41ff0bbc",
|
||||||
"GUID:f318a940a77af754eb1172da9dc1b400",
|
"GUID:f318a940a77af754eb1172da9dc1b400",
|
||||||
"GUID:198eb6af143bbc4488e2779d96697e06",
|
"GUID:198eb6af143bbc4488e2779d96697e06",
|
||||||
"GUID:75469ad4d38634e559750d17036d5f7c"
|
"GUID:75469ad4d38634e559750d17036d5f7c",
|
||||||
|
"GUID:1619e00706139ce488ff80c0daeea8e7"
|
||||||
],
|
],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
|
|||||||
@ -3,7 +3,6 @@ using AlicizaX.UI.Runtime;
|
|||||||
using GameLogic.Event.Generated;
|
using GameLogic.Event.Generated;
|
||||||
using GameLogic.UI;
|
using GameLogic.UI;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using AudioType = AlicizaX.Audio.Runtime.AudioType;
|
|
||||||
|
|
||||||
namespace Hotfix.GameLogic.TestWindow
|
namespace Hotfix.GameLogic.TestWindow
|
||||||
{
|
{
|
||||||
@ -23,6 +22,7 @@ namespace Hotfix.GameLogic.TestWindow
|
|||||||
baseui.ImgBackGround.color = Color.gray;
|
baseui.ImgBackGround.color = Color.gray;
|
||||||
baseui.Btntest.onClick.AddListener(OnTestClick);
|
baseui.Btntest.onClick.AddListener(OnTestClick);
|
||||||
baseui.Btntest.BindHotKey();
|
baseui.Btntest.BindHotKey();
|
||||||
|
Utility.Text.Format("1{}", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,8 +4,8 @@ using System.Collections.Generic;
|
|||||||
using AlicizaX.Resource.Runtime;
|
using AlicizaX.Resource.Runtime;
|
||||||
using AlicizaX.Localization.Runtime;
|
using AlicizaX.Localization.Runtime;
|
||||||
using AlicizaX;
|
using AlicizaX;
|
||||||
|
using AlicizaX.Framework.Runtime.Event.Generated;
|
||||||
using Cysharp.Threading.Tasks;
|
using Cysharp.Threading.Tasks;
|
||||||
using AlicizaX.Resource.Runtime.Event.Generated;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
using Cysharp.Threading.Tasks;
|
using Cysharp.Threading.Tasks;
|
||||||
using AlicizaX.Resource.Runtime;
|
using AlicizaX.Resource.Runtime;
|
||||||
using AlicizaX;
|
using AlicizaX;
|
||||||
using AlicizaX.Resource.Runtime.Event.Generated;
|
using AlicizaX.Framework.Runtime.Event.Generated;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using YooAsset;
|
using YooAsset;
|
||||||
|
|
||||||
|
|||||||
@ -22,29 +22,34 @@ namespace Unity.Startup.Procedure
|
|||||||
|
|
||||||
public class Procedure : MonoBehaviour
|
public class Procedure : MonoBehaviour
|
||||||
{
|
{
|
||||||
private UltraFSM<UpdateProcedureState> _fsm;
|
private SimpleFSM<UpdateProcedureState> _fsm;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
_fsm = GameApp.Fsm.Create<UpdateProcedureState>("Procedure");
|
_fsm = new SimpleFSM<UpdateProcedureState>();
|
||||||
_fsm.Register<ProcedureLauncherState>(UpdateProcedureState.ProcedureStart, false);
|
_fsm.Register<ProcedureLauncherState>(UpdateProcedureState.ProcedureStart);
|
||||||
_fsm.Register<ProcedureGetGlobalInfoState>(UpdateProcedureState.ProcedureGetGlobalInfoState, false);
|
_fsm.Register<ProcedureGetGlobalInfoState>(UpdateProcedureState.ProcedureGetGlobalInfoState);
|
||||||
_fsm.Register<ProcedureGetAppVersionInfoState>(UpdateProcedureState.ProcedureGetAppVersionInfoState, false);
|
_fsm.Register<ProcedureGetAppVersionInfoState>(UpdateProcedureState.ProcedureGetAppVersionInfoState);
|
||||||
_fsm.Register<ProcedureUpdateStaticVersion>(UpdateProcedureState.ProcedureUpdateStaticVersion, false);
|
_fsm.Register<ProcedureUpdateStaticVersion>(UpdateProcedureState.ProcedureUpdateStaticVersion);
|
||||||
_fsm.Register<ProcedureUpdateManifest>(UpdateProcedureState.ProcedureUpdateManifest, false);
|
_fsm.Register<ProcedureUpdateManifest>(UpdateProcedureState.ProcedureUpdateManifest);
|
||||||
_fsm.Register<ProcedurePatchInit>(UpdateProcedureState.ProcedurePatchInit, false);
|
_fsm.Register<ProcedurePatchInit>(UpdateProcedureState.ProcedurePatchInit);
|
||||||
_fsm.Register<ProcedureCreateDownloader>(UpdateProcedureState.ProcedureCreateDownloader, false);
|
_fsm.Register<ProcedureCreateDownloader>(UpdateProcedureState.ProcedureCreateDownloader);
|
||||||
_fsm.Register<ProcedureDownloadWebFiles>(UpdateProcedureState.ProcedureDownloadWebFiles, false);
|
_fsm.Register<ProcedureDownloadWebFiles>(UpdateProcedureState.ProcedureDownloadWebFiles);
|
||||||
_fsm.Register<ProcedurePatchDone>(UpdateProcedureState.ProcedurePatchDone, false);
|
_fsm.Register<ProcedurePatchDone>(UpdateProcedureState.ProcedurePatchDone);
|
||||||
_fsm.Register<ProcedureClearCache>(UpdateProcedureState.ProcedureClearCache, false);
|
_fsm.Register<ProcedureClearCache>(UpdateProcedureState.ProcedureClearCache);
|
||||||
_fsm.Register<ProcedureLoadAssembly>(UpdateProcedureState.ProcedureLoadAssembly, false);
|
_fsm.Register<ProcedureLoadAssembly>(UpdateProcedureState.ProcedureLoadAssembly);
|
||||||
_fsm.Register<ProcedureGameLauncherState>(UpdateProcedureState.ProcedureGameLauncherState, false);
|
_fsm.Register<ProcedureGameLauncherState>(UpdateProcedureState.ProcedureGameLauncherState);
|
||||||
_fsm.SwitchState(UpdateProcedureState.ProcedureStart);
|
_fsm.SwitchState(UpdateProcedureState.ProcedureStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
_fsm.Update(Time.deltaTime);
|
||||||
|
}
|
||||||
|
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
{
|
{
|
||||||
GameApp.Fsm.Destroy(_fsm);
|
_fsm.Dispose();
|
||||||
_fsm = null;
|
_fsm = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,8 @@
|
|||||||
"Unity.TextMeshPro",
|
"Unity.TextMeshPro",
|
||||||
"AlicizaX.UI.Runtime",
|
"AlicizaX.UI.Runtime",
|
||||||
"AlicizaX.Localization.Runtime",
|
"AlicizaX.Localization.Runtime",
|
||||||
"ZString"
|
"ZString",
|
||||||
|
"AlicizaX.Framework.Runtime"
|
||||||
],
|
],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,15 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Sirenix.OdinInspector;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.InputSystem;
|
|
||||||
|
|
||||||
public class UITestMono : MonoBehaviour
|
|
||||||
{
|
|
||||||
public UXButton button;
|
|
||||||
|
|
||||||
[Button]
|
|
||||||
public void Select()
|
|
||||||
{
|
|
||||||
button.Selected = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 505f6b3030031c24f994c1d4b93fbe20
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a468f89f8775ad344b122add3a3df2a6
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "AlicizaX.Audio.Editor",
|
|
||||||
"rootNamespace": "AlicizaX.Audio.Editor",
|
|
||||||
"references": [
|
|
||||||
"GUID:acfef7cabed3b0a42b25edb1cd4fa259",
|
|
||||||
"GUID:75b6f2078d190f14dbda4a5b747d709c",
|
|
||||||
"GUID:198eb6af143bbc4488e2779d96697e06"
|
|
||||||
],
|
|
||||||
"includePlatforms": [
|
|
||||||
"Editor"
|
|
||||||
],
|
|
||||||
"excludePlatforms": [],
|
|
||||||
"allowUnsafeCode": true,
|
|
||||||
"overrideReferences": false,
|
|
||||||
"precompiledReferences": [],
|
|
||||||
"autoReferenced": true,
|
|
||||||
"defineConstraints": [],
|
|
||||||
"versionDefines": [],
|
|
||||||
"noEngineReferences": false
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 354e73f64ed57094aa53292cb6a837af
|
|
||||||
AssemblyDefinitionImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
using System;
|
|
||||||
using AlicizaX.Audio.Runtime;
|
|
||||||
using AlicizaX.Editor;
|
|
||||||
using UnityEditor;
|
|
||||||
|
|
||||||
namespace AlicizaX.Audio.Editor
|
|
||||||
{
|
|
||||||
[CustomEditor(typeof(AudioComponent))]
|
|
||||||
internal sealed class AudioComponentInspector : GameFrameworkInspector
|
|
||||||
{
|
|
||||||
private SerializedProperty m_InstanceRoot = null;
|
|
||||||
private SerializedProperty m_AudioMixer = null;
|
|
||||||
private SerializedProperty m_AudioGroupConfigs = null;
|
|
||||||
|
|
||||||
public override void OnInspectorGUI()
|
|
||||||
{
|
|
||||||
base.OnInspectorGUI();
|
|
||||||
|
|
||||||
serializedObject.Update();
|
|
||||||
|
|
||||||
AudioComponent t = (AudioComponent)target;
|
|
||||||
|
|
||||||
EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode);
|
|
||||||
{
|
|
||||||
EditorGUILayout.PropertyField(m_InstanceRoot);
|
|
||||||
EditorGUILayout.PropertyField(m_AudioMixer);
|
|
||||||
|
|
||||||
EditorGUILayout.PropertyField(m_AudioGroupConfigs, true);
|
|
||||||
}
|
|
||||||
EditorGUI.EndDisabledGroup();
|
|
||||||
|
|
||||||
serializedObject.ApplyModifiedProperties();
|
|
||||||
|
|
||||||
Repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnEnable()
|
|
||||||
{
|
|
||||||
m_InstanceRoot = serializedObject.FindProperty("m_InstanceRoot");
|
|
||||||
m_AudioMixer = serializedObject.FindProperty("m_AudioMixer");
|
|
||||||
m_AudioGroupConfigs = serializedObject.FindProperty("m_AudioGroupConfigs");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 886dba87f6324f2c8b9639a9d4947bff
|
|
||||||
timeCreated: 1737390298
|
|
||||||
@ -1,201 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright [2023] [ALianBlank of copyright owner][alianblank@outlook.com][https://alianblank.com/]
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 8dfeb44365f40c74bbe24547a7b24d57
|
|
||||||
TextScriptImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 716ce0c831ca8a748b0054866f8519f2
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "AlicizaX.Audio.Runtime",
|
|
||||||
"rootNamespace": "AlicizaX.Audio.Runtime",
|
|
||||||
"references": [
|
|
||||||
"GUID:75b6f2078d190f14dbda4a5b747d709c",
|
|
||||||
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
|
||||||
"GUID:be2f20a77f3232f44b9711ef43234aac",
|
|
||||||
"GUID:e34a5702dd353724aa315fb8011f08c3"
|
|
||||||
],
|
|
||||||
"includePlatforms": [],
|
|
||||||
"excludePlatforms": [],
|
|
||||||
"allowUnsafeCode": true,
|
|
||||||
"overrideReferences": false,
|
|
||||||
"precompiledReferences": [],
|
|
||||||
"autoReferenced": true,
|
|
||||||
"defineConstraints": [],
|
|
||||||
"versionDefines": [],
|
|
||||||
"noEngineReferences": false
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 198eb6af143bbc4488e2779d96697e06
|
|
||||||
AssemblyDefinitionImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 65ab69a3b3c64f22b899938b5234583f
|
|
||||||
timeCreated: 1737390310
|
|
||||||
@ -1,455 +0,0 @@
|
|||||||
using AlicizaX.Resource.Runtime;
|
|
||||||
using AlicizaX;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Audio;
|
|
||||||
using YooAsset;
|
|
||||||
|
|
||||||
namespace AlicizaX.Audio.Runtime
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理辅助器。
|
|
||||||
/// </summary>
|
|
||||||
public class AudioAgent
|
|
||||||
{
|
|
||||||
private int _instanceId;
|
|
||||||
private AudioSource _source;
|
|
||||||
private AudioData _audioData;
|
|
||||||
private IAudioModule _audioModule;
|
|
||||||
private IResourceModule _resourceModule;
|
|
||||||
private Transform _transform;
|
|
||||||
private float _volume = 1.0f;
|
|
||||||
private float _duration;
|
|
||||||
private float _fadeoutTimer;
|
|
||||||
private const float FADEOUT_DURATION = 0.2f;
|
|
||||||
private bool _inPool;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理辅助器运行时状态。
|
|
||||||
/// </summary>
|
|
||||||
AudioAgentRuntimeState _audioAgentRuntimeState = AudioAgentRuntimeState.None;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理加载请求。
|
|
||||||
/// </summary>
|
|
||||||
class LoadRequest
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理辅助器加载路径。
|
|
||||||
/// </summary>
|
|
||||||
public string Path;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否异步。
|
|
||||||
/// </summary>
|
|
||||||
public bool BAsync;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否池化。
|
|
||||||
/// </summary>
|
|
||||||
public bool BInPool;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理加载请求。
|
|
||||||
/// </summary>
|
|
||||||
LoadRequest _pendingLoad = null;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// AudioSource实例化Id
|
|
||||||
/// </summary>
|
|
||||||
public int InstanceId => _instanceId;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 资源操作句柄。
|
|
||||||
/// </summary>
|
|
||||||
public AudioData AudioData => _audioData;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理辅助器音频大小。
|
|
||||||
/// </summary>
|
|
||||||
public float Volume
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_source != null)
|
|
||||||
{
|
|
||||||
_volume = value;
|
|
||||||
_source.volume = _volume;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
get => _volume;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理辅助器当前是否空闲。
|
|
||||||
/// </summary>
|
|
||||||
public bool IsFree
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_source != null)
|
|
||||||
{
|
|
||||||
return _audioAgentRuntimeState == AudioAgentRuntimeState.End;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理辅助器播放秒数。
|
|
||||||
/// </summary>
|
|
||||||
public float Duration => _duration;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理辅助器当前音频长度。
|
|
||||||
/// </summary>
|
|
||||||
public float Length
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_source != null && _source.clip != null)
|
|
||||||
{
|
|
||||||
return _source.clip.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理辅助器实例位置。
|
|
||||||
/// </summary>
|
|
||||||
public Vector3 Position
|
|
||||||
{
|
|
||||||
get => _transform.position;
|
|
||||||
set => _transform.position = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理辅助器是否循环。
|
|
||||||
/// </summary>
|
|
||||||
public bool IsLoop
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_source != null)
|
|
||||||
{
|
|
||||||
return _source.loop;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_source != null)
|
|
||||||
{
|
|
||||||
_source.loop = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理辅助器是否正在播放。
|
|
||||||
/// </summary>
|
|
||||||
internal bool IsPlaying
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_source != null && _source.isPlaying)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理辅助器获取当前声源。
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public AudioSource AudioResource()
|
|
||||||
{
|
|
||||||
return _source;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建音频代理辅助器。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">生效路径。</param>
|
|
||||||
/// <param name="bAsync">是否异步。</param>
|
|
||||||
/// <param name="audioCategory">音频轨道(类别)。</param>
|
|
||||||
/// <param name="bInPool">是否池化。</param>
|
|
||||||
/// <returns>音频代理辅助器。</returns>
|
|
||||||
public static AudioAgent Create(string path, bool bAsync, AudioCategory audioCategory, bool bInPool = false)
|
|
||||||
{
|
|
||||||
AudioAgent audioAgent = new AudioAgent();
|
|
||||||
audioAgent.Init(audioCategory);
|
|
||||||
audioAgent.Load(path, bAsync, bInPool);
|
|
||||||
return audioAgent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AudioAgent Create(AudioClip clip, AudioCategory audioCategory)
|
|
||||||
{
|
|
||||||
AudioAgent audioAgent = new AudioAgent();
|
|
||||||
audioAgent.Init(audioCategory);
|
|
||||||
audioAgent.SetAudioClip(clip);
|
|
||||||
return audioAgent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetAudioClip(AudioClip clip)
|
|
||||||
{
|
|
||||||
if (_source == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Stop(false);
|
|
||||||
|
|
||||||
if (_audioData != null)
|
|
||||||
{
|
|
||||||
AudioData.DeAlloc(_audioData);
|
|
||||||
_audioData = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
_source.clip = clip;
|
|
||||||
if (clip != null)
|
|
||||||
{
|
|
||||||
_source.Play();
|
|
||||||
_audioAgentRuntimeState = AudioAgentRuntimeState.Playing;
|
|
||||||
_duration = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_audioAgentRuntimeState = AudioAgentRuntimeState.End;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 初始化音频代理辅助器。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="audioCategory">音频轨道(类别)。</param>
|
|
||||||
/// <param name="index">音频代理辅助器编号。</param>
|
|
||||||
public void Init(AudioCategory audioCategory, int index = 0)
|
|
||||||
{
|
|
||||||
_audioModule = ModuleSystem.GetModule<IAudioModule>();
|
|
||||||
_resourceModule = ModuleSystem.GetModule<IResourceModule>();
|
|
||||||
GameObject host = new GameObject(Utility.Text.Format("Audio Agent Helper - {0} - {1}", audioCategory.AudioMixerGroup.name, index));
|
|
||||||
host.transform.SetParent(audioCategory.InstanceRoot);
|
|
||||||
host.transform.localPosition = Vector3.zero;
|
|
||||||
_transform = host.transform;
|
|
||||||
_source = host.AddComponent<AudioSource>();
|
|
||||||
_source.playOnAwake = false;
|
|
||||||
AudioMixerGroup[] audioMixerGroups =
|
|
||||||
audioCategory.AudioMixer.FindMatchingGroups(Utility.Text.Format("Master/{0}/{1}", audioCategory.AudioMixerGroup.name,
|
|
||||||
$"{audioCategory.AudioMixerGroup.name} - {index}"));
|
|
||||||
_source.outputAudioMixerGroup = audioMixerGroups.Length > 0 ? audioMixerGroups[0] : audioCategory.AudioMixerGroup;
|
|
||||||
_source.rolloffMode = audioCategory.AudioGroupConfig.audioRolloffMode;
|
|
||||||
_source.minDistance = audioCategory.AudioGroupConfig.minDistance;
|
|
||||||
_source.maxDistance = audioCategory.AudioGroupConfig.maxDistance;
|
|
||||||
_instanceId = _source.GetInstanceID();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 加载音频代理辅助器。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">资源路径。</param>
|
|
||||||
/// <param name="bAsync">是否异步。</param>
|
|
||||||
/// <param name="bInPool">是否池化。</param>
|
|
||||||
public void Load(string path, bool bAsync, bool bInPool = false)
|
|
||||||
{
|
|
||||||
_inPool = bInPool;
|
|
||||||
if (_audioAgentRuntimeState == AudioAgentRuntimeState.None || _audioAgentRuntimeState == AudioAgentRuntimeState.End)
|
|
||||||
{
|
|
||||||
_duration = 0;
|
|
||||||
if (!string.IsNullOrEmpty(path))
|
|
||||||
{
|
|
||||||
if (bInPool && _audioModule.AudioClipPool.TryGetValue(path, out var operationHandle))
|
|
||||||
{
|
|
||||||
OnAssetLoadComplete(operationHandle);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bAsync)
|
|
||||||
{
|
|
||||||
_audioAgentRuntimeState = AudioAgentRuntimeState.Loading;
|
|
||||||
AssetHandle handle = _resourceModule.LoadAssetAsyncHandle<AudioClip>(path);
|
|
||||||
handle.Completed += OnAssetLoadComplete;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
AssetHandle handle = _resourceModule.LoadAssetSyncHandle<AudioClip>(path);
|
|
||||||
OnAssetLoadComplete(handle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_pendingLoad = new LoadRequest { Path = path, BAsync = bAsync, BInPool = bInPool };
|
|
||||||
|
|
||||||
if (_audioAgentRuntimeState == AudioAgentRuntimeState.Playing)
|
|
||||||
{
|
|
||||||
Stop(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 停止播放音频代理辅助器。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fadeout">是否渐出。</param>
|
|
||||||
public void Stop(bool fadeout = false)
|
|
||||||
{
|
|
||||||
if (_source != null)
|
|
||||||
{
|
|
||||||
if (fadeout)
|
|
||||||
{
|
|
||||||
_fadeoutTimer = FADEOUT_DURATION;
|
|
||||||
_audioAgentRuntimeState = AudioAgentRuntimeState.FadingOut;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_source.Stop();
|
|
||||||
_audioAgentRuntimeState = AudioAgentRuntimeState.End;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 暂停音频代理辅助器。
|
|
||||||
/// </summary>
|
|
||||||
public void Pause()
|
|
||||||
{
|
|
||||||
if (_source != null)
|
|
||||||
{
|
|
||||||
_source.Pause();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 取消暂停音频代理辅助器。
|
|
||||||
/// </summary>
|
|
||||||
public void UnPause()
|
|
||||||
{
|
|
||||||
if (_source != null)
|
|
||||||
{
|
|
||||||
_source.UnPause();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 资源加载完成。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="handle">资源操作句柄。</param>
|
|
||||||
void OnAssetLoadComplete(AssetHandle handle)
|
|
||||||
{
|
|
||||||
if (handle != null)
|
|
||||||
{
|
|
||||||
if (_inPool)
|
|
||||||
{
|
|
||||||
_audioModule.AudioClipPool.TryAdd(handle.GetAssetInfo().Address, handle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_pendingLoad != null)
|
|
||||||
{
|
|
||||||
if (!_inPool && handle != null)
|
|
||||||
{
|
|
||||||
handle.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
_audioAgentRuntimeState = AudioAgentRuntimeState.End;
|
|
||||||
string path = _pendingLoad.Path;
|
|
||||||
bool bAsync = _pendingLoad.BAsync;
|
|
||||||
bool bInPool = _pendingLoad.BInPool;
|
|
||||||
_pendingLoad = null;
|
|
||||||
Load(path, bAsync, bInPool);
|
|
||||||
}
|
|
||||||
else if (handle != null)
|
|
||||||
{
|
|
||||||
if (_audioData != null)
|
|
||||||
{
|
|
||||||
AudioData.DeAlloc(_audioData);
|
|
||||||
_audioData = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
_audioData = AudioData.Alloc(handle, _inPool);
|
|
||||||
|
|
||||||
_source.clip = handle.AssetObject as AudioClip;
|
|
||||||
if (_source.clip != null)
|
|
||||||
{
|
|
||||||
_source.Play();
|
|
||||||
_audioAgentRuntimeState = AudioAgentRuntimeState.Playing;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_audioAgentRuntimeState = AudioAgentRuntimeState.End;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_audioAgentRuntimeState = AudioAgentRuntimeState.End;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 轮询音频代理辅助器。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="elapseSeconds">逻辑流逝时间,以秒为单位。</param>
|
|
||||||
public void Update(float elapseSeconds)
|
|
||||||
{
|
|
||||||
if (_audioAgentRuntimeState == AudioAgentRuntimeState.Playing)
|
|
||||||
{
|
|
||||||
if (!_source.isPlaying)
|
|
||||||
{
|
|
||||||
_audioAgentRuntimeState = AudioAgentRuntimeState.End;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_audioAgentRuntimeState == AudioAgentRuntimeState.FadingOut)
|
|
||||||
{
|
|
||||||
if (_fadeoutTimer > 0f)
|
|
||||||
{
|
|
||||||
_fadeoutTimer -= elapseSeconds;
|
|
||||||
_source.volume = _volume * _fadeoutTimer / FADEOUT_DURATION;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Stop();
|
|
||||||
if (_pendingLoad != null)
|
|
||||||
{
|
|
||||||
string path = _pendingLoad.Path;
|
|
||||||
bool bAsync = _pendingLoad.BAsync;
|
|
||||||
bool bInPool = _pendingLoad.BInPool;
|
|
||||||
_pendingLoad = null;
|
|
||||||
Load(path, bAsync, bInPool);
|
|
||||||
}
|
|
||||||
|
|
||||||
_source.volume = _volume;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_duration += elapseSeconds;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 销毁音频代理辅助器。
|
|
||||||
/// </summary>
|
|
||||||
public void Destroy()
|
|
||||||
{
|
|
||||||
if (_transform != null)
|
|
||||||
{
|
|
||||||
Object.Destroy(_transform.gameObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_audioData != null)
|
|
||||||
{
|
|
||||||
AudioData.DeAlloc(_audioData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 6d4824a14181a0d4d921eb98fec100fe
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
namespace AlicizaX.Audio.Runtime
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 音频代理辅助器运行时状态枚举。
|
|
||||||
/// </summary>
|
|
||||||
public enum AudioAgentRuntimeState
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 无状态。
|
|
||||||
/// </summary>
|
|
||||||
None,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 加载中状态。
|
|
||||||
/// </summary>
|
|
||||||
Loading,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 播放中状态。
|
|
||||||
/// </summary>
|
|
||||||
Playing,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 渐渐消失状态。
|
|
||||||
/// </summary>
|
|
||||||
FadingOut,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 结束状态。
|
|
||||||
/// </summary>
|
|
||||||
End,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: f4ad4b8dc4cf4ecd813e58ec37406ba0
|
|
||||||
timeCreated: 1694849619
|
|
||||||
@ -1,239 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Audio;
|
|
||||||
|
|
||||||
namespace AlicizaX.Audio.Runtime
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 音频轨道(类别)。
|
|
||||||
/// </summary>
|
|
||||||
[Serializable]
|
|
||||||
public class AudioCategory
|
|
||||||
{
|
|
||||||
[SerializeField] private AudioMixer audioMixer = null;
|
|
||||||
|
|
||||||
public List<AudioAgent> AudioAgents;
|
|
||||||
private readonly AudioMixerGroup _audioMixerGroup;
|
|
||||||
private AudioGroupConfig _audioGroupConfig;
|
|
||||||
private int _maxChannel;
|
|
||||||
private bool _bEnable = true;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频混响器。
|
|
||||||
/// </summary>
|
|
||||||
public AudioMixer AudioMixer => audioMixer;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频混响器组。
|
|
||||||
/// </summary>
|
|
||||||
public AudioMixerGroup AudioMixerGroup => _audioMixerGroup;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频组配置。
|
|
||||||
/// </summary>
|
|
||||||
public AudioGroupConfig AudioGroupConfig => _audioGroupConfig;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 实例化根节点。
|
|
||||||
/// </summary>
|
|
||||||
public Transform InstanceRoot { private set; get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频轨道是否启用。
|
|
||||||
/// </summary>
|
|
||||||
public bool Enable
|
|
||||||
{
|
|
||||||
get => _bEnable;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_bEnable != value)
|
|
||||||
{
|
|
||||||
_bEnable = value;
|
|
||||||
if (!_bEnable)
|
|
||||||
{
|
|
||||||
foreach (var audioAgent in AudioAgents)
|
|
||||||
{
|
|
||||||
if (audioAgent != null)
|
|
||||||
{
|
|
||||||
audioAgent.Stop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频轨道构造函数。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="maxChannel">最大Channel。</param>
|
|
||||||
/// <param name="audioMixer">音频混响器。</param>
|
|
||||||
/// <param name="audioGroupConfig">音频轨道组配置。</param>
|
|
||||||
public AudioCategory(int maxChannel, AudioMixer audioMixer, AudioGroupConfig audioGroupConfig)
|
|
||||||
{
|
|
||||||
var audioModule = ModuleSystem.GetModule<IAudioModule>();
|
|
||||||
|
|
||||||
this.audioMixer = audioMixer;
|
|
||||||
_maxChannel = maxChannel;
|
|
||||||
_audioGroupConfig = audioGroupConfig;
|
|
||||||
AudioMixerGroup[] audioMixerGroups = audioMixer.FindMatchingGroups(Utility.Text.Format("Master/{0}", audioGroupConfig.AudioType.ToString()));
|
|
||||||
if (audioMixerGroups.Length > 0)
|
|
||||||
{
|
|
||||||
_audioMixerGroup = audioMixerGroups[0];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_audioMixerGroup = audioMixer.FindMatchingGroups("Master")[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
AudioAgents = new List<AudioAgent>(32);
|
|
||||||
InstanceRoot = new GameObject(Utility.Text.Format("Audio Category - {0}", _audioMixerGroup.name)).transform;
|
|
||||||
InstanceRoot.SetParent(audioModule.InstanceRoot);
|
|
||||||
for (int index = 0; index < _maxChannel; index++)
|
|
||||||
{
|
|
||||||
AudioAgent audioAgent = new AudioAgent();
|
|
||||||
audioAgent.Init(this, index);
|
|
||||||
AudioAgents.Add(audioAgent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 增加音频。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="num"></param>
|
|
||||||
public void AddAudio(int num)
|
|
||||||
{
|
|
||||||
_maxChannel += num;
|
|
||||||
for (int i = 0; i < num; i++)
|
|
||||||
{
|
|
||||||
AudioAgents.Add(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public AudioAgent Play(AudioClip clip)
|
|
||||||
{
|
|
||||||
if (!_bEnable)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
int freeChannel = -1;
|
|
||||||
float duration = -1;
|
|
||||||
|
|
||||||
for (int i = 0; i < AudioAgents.Count; i++)
|
|
||||||
{
|
|
||||||
if (AudioAgents[i].IsFree)
|
|
||||||
{
|
|
||||||
freeChannel = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (AudioAgents[i].Duration > duration)
|
|
||||||
{
|
|
||||||
duration = AudioAgents[i].Duration;
|
|
||||||
freeChannel = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (freeChannel >= 0)
|
|
||||||
{
|
|
||||||
if (AudioAgents[freeChannel] == null)
|
|
||||||
{
|
|
||||||
AudioAgents[freeChannel] = AudioAgent.Create(clip, this);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
AudioAgents[freeChannel].SetAudioClip(clip);
|
|
||||||
}
|
|
||||||
|
|
||||||
return AudioAgents[freeChannel];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Log.Error($"Here is no channel to play audio clip");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 播放音频。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path"></param>
|
|
||||||
/// <param name="bAsync"></param>
|
|
||||||
/// <param name="bInPool"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public AudioAgent Play(string path, bool bAsync, bool bInPool = false)
|
|
||||||
{
|
|
||||||
if (!_bEnable)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
int freeChannel = -1;
|
|
||||||
float duration = -1;
|
|
||||||
|
|
||||||
for (int i = 0; i < AudioAgents.Count; i++)
|
|
||||||
{
|
|
||||||
if (AudioAgents[i].AudioData?.AssetHandle == null || AudioAgents[i].IsFree)
|
|
||||||
{
|
|
||||||
freeChannel = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (AudioAgents[i].Duration > duration)
|
|
||||||
{
|
|
||||||
duration = AudioAgents[i].Duration;
|
|
||||||
freeChannel = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (freeChannel >= 0)
|
|
||||||
{
|
|
||||||
if (AudioAgents[freeChannel] == null)
|
|
||||||
{
|
|
||||||
AudioAgents[freeChannel] = AudioAgent.Create(path, bAsync, this, bInPool);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
AudioAgents[freeChannel].Load(path, bAsync, bInPool);
|
|
||||||
}
|
|
||||||
|
|
||||||
return AudioAgents[freeChannel];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Log.Error($"Here is no channel to play audio {path}");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 暂停音频。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fadeout">是否渐出</param>
|
|
||||||
public void Stop(bool fadeout)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < AudioAgents.Count; ++i)
|
|
||||||
{
|
|
||||||
if (AudioAgents[i] != null)
|
|
||||||
{
|
|
||||||
AudioAgents[i].Stop(fadeout);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频轨道轮询。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="elapseSeconds">逻辑流逝时间,以秒为单位。</param>
|
|
||||||
public void Update(float elapseSeconds)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < AudioAgents.Count; ++i)
|
|
||||||
{
|
|
||||||
if (AudioAgents[i] != null)
|
|
||||||
{
|
|
||||||
AudioAgents[i].Update(elapseSeconds);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 6aefbd5a06fe1784590d373a93d1cf8a
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
using AlicizaX;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Audio;
|
|
||||||
|
|
||||||
namespace AlicizaX.Audio.Runtime
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 音效管理,为游戏提供统一的音效播放接口。
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>场景3D音效挂到场景物件、技能3D音效挂到技能特效上,并在AudioSource的Output上设置对应分类的AudioMixerGroup</remarks>
|
|
||||||
[DisallowMultipleComponent]
|
|
||||||
[AddComponentMenu("Game Framework/Audio")]
|
|
||||||
public sealed class AudioComponent : MonoBehaviour
|
|
||||||
{
|
|
||||||
[SerializeField] private AudioMixer m_AudioMixer;
|
|
||||||
|
|
||||||
[SerializeField] private Transform m_InstanceRoot = null;
|
|
||||||
|
|
||||||
[SerializeField] private AudioGroupConfig[] m_AudioGroupConfigs = null;
|
|
||||||
|
|
||||||
private IAudioModule _audioModule;
|
|
||||||
|
|
||||||
private void Awake()
|
|
||||||
{
|
|
||||||
_audioModule = ModuleSystem.RegisterModule<IAudioModule,AudioModule>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 初始化音频模块。
|
|
||||||
/// </summary>
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
if (m_InstanceRoot == null)
|
|
||||||
{
|
|
||||||
m_InstanceRoot = new GameObject("[AudioModule Instances]").transform;
|
|
||||||
m_InstanceRoot.SetParent(gameObject.transform);
|
|
||||||
m_InstanceRoot.localScale = Vector3.one;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_AudioMixer == null)
|
|
||||||
{
|
|
||||||
m_AudioMixer = Resources.Load<AudioMixer>("AudioMixer");
|
|
||||||
}
|
|
||||||
|
|
||||||
_audioModule.Initialize(m_AudioGroupConfigs, m_InstanceRoot, m_AudioMixer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 7d0b3cff83fd3874394b1b456bb54dab
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
using AlicizaX;
|
|
||||||
using YooAsset;
|
|
||||||
|
|
||||||
namespace AlicizaX.Audio.Runtime
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 音频数据。
|
|
||||||
/// </summary>
|
|
||||||
public class AudioData : MemoryObject
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 资源句柄。
|
|
||||||
/// </summary>
|
|
||||||
public AssetHandle AssetHandle { private set; get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否使用对象池。
|
|
||||||
/// </summary>
|
|
||||||
public bool InPool { private set; get; } = false;
|
|
||||||
|
|
||||||
public override void InitFromPool()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 回收到对象池。
|
|
||||||
/// </summary>
|
|
||||||
public override void RecycleToPool()
|
|
||||||
{
|
|
||||||
if (!InPool)
|
|
||||||
{
|
|
||||||
AssetHandle.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
InPool = false;
|
|
||||||
AssetHandle = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 生成音频数据。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="assetHandle">资源操作句柄。</param>
|
|
||||||
/// <param name="inPool">是否使用对象池。</param>
|
|
||||||
/// <returns>音频数据。</returns>
|
|
||||||
internal static AudioData Alloc(AssetHandle assetHandle, bool inPool)
|
|
||||||
{
|
|
||||||
AudioData ret = MemoryPool.Acquire<AudioData>();
|
|
||||||
ret.AssetHandle = assetHandle;
|
|
||||||
ret.InPool = inPool;
|
|
||||||
ret.InitFromPool();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 回收音频数据。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="audioData"></param>
|
|
||||||
internal static void DeAlloc(AudioData audioData)
|
|
||||||
{
|
|
||||||
if (audioData != null)
|
|
||||||
{
|
|
||||||
MemoryPool.Release(audioData);
|
|
||||||
audioData.RecycleToPool();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 036a1af4acb84666b73909ba28455cfa
|
|
||||||
timeCreated: 1742472335
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
using System;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace AlicizaX.Audio.Runtime
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 音频轨道组配置。
|
|
||||||
/// </summary>
|
|
||||||
[Serializable]
|
|
||||||
public sealed class AudioGroupConfig
|
|
||||||
{
|
|
||||||
[SerializeField] private string m_Name = null;
|
|
||||||
|
|
||||||
[SerializeField] private bool m_Mute = false;
|
|
||||||
|
|
||||||
[SerializeField, Range(0f, 1f)] private float m_Volume = 1f;
|
|
||||||
|
|
||||||
[SerializeField] private int m_AgentHelperCount = 1;
|
|
||||||
|
|
||||||
public AudioType AudioType;
|
|
||||||
|
|
||||||
public AudioRolloffMode audioRolloffMode = AudioRolloffMode.Logarithmic;
|
|
||||||
|
|
||||||
public float minDistance = 1f;
|
|
||||||
|
|
||||||
public float maxDistance = 500f;
|
|
||||||
|
|
||||||
public string Name
|
|
||||||
{
|
|
||||||
get { return m_Name; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Mute
|
|
||||||
{
|
|
||||||
get { return m_Mute; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public float Volume
|
|
||||||
{
|
|
||||||
get { return m_Volume; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int AgentHelperCount
|
|
||||||
{
|
|
||||||
get { return m_AgentHelperCount; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 067935df275fd1340a935f81e7f3a768
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,593 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using AlicizaX.Resource.Runtime;
|
|
||||||
using AlicizaX;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Audio;
|
|
||||||
using YooAsset;
|
|
||||||
using AudioType = AlicizaX.Audio.Runtime.AudioType;
|
|
||||||
|
|
||||||
|
|
||||||
namespace AlicizaX.Audio.Runtime
|
|
||||||
{
|
|
||||||
internal class AudioModule : IAudioModule
|
|
||||||
{
|
|
||||||
public const string MUSIC_VOLUME_NAME = "MusicVolume";
|
|
||||||
public const string UI_SOUND_VOLUME_NAME = "UISoundVolume";
|
|
||||||
public const string VOICE_VOLUME_NAME = "VoiceVolume";
|
|
||||||
|
|
||||||
private AudioMixer _audioMixer;
|
|
||||||
private Transform _instanceRoot = null;
|
|
||||||
private AudioGroupConfig[] _audioGroupConfigs = null;
|
|
||||||
|
|
||||||
private float _volume = 1f;
|
|
||||||
private bool _enable = true;
|
|
||||||
private readonly AudioCategory[] _audioCategories = new AudioCategory[(int)AudioType.Max];
|
|
||||||
private readonly float[] _categoriesVolume = new float[(int)AudioType.Max];
|
|
||||||
private bool _bUnityAudioDisabled = false;
|
|
||||||
|
|
||||||
#region Public Propreties
|
|
||||||
|
|
||||||
public Dictionary<string, AssetHandle> AudioClipPool { get; set; } = new Dictionary<string, AssetHandle>();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频混响器。
|
|
||||||
/// </summary>
|
|
||||||
public AudioMixer AudioMixer => _audioMixer;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 实例化根节点。
|
|
||||||
/// </summary>
|
|
||||||
public Transform InstanceRoot => _instanceRoot;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 总音量控制。
|
|
||||||
/// </summary>
|
|
||||||
public float Volume
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _volume;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_volume = value;
|
|
||||||
AudioListener.volume = _volume;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 总开关。
|
|
||||||
/// </summary>
|
|
||||||
public bool Enable
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _enable;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_enable = value;
|
|
||||||
AudioListener.volume = _enable ? _volume : 0f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音乐音量。
|
|
||||||
/// </summary>
|
|
||||||
public float MusicVolume
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _categoriesVolume[(int)AudioType.Music];
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
float volume = Mathf.Clamp(value, 0.0001f, 1.0f);
|
|
||||||
_categoriesVolume[(int)AudioType.Music] = volume;
|
|
||||||
_audioMixer.SetFloat(MUSIC_VOLUME_NAME, Mathf.Log10(volume) * 20f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音效音量。
|
|
||||||
/// </summary>
|
|
||||||
public float SoundVolume
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _categoriesVolume[(int)AudioType.Sound];
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
float volume = Mathf.Clamp(value, 0.0001f, 1.0f);
|
|
||||||
_categoriesVolume[(int)AudioType.Sound] = volume;
|
|
||||||
_audioMixer.SetFloat("SoundVolume", Mathf.Log10(volume) * 20f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// UI音效音量。
|
|
||||||
/// </summary>
|
|
||||||
public float UISoundVolume
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _categoriesVolume[(int)AudioType.UISound];
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
float volume = Mathf.Clamp(value, 0.0001f, 1.0f);
|
|
||||||
_categoriesVolume[(int)AudioType.UISound] = volume;
|
|
||||||
_audioMixer.SetFloat(UI_SOUND_VOLUME_NAME, Mathf.Log10(volume) * 20f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 语音音量。
|
|
||||||
/// </summary>
|
|
||||||
public float VoiceVolume
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _categoriesVolume[(int)AudioType.Voice];
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
float volume = Mathf.Clamp(value, 0.0001f, 1.0f);
|
|
||||||
_categoriesVolume[(int)AudioType.Voice] = volume;
|
|
||||||
_audioMixer.SetFloat(VOICE_VOLUME_NAME, Mathf.Log10(volume) * 20f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音乐开关
|
|
||||||
/// </summary>
|
|
||||||
public bool MusicEnable
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_audioMixer.GetFloat(MUSIC_VOLUME_NAME, out var db))
|
|
||||||
{
|
|
||||||
return db > -80f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_audioCategories[(int)AudioType.Music].Enable = value;
|
|
||||||
|
|
||||||
// 音乐采用0音量方式,避免恢复播放时的复杂逻辑
|
|
||||||
if (value)
|
|
||||||
{
|
|
||||||
_audioMixer.SetFloat(MUSIC_VOLUME_NAME, Mathf.Log10(_categoriesVolume[(int)AudioType.Music]) * 20f);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_audioMixer.SetFloat(MUSIC_VOLUME_NAME, -80f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音效开关。
|
|
||||||
/// </summary>
|
|
||||||
public bool SoundEnable
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _audioCategories[(int)AudioType.Sound].Enable;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_audioCategories[(int)AudioType.Sound].Enable = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// UI音效开关。
|
|
||||||
/// </summary>
|
|
||||||
public bool UISoundEnable
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _audioCategories[(int)AudioType.UISound].Enable;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_audioCategories[(int)AudioType.UISound].Enable = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 语音开关。
|
|
||||||
/// </summary>
|
|
||||||
public bool VoiceEnable
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _audioCategories[(int)AudioType.Voice].Enable;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_audioCategories[(int)AudioType.Voice].Enable = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private IResourceModule _resourceModule;
|
|
||||||
|
|
||||||
|
|
||||||
void IModule.Dispose()
|
|
||||||
{
|
|
||||||
StopAll(fadeout: false);
|
|
||||||
CleanSoundPool();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 初始化音频模块。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="audioGroupConfigs">音频轨道组配置。</param>
|
|
||||||
/// <param name="instanceRoot">实例化根节点。</param>
|
|
||||||
/// <param name="audioMixer">音频混响器。</param>
|
|
||||||
/// <exception cref="GameFrameworkException"></exception>
|
|
||||||
public void Initialize(AudioGroupConfig[] audioGroupConfigs, Transform instanceRoot = null, AudioMixer audioMixer = null)
|
|
||||||
{
|
|
||||||
_resourceModule = ModuleSystem.GetModule<IResourceModule>();
|
|
||||||
if (_instanceRoot == null)
|
|
||||||
{
|
|
||||||
_instanceRoot = instanceRoot;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (audioGroupConfigs == null)
|
|
||||||
{
|
|
||||||
throw new GameFrameworkException("AudioGroupConfig[] is invalid.");
|
|
||||||
}
|
|
||||||
|
|
||||||
_audioGroupConfigs = audioGroupConfigs;
|
|
||||||
|
|
||||||
if (_instanceRoot == null)
|
|
||||||
{
|
|
||||||
_instanceRoot = new GameObject("[AudioModule Instances]").transform;
|
|
||||||
_instanceRoot.localScale = Vector3.one;
|
|
||||||
UnityEngine.Object.DontDestroyOnLoad(_instanceRoot);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
|
||||||
try
|
|
||||||
{
|
|
||||||
TypeInfo typeInfo = typeof(AudioSettings).GetTypeInfo();
|
|
||||||
PropertyInfo propertyInfo = typeInfo.GetDeclaredProperty("unityAudioDisabled");
|
|
||||||
_bUnityAudioDisabled = (bool)propertyInfo.GetValue(null);
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.Error(e.ToString());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (audioMixer != null)
|
|
||||||
{
|
|
||||||
_audioMixer = audioMixer;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_audioMixer == null)
|
|
||||||
{
|
|
||||||
_audioMixer = Resources.Load<AudioMixer>("AudioMixer");
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int index = 0; index < (int)AudioType.Max; ++index)
|
|
||||||
{
|
|
||||||
AudioType audioType = (AudioType)index;
|
|
||||||
AudioGroupConfig audioGroupConfig = _audioGroupConfigs.First(t => t.AudioType == audioType);
|
|
||||||
_audioCategories[index] = new AudioCategory(audioGroupConfig.AgentHelperCount, _audioMixer, audioGroupConfig);
|
|
||||||
_categoriesVolume[index] = audioGroupConfig.Volume;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 重启音频模块。
|
|
||||||
/// </summary>
|
|
||||||
public void Restart()
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
CleanSoundPool();
|
|
||||||
|
|
||||||
for (int i = 0; i < (int)AudioType.Max; ++i)
|
|
||||||
{
|
|
||||||
var audioCategory = _audioCategories[i];
|
|
||||||
if (audioCategory != null)
|
|
||||||
{
|
|
||||||
for (int j = 0; j < audioCategory.AudioAgents.Count; ++j)
|
|
||||||
{
|
|
||||||
var audioAgent = audioCategory.AudioAgents[j];
|
|
||||||
if (audioAgent != null)
|
|
||||||
{
|
|
||||||
audioAgent.Destroy();
|
|
||||||
audioAgent = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
audioCategory = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Initialize(_audioGroupConfigs);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 播放,如果超过最大发声数采用fadeout的方式复用最久播放的AudioSource。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="type">声音类型</param>
|
|
||||||
/// <param name="path">声音文件路径</param>
|
|
||||||
/// <param name="bLoop">是否循环播放</param>>
|
|
||||||
/// <param name="volume">音量(0-1.0)</param>
|
|
||||||
/// <param name="bAsync">是否异步加载</param>
|
|
||||||
/// <param name="bInPool">是否支持资源池</param>
|
|
||||||
public AudioAgent Play(AudioType type, string path, bool bLoop = false, float volume = 1.0f, bool bAsync = false, bool bInPool = false)
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
AudioAgent audioAgent = _audioCategories[(int)type].Play(path, bAsync, bInPool);
|
|
||||||
{
|
|
||||||
if (audioAgent != null)
|
|
||||||
{
|
|
||||||
audioAgent.IsLoop = bLoop;
|
|
||||||
audioAgent.Volume = volume;
|
|
||||||
}
|
|
||||||
|
|
||||||
return audioAgent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public AudioAgent Play(AudioType type, AudioClip clip, bool bLoop = false, float volume = 1.0f)
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
AudioAgent audioAgent = _audioCategories[(int)type].Play(clip);
|
|
||||||
{
|
|
||||||
if (audioAgent != null)
|
|
||||||
{
|
|
||||||
audioAgent.IsLoop = bLoop;
|
|
||||||
audioAgent.Volume = volume;
|
|
||||||
}
|
|
||||||
|
|
||||||
return audioAgent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 停止某类声音播放。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="type">声音类型。</param>
|
|
||||||
/// <param name="fadeout">是否渐消。</param>
|
|
||||||
public void Stop(AudioType type, bool fadeout)
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_audioCategories[(int)type].Stop(fadeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 停止所有声音。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fadeout">是否渐消。</param>
|
|
||||||
public void StopAll(bool fadeout)
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < (int)AudioType.Max; ++i)
|
|
||||||
{
|
|
||||||
if (_audioCategories[i] != null)
|
|
||||||
{
|
|
||||||
_audioCategories[i].Stop(fadeout);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 预先加载AudioClip,并放入对象池。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="list">AudioClip的AssetPath集合。</param>
|
|
||||||
public void PutInAudioPool(List<string> list)
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (string path in list)
|
|
||||||
{
|
|
||||||
if (AudioClipPool != null && !AudioClipPool.ContainsKey(path))
|
|
||||||
{
|
|
||||||
AssetHandle assetData = _resourceModule.LoadAssetAsyncHandle<AudioClip>(path);
|
|
||||||
assetData.Completed += handle => { AudioClipPool?.Add(path, handle); };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 将部分AudioClip从对象池移出。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="list">AudioClip的AssetPath集合。</param>
|
|
||||||
public void RemoveClipFromPool(List<string> list)
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (string path in list)
|
|
||||||
{
|
|
||||||
if (AudioClipPool.ContainsKey(path))
|
|
||||||
{
|
|
||||||
AudioClipPool[path].Dispose();
|
|
||||||
AudioClipPool.Remove(path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 清空AudioClip的对象池。
|
|
||||||
/// </summary>
|
|
||||||
public void CleanSoundPool()
|
|
||||||
{
|
|
||||||
if (_bUnityAudioDisabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var dic in AudioClipPool)
|
|
||||||
{
|
|
||||||
dic.Value.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
AudioClipPool.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频模块轮询。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="elapseSeconds">逻辑流逝时间,以秒为单位。</param>
|
|
||||||
/// <param name="realElapseSeconds">真实流逝时间,以秒为单位。</param>
|
|
||||||
void IModuleUpdate.Update(float elapseSeconds, float realElapseSeconds)
|
|
||||||
{
|
|
||||||
foreach (var audioCategory in _audioCategories)
|
|
||||||
{
|
|
||||||
if (audioCategory != null)
|
|
||||||
{
|
|
||||||
audioCategory.Update(elapseSeconds);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public int Priority { get; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: c35bbf6a82844c72b71b9bbe44f44a1e
|
|
||||||
timeCreated: 1694847017
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
namespace AlicizaX.Audio.Runtime
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 音效分类,可分别关闭/开启对应分类音效。
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>命名与AudioMixer中分类名保持一致。</remarks>
|
|
||||||
public enum AudioType
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 声音音效。
|
|
||||||
/// </summary>
|
|
||||||
Sound,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// UI声效。
|
|
||||||
/// </summary>
|
|
||||||
UISound,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 背景音乐音效。
|
|
||||||
/// </summary>
|
|
||||||
Music,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 人声音效。
|
|
||||||
/// </summary>
|
|
||||||
Voice,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 最大。
|
|
||||||
/// </summary>
|
|
||||||
Max
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: b4b86f93180273b4996d4f8c428def09
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,130 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using AlicizaX;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Audio;
|
|
||||||
using YooAsset;
|
|
||||||
|
|
||||||
namespace AlicizaX.Audio.Runtime
|
|
||||||
{
|
|
||||||
public interface IAudioModule:IModule,IModuleUpdate
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 总音量控制。
|
|
||||||
/// </summary>
|
|
||||||
public float Volume { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 总开关。
|
|
||||||
/// </summary>
|
|
||||||
public bool Enable { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音乐音量
|
|
||||||
/// </summary>
|
|
||||||
public float MusicVolume { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音效音量。
|
|
||||||
/// </summary>
|
|
||||||
public float SoundVolume { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// UI音效音量。
|
|
||||||
/// </summary>
|
|
||||||
public float UISoundVolume { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 语音音量。
|
|
||||||
/// </summary>
|
|
||||||
public float VoiceVolume { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音乐开关。
|
|
||||||
/// </summary>
|
|
||||||
public bool MusicEnable { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音效开关。
|
|
||||||
/// </summary>
|
|
||||||
public bool SoundEnable { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// UI音效开关。
|
|
||||||
/// </summary>
|
|
||||||
public bool UISoundEnable { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 语音开关。
|
|
||||||
/// </summary>
|
|
||||||
public bool VoiceEnable { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 音频混响器。
|
|
||||||
/// </summary>
|
|
||||||
public AudioMixer AudioMixer { get;}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 实例化根节点。
|
|
||||||
/// </summary>
|
|
||||||
public Transform InstanceRoot { get;}
|
|
||||||
|
|
||||||
public Dictionary<string, AssetHandle> AudioClipPool { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 初始化音频模块。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="audioGroupConfigs">音频轨道组配置。</param>
|
|
||||||
/// <param name="instanceRoot">实例化根节点。</param>
|
|
||||||
/// <param name="audioMixer">音频混响器。</param>
|
|
||||||
/// <exception cref="GameFrameworkException"></exception>
|
|
||||||
public void Initialize(AudioGroupConfig[] audioGroupConfigs, Transform instanceRoot = null, AudioMixer audioMixer = null);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 重启音频模块。
|
|
||||||
/// </summary>
|
|
||||||
public void Restart();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 播放音频接口。
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>如果超过最大发声数采用fadeout的方式复用最久播放的AudioSource。</remarks>
|
|
||||||
/// <param name="type">声音类型。</param>
|
|
||||||
/// <param name="path">声音文件路径。</param>
|
|
||||||
/// <param name="bLoop">是否循环播放。</param>>
|
|
||||||
/// <param name="volume">音量(0-1.0)。</param>
|
|
||||||
/// <param name="bAsync">是否异步加载。</param>
|
|
||||||
/// <param name="bInPool">是否支持资源池。</param>
|
|
||||||
public AudioAgent Play(AudioType type, string path, bool bLoop = false, float volume = 1.0f, bool bAsync = false, bool bInPool = false);
|
|
||||||
|
|
||||||
public AudioAgent Play(AudioType type,AudioClip clip,bool loop=false,float volume = 1.0f);
|
|
||||||
/// <summary>
|
|
||||||
/// 停止某类声音播放。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="type">声音类型。</param>
|
|
||||||
/// <param name="fadeout">是否渐消。</param>
|
|
||||||
public void Stop(AudioType type, bool fadeout);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 停止所有声音。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fadeout">是否渐消。</param>
|
|
||||||
public void StopAll(bool fadeout);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 预先加载AudioClip,并放入对象池。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="list">AudioClip的AssetPath集合。</param>
|
|
||||||
public void PutInAudioPool(List<string> list);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 将部分AudioClip从对象池移出。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="list">AudioClip的AssetPath集合。</param>
|
|
||||||
public void RemoveClipFromPool(List<string> list);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 清空AudioClip的对象池。
|
|
||||||
/// </summary>
|
|
||||||
public void CleanSoundPool();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: f2a332020228453d8546d5d74aa60f9c
|
|
||||||
timeCreated: 1694847151
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 64a654fc0d761c24e9676a185ea4df8e
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,708 +0,0 @@
|
|||||||
%YAML 1.1
|
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
|
||||||
--- !u!244 &-8255999005317483048
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: 5256fbc85eb3f884eb780f730c8da825
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: 989fcb1cc28d4de4ea6e56c14101e674
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!244 &-8165904320333843496
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: 6b8ac75d99b7e57489701e084ea19b1f
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: b19e64315aff6dc4a81ae36b22fc0492
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!244 &-7861682458482441818
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: dcc48474d251d554e9f6f95668853a39
|
|
||||||
m_EffectName: Receive
|
|
||||||
m_MixLevel: e6248274fab455749bc046d72eace6de
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!243 &-7758028812591520460
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: Sound - 2
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: 039cd795affa7134a8d5f5d43d3b659d
|
|
||||||
m_Children: []
|
|
||||||
m_Volume: 2a8ce0f3383c3f0468a04fa3fc5e317d
|
|
||||||
m_Pitch: b47f0c73299cd9b4fba9896e70683903
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: -3825599753161013374}
|
|
||||||
m_UserColorIndex: 2
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!243 &-6280614258348125054
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: Sound - 1
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: c0d40106c2ffb1a44bd48f50b210ee20
|
|
||||||
m_Children: []
|
|
||||||
m_Volume: f62a8b3fe89df00409532af739ee4e02
|
|
||||||
m_Pitch: 77212647508232a458ac7d48fb55d037
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: -1890011256548497850}
|
|
||||||
m_UserColorIndex: 2
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!244 &-4958177229083455073
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: 104113b95764fe344a5d25469377c800
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: 9ef29befaad178d4386e9d5ac022f964
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!243 &-4372808504093502661
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: Sound - 3
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: 5f20d1b8f9ac1914dac8beae718e7d40
|
|
||||||
m_Children: []
|
|
||||||
m_Volume: e54edf7c1bf7ee44297e65adce5b10b7
|
|
||||||
m_Pitch: 8542b6bfd7b7bfc4d9b961ba97edf0d2
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: 6637688299338053042}
|
|
||||||
m_UserColorIndex: 2
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!243 &-4209890294574411305
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: Music
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: efe8591c00084024187b9df78858c0af
|
|
||||||
m_Children:
|
|
||||||
- {fileID: 1543978434442340687}
|
|
||||||
m_Volume: 6d4c2b8bc0ef38d44b2fbff2b3298ab4
|
|
||||||
m_Pitch: 862389c428a73854ab442dd043008729
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: 246003612463095956}
|
|
||||||
m_UserColorIndex: 1
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!244 &-3825599753161013374
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: d1bbcc7cbe0a53c459c9064925118e41
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: e43bb5de098a2ec49807913fa5fdd2f7
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!243 &-3720557753501792270
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: UISound - 1
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: e012b6d2e0501df43a88eb6beff8ae07
|
|
||||||
m_Children: []
|
|
||||||
m_Volume: 265eaf7c8910ab842a845c7bb5e570c4
|
|
||||||
m_Pitch: bf3ca9b57c9a67b40944a59839b12f62
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: 5734415080786067514}
|
|
||||||
m_UserColorIndex: 3
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!243 &-3395020342500439107
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: Voice
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: 5117f9b5a365ec049a9d5891c563b893
|
|
||||||
m_Children:
|
|
||||||
- {fileID: -1649243360580130678}
|
|
||||||
m_Volume: fe15a1b40c14ea646a13dacb15b6a73b
|
|
||||||
m_Pitch: 3398197a464677a4186e0cecd66bb13c
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: -8165904320333843496}
|
|
||||||
m_UserColorIndex: 6
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!243 &-2659745067392564156
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: Sound - 0
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: 71c50c6b966d1f548a63193919ebfbad
|
|
||||||
m_Children: []
|
|
||||||
m_Volume: 7835f2c4248cb3e43a1a773bab1f8b9d
|
|
||||||
m_Pitch: 30975daa872456b41bc18e0277e301e6
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: -284252157345190109}
|
|
||||||
m_UserColorIndex: 2
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!244 &-1890011256548497850
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: 520975c71ea21c249b3cdf1f22032e57
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: 932e3e893621c5b46bff3c368017e689
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!243 &-1649243360580130678
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: Voice - 0
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: f46651e8ad3c6034b8764fd635dda3fd
|
|
||||||
m_Children: []
|
|
||||||
m_Volume: 0bc64c1c6cebbeb40ba2f724fdcaa257
|
|
||||||
m_Pitch: fff252bdd985513469f8607e016fc594
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: -890847686165078200}
|
|
||||||
m_UserColorIndex: 6
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!244 &-998299258853400712
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: d7d19927abbe5584080506164cb4e644
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: 0b4264524e3eafc49b2daba7fba2ce97
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!244 &-890847686165078200
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: 4b41d8aa7a7944041a8b9428add83eff
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: 73b7a9825978be245a1962a1001b0212
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!244 &-284252157345190109
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: 15668b74147caee41a72f695c3a2de56
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: f71e84fb9a62ff24cad690a0a86cc47e
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!244 &-21257493329335984
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: c9a6f7a9214534644bf2e6d83ff86569
|
|
||||||
m_EffectName: Distortion
|
|
||||||
m_MixLevel: 3f356cddae5dba949a6e8f4d20564d3e
|
|
||||||
m_Parameters:
|
|
||||||
- m_ParameterName: Level
|
|
||||||
m_GUID: 080be1914d960974481df4bebe2a2d77
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!241 &24100000
|
|
||||||
AudioMixerController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: AudioMixer
|
|
||||||
m_OutputGroup: {fileID: 0}
|
|
||||||
m_MasterGroup: {fileID: 24300002}
|
|
||||||
m_Snapshots:
|
|
||||||
- {fileID: 24500006}
|
|
||||||
m_StartSnapshot: {fileID: 24500006}
|
|
||||||
m_SuspendThreshold: -80
|
|
||||||
m_EnableSuspend: 1
|
|
||||||
m_UpdateMode: 0
|
|
||||||
m_ExposedParameters:
|
|
||||||
- guid: 7835f2c4248cb3e43a1a773bab1f8b9d
|
|
||||||
name: SoundVolume0
|
|
||||||
- guid: 41591fd4a32f4034f880ecbc14ee69f1
|
|
||||||
name: MusicVolume0
|
|
||||||
- guid: 6e0d1a5935a802d41b27d9e2fad3ba2f
|
|
||||||
name: UISoundVolume0
|
|
||||||
- guid: 0bc64c1c6cebbeb40ba2f724fdcaa257
|
|
||||||
name: VoiceVolume0
|
|
||||||
- guid: f62a8b3fe89df00409532af739ee4e02
|
|
||||||
name: SoundVolume1
|
|
||||||
- guid: 265eaf7c8910ab842a845c7bb5e570c4
|
|
||||||
name: UISoundVolume1
|
|
||||||
- guid: 2a8ce0f3383c3f0468a04fa3fc5e317d
|
|
||||||
name: SoundVolume2
|
|
||||||
- guid: e83be6d6c4ae85142a51f584159c4ff6
|
|
||||||
name: UISoundVolume2
|
|
||||||
- guid: e54edf7c1bf7ee44297e65adce5b10b7
|
|
||||||
name: SoundVolume3
|
|
||||||
- guid: 2dd26f9dadf160f4bbd77f307c3f4f2e
|
|
||||||
name: UISoundVolume3
|
|
||||||
- guid: ba83e724007d7e9459f157db3a54a741
|
|
||||||
name: MasterVolume
|
|
||||||
- guid: 6d4c2b8bc0ef38d44b2fbff2b3298ab4
|
|
||||||
name: MusicVolume
|
|
||||||
- guid: 3bbd22597ed32714eb271cf06b098c63
|
|
||||||
name: SoundVolume
|
|
||||||
- guid: 7d1c7ed015f5dba4f934c33ef330c5eb
|
|
||||||
name: UISoundVolume
|
|
||||||
- guid: fe15a1b40c14ea646a13dacb15b6a73b
|
|
||||||
name: VoiceVolume
|
|
||||||
m_AudioMixerGroupViews:
|
|
||||||
- guids:
|
|
||||||
- 72c1e77b100e3274fbfb88ca2ca12c4d
|
|
||||||
- efe8591c00084024187b9df78858c0af
|
|
||||||
- 648e49a020cf83346a9220d606e4ff39
|
|
||||||
- 5117f9b5a365ec049a9d5891c563b893
|
|
||||||
- f46651e8ad3c6034b8764fd635dda3fd
|
|
||||||
- 1cf576bd46399874d9494863d6502d94
|
|
||||||
- 71c50c6b966d1f548a63193919ebfbad
|
|
||||||
- df986418fa3e4ae448a1909ffbb633fb
|
|
||||||
- 29257697b1e6be546aa0558e342a15a6
|
|
||||||
- c0d40106c2ffb1a44bd48f50b210ee20
|
|
||||||
- 039cd795affa7134a8d5f5d43d3b659d
|
|
||||||
- 5f20d1b8f9ac1914dac8beae718e7d40
|
|
||||||
- e012b6d2e0501df43a88eb6beff8ae07
|
|
||||||
- e84c25a476798ea43a2f6de217af7dba
|
|
||||||
- 98657376d4096a947953ee04d82830c1
|
|
||||||
name: View
|
|
||||||
m_CurrentViewIndex: 0
|
|
||||||
m_TargetSnapshot: {fileID: 24500006}
|
|
||||||
--- !u!243 &24300002
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: Master
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: 72c1e77b100e3274fbfb88ca2ca12c4d
|
|
||||||
m_Children:
|
|
||||||
- {fileID: -4209890294574411305}
|
|
||||||
- {fileID: 7235523536312936115}
|
|
||||||
- {fileID: 7185772616558441635}
|
|
||||||
- {fileID: -3395020342500439107}
|
|
||||||
m_Volume: ba83e724007d7e9459f157db3a54a741
|
|
||||||
m_Pitch: a2d2b77391464bb4887f0bcd3835015b
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: 24400004}
|
|
||||||
m_UserColorIndex: 8
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!244 &24400004
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: ce944d90cb57ee4418426132d391d900
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: 891c3ec10e0ae1b42a95c83727d411f1
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!245 &24500006
|
|
||||||
AudioMixerSnapshotController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: Snapshot
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_SnapshotID: 91dee90f8902c804c9da7728ea355157
|
|
||||||
m_FloatValues:
|
|
||||||
b47f0c73299cd9b4fba9896e70683903: 1
|
|
||||||
ba83e724007d7e9459f157db3a54a741: 0
|
|
||||||
fe15a1b40c14ea646a13dacb15b6a73b: 0
|
|
||||||
77212647508232a458ac7d48fb55d037: 1
|
|
||||||
3bbd22597ed32714eb271cf06b098c63: 0
|
|
||||||
30975daa872456b41bc18e0277e301e6: 1
|
|
||||||
6d4c2b8bc0ef38d44b2fbff2b3298ab4: -0.03
|
|
||||||
8542b6bfd7b7bfc4d9b961ba97edf0d2: 1
|
|
||||||
m_TransitionOverrides: {}
|
|
||||||
--- !u!244 &246003612463095956
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: 860c45ba06e3cbd4794061eaefe970a3
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: bb4c221c9e3208941b1a2107831692ab
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!244 &281287199725387719
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: 812fbfe4555eb1641aeaeee69a13b4a6
|
|
||||||
m_EffectName: Lowpass Simple
|
|
||||||
m_MixLevel: 391139084347578409e42387008bd110
|
|
||||||
m_Parameters:
|
|
||||||
- m_ParameterName: Cutoff freq
|
|
||||||
m_GUID: b19756871f24b194d87c7d1fce3159e9
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!244 &1413273517213151576
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: ce0c93d89826c7349a19b232116484db
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: 7625365898787684c9bce9298a96f044
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!243 &1543978434442340687
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: Music - 0
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: 1cf576bd46399874d9494863d6502d94
|
|
||||||
m_Children: []
|
|
||||||
m_Volume: 41591fd4a32f4034f880ecbc14ee69f1
|
|
||||||
m_Pitch: 9ad7e859a0cd1f142b59ffc659be28a7
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: -8255999005317483048}
|
|
||||||
m_UserColorIndex: 1
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!243 &1601410790413250045
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: UISound - 3
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: 98657376d4096a947953ee04d82830c1
|
|
||||||
m_Children: []
|
|
||||||
m_Volume: 2dd26f9dadf160f4bbd77f307c3f4f2e
|
|
||||||
m_Pitch: 5627fa8b0176a344bbb4e59ac5e648d3
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: 1413273517213151576}
|
|
||||||
m_UserColorIndex: 3
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!244 &2567082640316932351
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: a7394d86e1e2a1e4389182f0aec98773
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: cb8b6dfd682072d4fb81143ba077bc3f
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!243 &3865010338301366421
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: UISound - 2
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: e84c25a476798ea43a2f6de217af7dba
|
|
||||||
m_Children: []
|
|
||||||
m_Volume: e83be6d6c4ae85142a51f584159c4ff6
|
|
||||||
m_Pitch: c45439925e1cfd547894fd886160a11c
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: 7834155774142160187}
|
|
||||||
m_UserColorIndex: 3
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!244 &5734415080786067514
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: 20eac414948135e49b2b54a89235f15e
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: d087be8c429707c4db724a61186f67f6
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!244 &5954042604037024145
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: ba434c984ec3c4442bfe3a399c11572b
|
|
||||||
m_EffectName: Echo
|
|
||||||
m_MixLevel: 0323002ce01f29a4abebc242337ea816
|
|
||||||
m_Parameters:
|
|
||||||
- m_ParameterName: Delay
|
|
||||||
m_GUID: f4cc548867353f843bc36a61722c6cbf
|
|
||||||
- m_ParameterName: Decay
|
|
||||||
m_GUID: e67c7b4426842f948a83f3dada794a99
|
|
||||||
- m_ParameterName: Max channels
|
|
||||||
m_GUID: 75c7951a8373f4644a44979a8c5776ed
|
|
||||||
- m_ParameterName: Drymix
|
|
||||||
m_GUID: 4d26b3b7a84b31d499176a7879734ba1
|
|
||||||
- m_ParameterName: Wetmix
|
|
||||||
m_GUID: 6efaeec45de20b045a4d560994684cba
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!244 &6255340296135181231
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: 3a251f2e65751b349bb255f73f0caeaf
|
|
||||||
m_EffectName: Duck Volume
|
|
||||||
m_MixLevel: 58cfdd03ab24c874cbe074238d636208
|
|
||||||
m_Parameters:
|
|
||||||
- m_ParameterName: Threshold
|
|
||||||
m_GUID: b1b5c57689fc533408e6195c0a9e26a9
|
|
||||||
- m_ParameterName: Ratio
|
|
||||||
m_GUID: dc9c2c635bce58746bd68c7dffb99ca0
|
|
||||||
- m_ParameterName: Attack Time
|
|
||||||
m_GUID: 078ff252301e4594c880cd5754b8a563
|
|
||||||
- m_ParameterName: Release Time
|
|
||||||
m_GUID: b3918efd0a966ea4882714c0f9edd40b
|
|
||||||
- m_ParameterName: Make-up Gain
|
|
||||||
m_GUID: 3cf881ca64b7cdb46b35d3593ff2cbe9
|
|
||||||
- m_ParameterName: Knee
|
|
||||||
m_GUID: 31ea47a78d927ab4abf12f854bd4c626
|
|
||||||
- m_ParameterName: Sidechain Mix
|
|
||||||
m_GUID: 468d86503d3572541a33c33bb9693dfd
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!244 &6554641470784401750
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: 4499c94d696ee5741a71370ed7431e12
|
|
||||||
m_EffectName: Send
|
|
||||||
m_MixLevel: f01b57f2509f26f4b8f2772993c2b8c6
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!244 &6637688299338053042
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: e84926aaeedf4074698e7d7f7f36b78b
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: 8141a348079ee934686d3569f4758582
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
--- !u!243 &7040861873718444651
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: UISound - 0
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: 29257697b1e6be546aa0558e342a15a6
|
|
||||||
m_Children: []
|
|
||||||
m_Volume: 6e0d1a5935a802d41b27d9e2fad3ba2f
|
|
||||||
m_Pitch: 7d01f3677fe8c5b41a877b64cc509766
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: -4958177229083455073}
|
|
||||||
m_UserColorIndex: 3
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!243 &7185772616558441635
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: UISound
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: df986418fa3e4ae448a1909ffbb633fb
|
|
||||||
m_Children:
|
|
||||||
- {fileID: 7040861873718444651}
|
|
||||||
- {fileID: -3720557753501792270}
|
|
||||||
- {fileID: 3865010338301366421}
|
|
||||||
- {fileID: 1601410790413250045}
|
|
||||||
m_Volume: 7d1c7ed015f5dba4f934c33ef330c5eb
|
|
||||||
m_Pitch: 611d9d89c8a65b548b591e852596c35d
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: -998299258853400712}
|
|
||||||
m_UserColorIndex: 3
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!243 &7235523536312936115
|
|
||||||
AudioMixerGroupController:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: Sound
|
|
||||||
m_AudioMixer: {fileID: 24100000}
|
|
||||||
m_GroupID: 648e49a020cf83346a9220d606e4ff39
|
|
||||||
m_Children:
|
|
||||||
- {fileID: -2659745067392564156}
|
|
||||||
- {fileID: -6280614258348125054}
|
|
||||||
- {fileID: -7758028812591520460}
|
|
||||||
- {fileID: -4372808504093502661}
|
|
||||||
m_Volume: 3bbd22597ed32714eb271cf06b098c63
|
|
||||||
m_Pitch: 7f8a6510dd472ff4db8b07c5079a2013
|
|
||||||
m_Send: 00000000000000000000000000000000
|
|
||||||
m_Effects:
|
|
||||||
- {fileID: 2567082640316932351}
|
|
||||||
m_UserColorIndex: 2
|
|
||||||
m_Mute: 0
|
|
||||||
m_Solo: 0
|
|
||||||
m_BypassEffects: 0
|
|
||||||
--- !u!244 &7834155774142160187
|
|
||||||
AudioMixerEffectController:
|
|
||||||
m_ObjectHideFlags: 3
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EffectID: 09e809d6183106b4a804ff08ca8ff9ed
|
|
||||||
m_EffectName: Attenuation
|
|
||||||
m_MixLevel: 92339d91519b09543844a84cea03aed3
|
|
||||||
m_Parameters: []
|
|
||||||
m_SendTarget: {fileID: 0}
|
|
||||||
m_EnableWetMix: 0
|
|
||||||
m_Bypass: 0
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 1af7a1b121ae17541a1967d430cef006
|
|
||||||
NativeFormatImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
mainObjectFileID: 0
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
<linker>
|
|
||||||
<assembly fullname="AlicizaX.Audio.Runtime" preserve="all" />
|
|
||||||
</linker>
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 5a0977a29f89cd44e9833842d07fb4a3
|
|
||||||
timeCreated: 1737098208
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "com.alicizax.unity.audio",
|
|
||||||
"displayName": "Aliciza X Audio",
|
|
||||||
"category": "Aliciza X",
|
|
||||||
"description": "Aliciza X Audio Component",
|
|
||||||
"version": "1.0.1",
|
|
||||||
"unity": "2025.1",
|
|
||||||
"keywords": [
|
|
||||||
"Game Framework X"
|
|
||||||
],
|
|
||||||
"repository": {
|
|
||||||
"name": "com.alicizax.unity",
|
|
||||||
"url": "http://101.34.252.46:3000/AlicizaX/",
|
|
||||||
"type": "git"
|
|
||||||
},
|
|
||||||
"author": {
|
|
||||||
"name": "Yuliuren",
|
|
||||||
"email": "yuliuren00@gmail.com"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: bfcfd53ea0ab058419a338767c7c06bb
|
|
||||||
PackageManifestImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 315dbc398e044d14980f37756acbd186
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "AlicizaX.Debugger.Editor",
|
|
||||||
"rootNamespace": "AlicizaX.Debugger.Editor",
|
|
||||||
"references": [
|
|
||||||
"GUID:0d00816689626d846bd06cd779413413",
|
|
||||||
"GUID:acfef7cabed3b0a42b25edb1cd4fa259",
|
|
||||||
"GUID:75b6f2078d190f14dbda4a5b747d709c"
|
|
||||||
],
|
|
||||||
"includePlatforms": [
|
|
||||||
"Editor"
|
|
||||||
],
|
|
||||||
"excludePlatforms": [],
|
|
||||||
"allowUnsafeCode": true,
|
|
||||||
"overrideReferences": false,
|
|
||||||
"precompiledReferences": [],
|
|
||||||
"autoReferenced": true,
|
|
||||||
"defineConstraints": [],
|
|
||||||
"versionDefines": [],
|
|
||||||
"noEngineReferences": false
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 482599f49a43e5d41ab5b428028e5651
|
|
||||||
AssemblyDefinitionImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: e98e73807718166469aac777a004bd7e
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
using System;
|
|
||||||
using AlicizaX.Editor;
|
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
|
||||||
using AlicizaX.Debugger.Runtime;
|
|
||||||
|
|
||||||
namespace AlicizaX.Debugger.Editor
|
|
||||||
{
|
|
||||||
[CustomEditor(typeof(DebuggerComponent))]
|
|
||||||
internal sealed class DebuggerComponentInspector : GameFrameworkInspector
|
|
||||||
{
|
|
||||||
private SerializedProperty m_Skin = null;
|
|
||||||
private SerializedProperty m_ActiveWindow = null;
|
|
||||||
private SerializedProperty m_ShowFullWindow = null;
|
|
||||||
private SerializedProperty m_ConsoleWindow = null;
|
|
||||||
|
|
||||||
public override void OnInspectorGUI()
|
|
||||||
{
|
|
||||||
base.OnInspectorGUI();
|
|
||||||
|
|
||||||
serializedObject.Update();
|
|
||||||
|
|
||||||
DebuggerComponent t = (DebuggerComponent)target;
|
|
||||||
|
|
||||||
EditorGUILayout.PropertyField(m_Skin);
|
|
||||||
|
|
||||||
if (EditorApplication.isPlaying && IsPrefabInHierarchy(t.gameObject))
|
|
||||||
{
|
|
||||||
bool activeWindow = EditorGUILayout.Toggle("Active Window", t.ActiveWindow);
|
|
||||||
if (activeWindow != t.ActiveWindow)
|
|
||||||
{
|
|
||||||
t.ActiveWindow = activeWindow;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
EditorGUILayout.PropertyField(m_ActiveWindow);
|
|
||||||
}
|
|
||||||
|
|
||||||
EditorGUILayout.PropertyField(m_ShowFullWindow);
|
|
||||||
|
|
||||||
if (EditorApplication.isPlaying)
|
|
||||||
{
|
|
||||||
if (GUILayout.Button("Reset Layout"))
|
|
||||||
{
|
|
||||||
t.ResetLayout();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EditorGUILayout.PropertyField(m_ConsoleWindow, true);
|
|
||||||
|
|
||||||
serializedObject.ApplyModifiedProperties();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void OnEnable()
|
|
||||||
{
|
|
||||||
m_Skin = serializedObject.FindProperty("m_Skin");
|
|
||||||
m_ActiveWindow = serializedObject.FindProperty("m_ActiveWindow");
|
|
||||||
m_ShowFullWindow = serializedObject.FindProperty("m_ShowFullWindow");
|
|
||||||
m_ConsoleWindow = serializedObject.FindProperty("m_ConsoleWindow");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 346bd5fc6cf0d76478b39f7e69185a23
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: f52e94520a8d8544f84756063cf06d42
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: dce698819fdb70b42b393d9b0b6d420e
|
|
||||||
NativeFormatImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
mainObjectFileID: 0
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,201 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright [2023] [ALianBlank of copyright owner][alianblank@outlook.com][https://alianblank.com/]
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 7d9b46c0f3807624fbb8c8225ae1e544
|
|
||||||
TextScriptImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: d1ca5c9d4643f6d479f66ca16100e559
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "AlicizaX.Debugger.Runtime",
|
|
||||||
"rootNamespace": "AlicizaX.Debugger.Runtime",
|
|
||||||
"references": [
|
|
||||||
"GUID:75b6f2078d190f14dbda4a5b747d709c",
|
|
||||||
"GUID:8b8e344bafed3e54eb291c1d5d2319b8"
|
|
||||||
],
|
|
||||||
"includePlatforms": [],
|
|
||||||
"excludePlatforms": [],
|
|
||||||
"allowUnsafeCode": true,
|
|
||||||
"overrideReferences": false,
|
|
||||||
"precompiledReferences": [],
|
|
||||||
"autoReferenced": true,
|
|
||||||
"defineConstraints": [],
|
|
||||||
"versionDefines": [],
|
|
||||||
"noEngineReferences": false
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 0d00816689626d846bd06cd779413413
|
|
||||||
AssemblyDefinitionImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: c630b51c86a234242a84ff37c9342a82
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
namespace AlicizaX.Debugger.Runtime
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 调试器激活窗口类型。
|
|
||||||
/// </summary>
|
|
||||||
public enum DebuggerActiveWindowType : byte
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 总是打开。
|
|
||||||
/// </summary>
|
|
||||||
AlwaysOpen = 0,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 仅在开发模式时打开。
|
|
||||||
/// </summary>
|
|
||||||
OnlyOpenWhenDevelopment,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 仅在编辑器中打开。
|
|
||||||
/// </summary>
|
|
||||||
OnlyOpenInEditor,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 总是关闭。
|
|
||||||
/// </summary>
|
|
||||||
AlwaysClose,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: d1baccfe5abb590428eb0322088bf4ce
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,420 +0,0 @@
|
|||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
|
|
||||||
namespace AlicizaX.Debugger.Runtime
|
|
||||||
{
|
|
||||||
public sealed partial class DebuggerComponent
|
|
||||||
{
|
|
||||||
[Serializable]
|
|
||||||
private sealed class ConsoleWindow : IDebuggerWindow
|
|
||||||
{
|
|
||||||
private readonly Queue<LogNode> m_LogNodes = new Queue<LogNode>();
|
|
||||||
|
|
||||||
private Vector2 m_LogScrollPosition = Vector2.zero;
|
|
||||||
private Vector2 m_StackScrollPosition = Vector2.zero;
|
|
||||||
private int m_InfoCount = 0;
|
|
||||||
private int m_WarningCount = 0;
|
|
||||||
private int m_ErrorCount = 0;
|
|
||||||
private int m_FatalCount = 0;
|
|
||||||
private LogNode m_SelectedNode = null;
|
|
||||||
private bool m_LastLockScroll = true;
|
|
||||||
private bool m_LastInfoFilter = true;
|
|
||||||
private bool m_LastWarningFilter = true;
|
|
||||||
private bool m_LastErrorFilter = true;
|
|
||||||
private bool m_LastFatalFilter = true;
|
|
||||||
|
|
||||||
[SerializeField] private bool m_LockScroll = true;
|
|
||||||
|
|
||||||
[SerializeField] private int m_MaxLine = 100;
|
|
||||||
|
|
||||||
[SerializeField] private bool m_InfoFilter = true;
|
|
||||||
|
|
||||||
[SerializeField] private bool m_WarningFilter = true;
|
|
||||||
|
|
||||||
[SerializeField] private bool m_ErrorFilter = true;
|
|
||||||
|
|
||||||
[SerializeField] private bool m_FatalFilter = true;
|
|
||||||
|
|
||||||
[SerializeField] private Color32 m_InfoColor = Color.white;
|
|
||||||
|
|
||||||
[SerializeField] private Color32 m_WarningColor = Color.yellow;
|
|
||||||
|
|
||||||
[SerializeField] private Color32 m_ErrorColor = Color.red;
|
|
||||||
|
|
||||||
[SerializeField] private Color32 m_FatalColor = new Color(0.7f, 0.2f, 0.2f);
|
|
||||||
|
|
||||||
public bool LockScroll
|
|
||||||
{
|
|
||||||
get { return m_LockScroll; }
|
|
||||||
set { m_LockScroll = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int MaxLine
|
|
||||||
{
|
|
||||||
get { return m_MaxLine; }
|
|
||||||
set { m_MaxLine = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool InfoFilter
|
|
||||||
{
|
|
||||||
get { return m_InfoFilter; }
|
|
||||||
set { m_InfoFilter = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool WarningFilter
|
|
||||||
{
|
|
||||||
get { return m_WarningFilter; }
|
|
||||||
set { m_WarningFilter = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool ErrorFilter
|
|
||||||
{
|
|
||||||
get { return m_ErrorFilter; }
|
|
||||||
set { m_ErrorFilter = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool FatalFilter
|
|
||||||
{
|
|
||||||
get { return m_FatalFilter; }
|
|
||||||
set { m_FatalFilter = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int InfoCount
|
|
||||||
{
|
|
||||||
get { return m_InfoCount; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int WarningCount
|
|
||||||
{
|
|
||||||
get { return m_WarningCount; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int ErrorCount
|
|
||||||
{
|
|
||||||
get { return m_ErrorCount; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int FatalCount
|
|
||||||
{
|
|
||||||
get { return m_FatalCount; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public Color32 InfoColor
|
|
||||||
{
|
|
||||||
get { return m_InfoColor; }
|
|
||||||
set { m_InfoColor = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public Color32 WarningColor
|
|
||||||
{
|
|
||||||
get { return m_WarningColor; }
|
|
||||||
set { m_WarningColor = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public Color32 ErrorColor
|
|
||||||
{
|
|
||||||
get { return m_ErrorColor; }
|
|
||||||
set { m_ErrorColor = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public Color32 FatalColor
|
|
||||||
{
|
|
||||||
get { return m_FatalColor; }
|
|
||||||
set { m_FatalColor = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Initialize(params object[] args)
|
|
||||||
{
|
|
||||||
|
|
||||||
Application.logMessageReceived += OnLogMessageReceived;
|
|
||||||
m_LockScroll = m_LastLockScroll = Utility.PlayerPrefsX.GetBool("Debugger.Console.LockScroll", true);
|
|
||||||
m_InfoFilter = m_LastInfoFilter = Utility.PlayerPrefsX.GetBool("Debugger.Console.InfoFilter", true);
|
|
||||||
m_WarningFilter = m_LastWarningFilter = Utility.PlayerPrefsX.GetBool("Debugger.Console.WarningFilter", true);
|
|
||||||
m_ErrorFilter = m_LastErrorFilter = Utility.PlayerPrefsX.GetBool("Debugger.Console.ErrorFilter", true);
|
|
||||||
m_FatalFilter = m_LastFatalFilter = Utility.PlayerPrefsX.GetBool("Debugger.Console.FatalFilter", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Shutdown()
|
|
||||||
{
|
|
||||||
Application.logMessageReceived -= OnLogMessageReceived;
|
|
||||||
Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnEnter()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnLeave()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnUpdate(float elapseSeconds, float realElapseSeconds)
|
|
||||||
{
|
|
||||||
if (m_LastLockScroll != m_LockScroll)
|
|
||||||
{
|
|
||||||
m_LastLockScroll = m_LockScroll;
|
|
||||||
Utility.PlayerPrefsX.SetBool("Debugger.Console.LockScroll", m_LockScroll);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_LastInfoFilter != m_InfoFilter)
|
|
||||||
{
|
|
||||||
m_LastInfoFilter = m_InfoFilter;
|
|
||||||
Utility.PlayerPrefsX.SetBool("Debugger.Console.InfoFilter", m_InfoFilter);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_LastWarningFilter != m_WarningFilter)
|
|
||||||
{
|
|
||||||
m_LastWarningFilter = m_WarningFilter;
|
|
||||||
Utility.PlayerPrefsX.SetBool("Debugger.Console.WarningFilter", m_WarningFilter);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_LastErrorFilter != m_ErrorFilter)
|
|
||||||
{
|
|
||||||
m_LastErrorFilter = m_ErrorFilter;
|
|
||||||
Utility.PlayerPrefsX.SetBool("Debugger.Console.ErrorFilter", m_ErrorFilter);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_LastFatalFilter != m_FatalFilter)
|
|
||||||
{
|
|
||||||
m_LastFatalFilter = m_FatalFilter;
|
|
||||||
Utility.PlayerPrefsX.SetBool("Debugger.Console.FatalFilter", m_FatalFilter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnDraw()
|
|
||||||
{
|
|
||||||
RefreshCount();
|
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
|
||||||
{
|
|
||||||
if (GUILayout.Button("Clear All", GUILayout.Width(100f)))
|
|
||||||
{
|
|
||||||
Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_LockScroll = GUILayout.Toggle(m_LockScroll, "Lock Scroll", GUILayout.Width(90f));
|
|
||||||
GUILayout.FlexibleSpace();
|
|
||||||
m_InfoFilter = GUILayout.Toggle(m_InfoFilter, Utility.Text.Format("Info ({0})", m_InfoCount), GUILayout.Width(90f));
|
|
||||||
m_WarningFilter = GUILayout.Toggle(m_WarningFilter, Utility.Text.Format("Warning ({0})", m_WarningCount), GUILayout.Width(90f));
|
|
||||||
m_ErrorFilter = GUILayout.Toggle(m_ErrorFilter, Utility.Text.Format("Error ({0})", m_ErrorCount), GUILayout.Width(90f));
|
|
||||||
m_FatalFilter = GUILayout.Toggle(m_FatalFilter, Utility.Text.Format("Fatal ({0})", m_FatalCount), GUILayout.Width(90f));
|
|
||||||
}
|
|
||||||
GUILayout.EndHorizontal();
|
|
||||||
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
{
|
|
||||||
if (m_LockScroll)
|
|
||||||
{
|
|
||||||
m_LogScrollPosition.y = float.MaxValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_LogScrollPosition = GUILayout.BeginScrollView(m_LogScrollPosition);
|
|
||||||
{
|
|
||||||
bool selected = false;
|
|
||||||
foreach (LogNode logNode in m_LogNodes)
|
|
||||||
{
|
|
||||||
switch (logNode.LogType)
|
|
||||||
{
|
|
||||||
case LogType.Log:
|
|
||||||
if (!m_InfoFilter)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LogType.Warning:
|
|
||||||
if (!m_WarningFilter)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LogType.Error:
|
|
||||||
if (!m_ErrorFilter)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LogType.Exception:
|
|
||||||
if (!m_FatalFilter)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GUILayout.Toggle(m_SelectedNode == logNode, GetLogString(logNode)))
|
|
||||||
{
|
|
||||||
selected = true;
|
|
||||||
if (m_SelectedNode != logNode)
|
|
||||||
{
|
|
||||||
m_SelectedNode = logNode;
|
|
||||||
m_StackScrollPosition = Vector2.zero;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!selected)
|
|
||||||
{
|
|
||||||
m_SelectedNode = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GUILayout.EndScrollView();
|
|
||||||
}
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
{
|
|
||||||
m_StackScrollPosition = GUILayout.BeginScrollView(m_StackScrollPosition, GUILayout.Height(100f));
|
|
||||||
{
|
|
||||||
if (m_SelectedNode != null)
|
|
||||||
{
|
|
||||||
Color32 color = GetLogStringColor(m_SelectedNode.LogType);
|
|
||||||
if (GUILayout.Button(Utility.Text.Format("<color=#{0:x2}{1:x2}{2:x2}{3:x2}><b>{4}</b></color>{6}{6}{5}", color.r, color.g, color.b, color.a, m_SelectedNode.LogMessage, m_SelectedNode.StackTrack, Environment.NewLine), "label"))
|
|
||||||
{
|
|
||||||
CopyToClipboard(Utility.Text.Format("{0}{2}{2}{1}", m_SelectedNode.LogMessage, m_SelectedNode.StackTrack, Environment.NewLine));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GUILayout.EndScrollView();
|
|
||||||
}
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Clear()
|
|
||||||
{
|
|
||||||
m_LogNodes.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RefreshCount()
|
|
||||||
{
|
|
||||||
m_InfoCount = 0;
|
|
||||||
m_WarningCount = 0;
|
|
||||||
m_ErrorCount = 0;
|
|
||||||
m_FatalCount = 0;
|
|
||||||
foreach (LogNode logNode in m_LogNodes)
|
|
||||||
{
|
|
||||||
switch (logNode.LogType)
|
|
||||||
{
|
|
||||||
case LogType.Log:
|
|
||||||
m_InfoCount++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LogType.Warning:
|
|
||||||
m_WarningCount++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LogType.Error:
|
|
||||||
m_ErrorCount++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LogType.Exception:
|
|
||||||
m_FatalCount++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void GetRecentLogs(List<LogNode> results)
|
|
||||||
{
|
|
||||||
if (results == null)
|
|
||||||
{
|
|
||||||
Log.Error("Results is invalid.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
results.Clear();
|
|
||||||
foreach (LogNode logNode in m_LogNodes)
|
|
||||||
{
|
|
||||||
results.Add(logNode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void GetRecentLogs(List<LogNode> results, int count)
|
|
||||||
{
|
|
||||||
if (results == null)
|
|
||||||
{
|
|
||||||
Log.Error("Results is invalid.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count <= 0)
|
|
||||||
{
|
|
||||||
Log.Error("Count is invalid.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int position = m_LogNodes.Count - count;
|
|
||||||
if (position < 0)
|
|
||||||
{
|
|
||||||
position = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int index = 0;
|
|
||||||
results.Clear();
|
|
||||||
foreach (LogNode logNode in m_LogNodes)
|
|
||||||
{
|
|
||||||
if (index++ < position)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
results.Add(logNode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnLogMessageReceived(string logMessage, string stackTrace, LogType logType)
|
|
||||||
{
|
|
||||||
if (logType == LogType.Assert)
|
|
||||||
{
|
|
||||||
logType = LogType.Error;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_LogNodes.Enqueue(LogNode.Create(logType, logMessage, stackTrace));
|
|
||||||
while (m_LogNodes.Count > m_MaxLine)
|
|
||||||
{
|
|
||||||
MemoryPool.Release(m_LogNodes.Dequeue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetLogString(LogNode logNode)
|
|
||||||
{
|
|
||||||
Color32 color = GetLogStringColor(logNode.LogType);
|
|
||||||
return Utility.Text.Format("<color=#{0:x2}{1:x2}{2:x2}{3:x2}>[{4:HH:mm:ss.fff}][{5}] {6}</color>", color.r, color.g, color.b, color.a, logNode.LogTime.ToLocalTime(), logNode.LogFrameCount, logNode.LogMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal Color32 GetLogStringColor(LogType logType)
|
|
||||||
{
|
|
||||||
Color32 color = Color.white;
|
|
||||||
switch (logType)
|
|
||||||
{
|
|
||||||
case LogType.Log:
|
|
||||||
color = m_InfoColor;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LogType.Warning:
|
|
||||||
color = m_WarningColor;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LogType.Error:
|
|
||||||
color = m_ErrorColor;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LogType.Exception:
|
|
||||||
color = m_FatalColor;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 4a47e2730f999784eb1bbeefab72ef11
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
using AlicizaX;
|
|
||||||
using UnityEngine;
|
|
||||||
#if UNITY_5_5_OR_NEWER
|
|
||||||
using UnityEngine.Rendering;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace AlicizaX.Debugger.Runtime
|
|
||||||
{
|
|
||||||
public sealed partial class DebuggerComponent
|
|
||||||
{
|
|
||||||
private sealed class EnvironmentInformationWindow : ScrollableDebuggerWindowBase
|
|
||||||
{
|
|
||||||
public override void Initialize(params object[] args)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnDrawScrollableWindow()
|
|
||||||
{
|
|
||||||
GUILayout.Label("<b>Environment Information</b>");
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
{
|
|
||||||
DrawItem("Product Name", Application.productName);
|
|
||||||
DrawItem("Company Name", Application.companyName);
|
|
||||||
#if UNITY_5_6_OR_NEWER
|
|
||||||
DrawItem("Game Identifier", Application.identifier);
|
|
||||||
#else
|
|
||||||
DrawItem("Game Identifier", Application.bundleIdentifier);
|
|
||||||
#endif
|
|
||||||
DrawItem("Game Framework Version", AppVersion.GameFrameworkVersion);
|
|
||||||
DrawItem("Game Version", Utility.Text.Format("{0} ({1})", AppVersion.GameVersion, AppVersion.GameFrameworkVersion));
|
|
||||||
// DrawItem("Resource Version", m_BaseComponent.EditorResourceMode ? "Unavailable in editor resource mode" : (string.IsNullOrEmpty(m_ResourceComponent.ApplicableGameVersion) ? "Unknown" : Utility.Text.Format("{0} ({1})", m_ResourceComponent.ApplicableGameVersion, m_ResourceComponent.InternalResourceVersion)));
|
|
||||||
DrawItem("Application Version", Application.version);
|
|
||||||
DrawItem("Unity Version", Application.unityVersion);
|
|
||||||
DrawItem("Platform", Application.platform.ToString());
|
|
||||||
DrawItem("System Language", Application.systemLanguage.ToString());
|
|
||||||
DrawItem("Cloud Project Id", Application.cloudProjectId);
|
|
||||||
#if UNITY_5_6_OR_NEWER
|
|
||||||
DrawItem("Build Guid", Application.buildGUID);
|
|
||||||
#endif
|
|
||||||
DrawItem("Target Frame Rate", Application.targetFrameRate.ToString());
|
|
||||||
DrawItem("Internet Reachability", Application.internetReachability.ToString());
|
|
||||||
DrawItem("Background Loading Priority", Application.backgroundLoadingPriority.ToString());
|
|
||||||
DrawItem("Is Playing", Application.isPlaying.ToString());
|
|
||||||
#if UNITY_5_5_OR_NEWER
|
|
||||||
DrawItem("Splash Screen Is Finished", SplashScreen.isFinished.ToString());
|
|
||||||
#else
|
|
||||||
DrawItem("Is Showing Splash Screen", Application.isShowingSplashScreen.ToString());
|
|
||||||
#endif
|
|
||||||
DrawItem("Run In Background", Application.runInBackground.ToString());
|
|
||||||
#if UNITY_5_5_OR_NEWER
|
|
||||||
DrawItem("Install Name", Application.installerName);
|
|
||||||
#endif
|
|
||||||
DrawItem("Install Mode", Application.installMode.ToString());
|
|
||||||
DrawItem("Sandbox Type", Application.sandboxType.ToString());
|
|
||||||
DrawItem("Is Mobile Platform", Application.isMobilePlatform.ToString());
|
|
||||||
DrawItem("Is Console Platform", Application.isConsolePlatform.ToString());
|
|
||||||
DrawItem("Is Editor", Application.isEditor.ToString());
|
|
||||||
DrawItem("Is Debug Build", Debug.isDebugBuild.ToString());
|
|
||||||
#if UNITY_5_6_OR_NEWER
|
|
||||||
DrawItem("Is Focused", Application.isFocused.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2018_2_OR_NEWER
|
|
||||||
DrawItem("Is Batch Mode", Application.isBatchMode.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_5_3
|
|
||||||
DrawItem("Stack Trace Log Type", Application.stackTraceLogType.ToString());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: c52c8dc8849c5fb429c50b45975a599b
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
|
|
||||||
namespace AlicizaX.Debugger.Runtime
|
|
||||||
{
|
|
||||||
public sealed partial class DebuggerComponent
|
|
||||||
{
|
|
||||||
private sealed class FpsCounter
|
|
||||||
{
|
|
||||||
private float m_UpdateInterval;
|
|
||||||
private float m_CurrentFps;
|
|
||||||
private int m_Frames;
|
|
||||||
private float m_Accumulator;
|
|
||||||
private float m_TimeLeft;
|
|
||||||
|
|
||||||
public FpsCounter(float updateInterval)
|
|
||||||
{
|
|
||||||
if (updateInterval <= 0f)
|
|
||||||
{
|
|
||||||
Log.Error("Update interval is invalid.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_UpdateInterval = updateInterval;
|
|
||||||
Reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
public float UpdateInterval
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return m_UpdateInterval;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value <= 0f)
|
|
||||||
{
|
|
||||||
Log.Error("Update interval is invalid.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_UpdateInterval = value;
|
|
||||||
Reset();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public float CurrentFps
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return m_CurrentFps;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Update(float elapseSeconds, float realElapseSeconds)
|
|
||||||
{
|
|
||||||
m_Frames++;
|
|
||||||
m_Accumulator += realElapseSeconds;
|
|
||||||
m_TimeLeft -= realElapseSeconds;
|
|
||||||
|
|
||||||
if (m_TimeLeft <= 0f)
|
|
||||||
{
|
|
||||||
m_CurrentFps = m_Accumulator > 0f ? m_Frames / m_Accumulator : 0f;
|
|
||||||
m_Frames = 0;
|
|
||||||
m_Accumulator = 0f;
|
|
||||||
m_TimeLeft += m_UpdateInterval;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Reset()
|
|
||||||
{
|
|
||||||
m_CurrentFps = 0f;
|
|
||||||
m_Frames = 0;
|
|
||||||
m_Accumulator = 0f;
|
|
||||||
m_TimeLeft = 0f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 4f24c805ead515d4286d3c03cd50f750
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,163 +0,0 @@
|
|||||||
using AlicizaX;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace AlicizaX.Debugger.Runtime
|
|
||||||
{
|
|
||||||
public sealed partial class DebuggerComponent
|
|
||||||
{
|
|
||||||
private sealed class GraphicsInformationWindow : ScrollableDebuggerWindowBase
|
|
||||||
{
|
|
||||||
protected override void OnDrawScrollableWindow()
|
|
||||||
{
|
|
||||||
GUILayout.Label("<b>Graphics Information</b>");
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
{
|
|
||||||
DrawItem("Device ID", SystemInfo.graphicsDeviceID.ToString());
|
|
||||||
DrawItem("Device Name", SystemInfo.graphicsDeviceName);
|
|
||||||
DrawItem("Device Vendor ID", SystemInfo.graphicsDeviceVendorID.ToString());
|
|
||||||
DrawItem("Device Vendor", SystemInfo.graphicsDeviceVendor);
|
|
||||||
DrawItem("Device Type", SystemInfo.graphicsDeviceType.ToString());
|
|
||||||
DrawItem("Device Version", SystemInfo.graphicsDeviceVersion);
|
|
||||||
DrawItem("Memory Size", Utility.Text.Format("{0} MB", SystemInfo.graphicsMemorySize));
|
|
||||||
DrawItem("Multi Threaded", SystemInfo.graphicsMultiThreaded.ToString());
|
|
||||||
#if UNITY_2019_3_OR_NEWER
|
|
||||||
DrawItem("Rendering Threading Mode", SystemInfo.renderingThreadingMode.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2020_1_OR_NEWER
|
|
||||||
DrawItem("HRD Display Support Flags", SystemInfo.hdrDisplaySupportFlags.ToString());
|
|
||||||
#endif
|
|
||||||
DrawItem("Shader Level", GetShaderLevelString(SystemInfo.graphicsShaderLevel));
|
|
||||||
DrawItem("Global Maximum LOD", Shader.globalMaximumLOD.ToString());
|
|
||||||
#if UNITY_5_6_OR_NEWER
|
|
||||||
DrawItem("Global Render Pipeline", Shader.globalRenderPipeline);
|
|
||||||
#endif
|
|
||||||
#if UNITY_2020_2_OR_NEWER
|
|
||||||
DrawItem("Min OpenGLES Version", Graphics.minOpenGLESVersion.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_5_5_OR_NEWER
|
|
||||||
DrawItem("Active Tier", Graphics.activeTier.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2017_2_OR_NEWER
|
|
||||||
DrawItem("Active Color Gamut", Graphics.activeColorGamut.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2019_2_OR_NEWER
|
|
||||||
DrawItem("Preserve Frame Buffer Alpha", Graphics.preserveFramebufferAlpha.ToString());
|
|
||||||
#endif
|
|
||||||
DrawItem("NPOT Support", SystemInfo.npotSupport.ToString());
|
|
||||||
DrawItem("Max Texture Size", SystemInfo.maxTextureSize.ToString());
|
|
||||||
DrawItem("Supported Render Target Count", SystemInfo.supportedRenderTargetCount.ToString());
|
|
||||||
#if UNITY_2019_3_OR_NEWER
|
|
||||||
DrawItem("Supported Random Write Target Count", SystemInfo.supportedRandomWriteTargetCount.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_5_4_OR_NEWER
|
|
||||||
DrawItem("Copy Texture Support", SystemInfo.copyTextureSupport.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_5_5_OR_NEWER
|
|
||||||
DrawItem("Uses Reversed ZBuffer", SystemInfo.usesReversedZBuffer.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_5_6_OR_NEWER
|
|
||||||
DrawItem("Max Cubemap Size", SystemInfo.maxCubemapSize.ToString());
|
|
||||||
DrawItem("Graphics UV Starts At Top", SystemInfo.graphicsUVStartsAtTop.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2020_2_OR_NEWER
|
|
||||||
DrawItem("Constant Buffer Offset Alignment", SystemInfo.constantBufferOffsetAlignment.ToString());
|
|
||||||
#elif UNITY_2019_1_OR_NEWER
|
|
||||||
DrawItem("Min Constant Buffer Offset Alignment", SystemInfo.minConstantBufferOffsetAlignment.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2018_3_OR_NEWER
|
|
||||||
DrawItem("Has Hidden Surface Removal On GPU", SystemInfo.hasHiddenSurfaceRemovalOnGPU.ToString());
|
|
||||||
DrawItem("Has Dynamic Uniform Array Indexing In Fragment Shaders", SystemInfo.hasDynamicUniformArrayIndexingInFragmentShaders.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2019_2_OR_NEWER
|
|
||||||
DrawItem("Has Mip Max Level", SystemInfo.hasMipMaxLevel.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2019_3_OR_NEWER
|
|
||||||
DrawItem("Uses Load Store Actions", SystemInfo.usesLoadStoreActions.ToString());
|
|
||||||
DrawItem("Max Compute Buffer Inputs Compute", SystemInfo.maxComputeBufferInputsCompute.ToString());
|
|
||||||
DrawItem("Max Compute Buffer Inputs Domain", SystemInfo.maxComputeBufferInputsDomain.ToString());
|
|
||||||
DrawItem("Max Compute Buffer Inputs Fragment", SystemInfo.maxComputeBufferInputsFragment.ToString());
|
|
||||||
DrawItem("Max Compute Buffer Inputs Geometry", SystemInfo.maxComputeBufferInputsGeometry.ToString());
|
|
||||||
DrawItem("Max Compute Buffer Inputs Hull", SystemInfo.maxComputeBufferInputsHull.ToString());
|
|
||||||
DrawItem("Max Compute Buffer Inputs Vertex", SystemInfo.maxComputeBufferInputsVertex.ToString());
|
|
||||||
DrawItem("Max Compute Work Group Size", SystemInfo.maxComputeWorkGroupSize.ToString());
|
|
||||||
DrawItem("Max Compute Work Group Size X", SystemInfo.maxComputeWorkGroupSizeX.ToString());
|
|
||||||
DrawItem("Max Compute Work Group Size Y", SystemInfo.maxComputeWorkGroupSizeY.ToString());
|
|
||||||
DrawItem("Max Compute Work Group Size Z", SystemInfo.maxComputeWorkGroupSizeZ.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_5_3 || UNITY_5_4
|
|
||||||
DrawItem("Supports Stencil", SystemInfo.supportsStencil.ToString());
|
|
||||||
DrawItem("Supports Render Textures", SystemInfo.supportsRenderTextures.ToString());
|
|
||||||
#endif
|
|
||||||
DrawItem("Supports Sparse Textures", SystemInfo.supportsSparseTextures.ToString());
|
|
||||||
DrawItem("Supports 3D Textures", SystemInfo.supports3DTextures.ToString());
|
|
||||||
DrawItem("Supports Shadows", SystemInfo.supportsShadows.ToString());
|
|
||||||
DrawItem("Supports Raw Shadow Depth Sampling", SystemInfo.supportsRawShadowDepthSampling.ToString());
|
|
||||||
#if !UNITY_2019_1_OR_NEWER
|
|
||||||
DrawItem("Supports Render To Cubemap", SystemInfo.supportsRenderToCubemap.ToString());
|
|
||||||
DrawItem("Supports Image Effects", SystemInfo.supportsImageEffects.ToString());
|
|
||||||
#endif
|
|
||||||
DrawItem("Supports Compute Shader", SystemInfo.supportsComputeShaders.ToString());
|
|
||||||
DrawItem("Supports Instancing", SystemInfo.supportsInstancing.ToString());
|
|
||||||
#if UNITY_5_4_OR_NEWER
|
|
||||||
DrawItem("Supports 2D Array Textures", SystemInfo.supports2DArrayTextures.ToString());
|
|
||||||
DrawItem("Supports Motion Vectors", SystemInfo.supportsMotionVectors.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_5_5_OR_NEWER
|
|
||||||
DrawItem("Supports Cubemap Array Textures", SystemInfo.supportsCubemapArrayTextures.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_5_6_OR_NEWER
|
|
||||||
DrawItem("Supports 3D Render Textures", SystemInfo.supports3DRenderTextures.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2017_2_OR_NEWER && !UNITY_2017_2_0 || UNITY_2017_1_4
|
|
||||||
DrawItem("Supports Texture Wrap Mirror Once", SystemInfo.supportsTextureWrapMirrorOnce.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2019_1_OR_NEWER
|
|
||||||
DrawItem("Supports Graphics Fence", SystemInfo.supportsGraphicsFence.ToString());
|
|
||||||
#elif UNITY_2017_3_OR_NEWER
|
|
||||||
DrawItem("Supports GPU Fence", SystemInfo.supportsGPUFence.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2017_3_OR_NEWER
|
|
||||||
DrawItem("Supports Async Compute", SystemInfo.supportsAsyncCompute.ToString());
|
|
||||||
DrawItem("Supports Multi-sampled Textures", SystemInfo.supportsMultisampledTextures.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2018_1_OR_NEWER
|
|
||||||
DrawItem("Supports Async GPU Readback", SystemInfo.supportsAsyncGPUReadback.ToString());
|
|
||||||
DrawItem("Supports 32bits Index Buffer", SystemInfo.supports32bitsIndexBuffer.ToString());
|
|
||||||
DrawItem("Supports Hardware Quad Topology", SystemInfo.supportsHardwareQuadTopology.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2018_2_OR_NEWER
|
|
||||||
DrawItem("Supports Mip Streaming", SystemInfo.supportsMipStreaming.ToString());
|
|
||||||
DrawItem("Supports Multi-sample Auto Resolve", SystemInfo.supportsMultisampleAutoResolve.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2018_3_OR_NEWER
|
|
||||||
DrawItem("Supports Separated Render Targets Blend", SystemInfo.supportsSeparatedRenderTargetsBlend.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2019_1_OR_NEWER
|
|
||||||
DrawItem("Supports Set Constant Buffer", SystemInfo.supportsSetConstantBuffer.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2019_3_OR_NEWER
|
|
||||||
DrawItem("Supports Geometry Shaders", SystemInfo.supportsGeometryShaders.ToString());
|
|
||||||
DrawItem("Supports Ray Tracing", SystemInfo.supportsRayTracing.ToString());
|
|
||||||
DrawItem("Supports Tessellation Shaders", SystemInfo.supportsTessellationShaders.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2020_1_OR_NEWER
|
|
||||||
DrawItem("Supports Compressed 3D Textures", SystemInfo.supportsCompressed3DTextures.ToString());
|
|
||||||
DrawItem("Supports Conservative Raster", SystemInfo.supportsConservativeRaster.ToString());
|
|
||||||
DrawItem("Supports GPU Recorder", SystemInfo.supportsGpuRecorder.ToString());
|
|
||||||
#endif
|
|
||||||
#if UNITY_2020_2_OR_NEWER
|
|
||||||
DrawItem("Supports Multi-sampled 2D Array Textures", SystemInfo.supportsMultisampled2DArrayTextures.ToString());
|
|
||||||
DrawItem("Supports Multiview", SystemInfo.supportsMultiview.ToString());
|
|
||||||
DrawItem("Supports Render Target Array Index From Vertex Shader", SystemInfo.supportsRenderTargetArrayIndexFromVertexShader.ToString());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetShaderLevelString(int shaderLevel)
|
|
||||||
{
|
|
||||||
return Utility.Text.Format("Shader Model {0}.{1}", shaderLevel / 10, shaderLevel % 10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a1342573add002c41b3bb1a8abb8ef3a
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
using AlicizaX;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace AlicizaX.Debugger.Runtime
|
|
||||||
{
|
|
||||||
public sealed partial class DebuggerComponent
|
|
||||||
{
|
|
||||||
private sealed class InputAccelerationInformationWindow : ScrollableDebuggerWindowBase
|
|
||||||
{
|
|
||||||
protected override void OnDrawScrollableWindow()
|
|
||||||
{
|
|
||||||
GUILayout.Label("<b>Input Acceleration Information</b>");
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
{
|
|
||||||
DrawItem("Acceleration", Input.acceleration.ToString());
|
|
||||||
DrawItem("Acceleration Event Count", Input.accelerationEventCount.ToString());
|
|
||||||
DrawItem("Acceleration Events", GetAccelerationEventsString(Input.accelerationEvents));
|
|
||||||
}
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetAccelerationEventString(AccelerationEvent accelerationEvent)
|
|
||||||
{
|
|
||||||
return Utility.Text.Format("{0}, {1}", accelerationEvent.acceleration, accelerationEvent.deltaTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetAccelerationEventsString(AccelerationEvent[] accelerationEvents)
|
|
||||||
{
|
|
||||||
string[] accelerationEventStrings = new string[accelerationEvents.Length];
|
|
||||||
for (int i = 0; i < accelerationEvents.Length; i++)
|
|
||||||
{
|
|
||||||
accelerationEventStrings[i] = GetAccelerationEventString(accelerationEvents[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return string.Join("; ", accelerationEventStrings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 99bd178c0d097a24d9e04fe1522bca60
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
using AlicizaX;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace AlicizaX.Debugger.Runtime
|
|
||||||
{
|
|
||||||
public sealed partial class DebuggerComponent
|
|
||||||
{
|
|
||||||
private sealed class InputCompassInformationWindow : ScrollableDebuggerWindowBase
|
|
||||||
{
|
|
||||||
protected override void OnDrawScrollableWindow()
|
|
||||||
{
|
|
||||||
GUILayout.Label("<b>Input Compass Information</b>");
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
{
|
|
||||||
GUILayout.BeginHorizontal();
|
|
||||||
{
|
|
||||||
if (GUILayout.Button("Enable", GUILayout.Height(30f)))
|
|
||||||
{
|
|
||||||
Input.compass.enabled = true;
|
|
||||||
}
|
|
||||||
if (GUILayout.Button("Disable", GUILayout.Height(30f)))
|
|
||||||
{
|
|
||||||
Input.compass.enabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GUILayout.EndHorizontal();
|
|
||||||
|
|
||||||
DrawItem("Enabled", Input.compass.enabled.ToString());
|
|
||||||
if (Input.compass.enabled)
|
|
||||||
{
|
|
||||||
DrawItem("Heading Accuracy", Input.compass.headingAccuracy.ToString());
|
|
||||||
DrawItem("Magnetic Heading", Input.compass.magneticHeading.ToString());
|
|
||||||
DrawItem("Raw Vector", Input.compass.rawVector.ToString());
|
|
||||||
DrawItem("Timestamp", Input.compass.timestamp.ToString());
|
|
||||||
DrawItem("True Heading", Input.compass.trueHeading.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a8e33bb9948f7f54d988d80a6ae6a24a
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
using AlicizaX;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace AlicizaX.Debugger.Runtime
|
|
||||||
{
|
|
||||||
public sealed partial class DebuggerComponent
|
|
||||||
{
|
|
||||||
private sealed class InputGyroscopeInformationWindow : ScrollableDebuggerWindowBase
|
|
||||||
{
|
|
||||||
protected override void OnDrawScrollableWindow()
|
|
||||||
{
|
|
||||||
GUILayout.Label("<b>Input Gyroscope Information</b>");
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
{
|
|
||||||
GUILayout.BeginHorizontal();
|
|
||||||
{
|
|
||||||
if (GUILayout.Button("Enable", GUILayout.Height(30f)))
|
|
||||||
{
|
|
||||||
Input.gyro.enabled = true;
|
|
||||||
}
|
|
||||||
if (GUILayout.Button("Disable", GUILayout.Height(30f)))
|
|
||||||
{
|
|
||||||
Input.gyro.enabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GUILayout.EndHorizontal();
|
|
||||||
|
|
||||||
DrawItem("Enabled", Input.gyro.enabled.ToString());
|
|
||||||
if (Input.gyro.enabled)
|
|
||||||
{
|
|
||||||
DrawItem("Update Interval", Input.gyro.updateInterval.ToString());
|
|
||||||
DrawItem("Attitude", Input.gyro.attitude.eulerAngles.ToString());
|
|
||||||
DrawItem("Gravity", Input.gyro.gravity.ToString());
|
|
||||||
DrawItem("Rotation Rate", Input.gyro.rotationRate.ToString());
|
|
||||||
DrawItem("Rotation Rate Unbiased", Input.gyro.rotationRateUnbiased.ToString());
|
|
||||||
DrawItem("User Acceleration", Input.gyro.userAcceleration.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 709450f452a296b44b4aa939cf37f37c
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
using AlicizaX;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace AlicizaX.Debugger.Runtime
|
|
||||||
{
|
|
||||||
public sealed partial class DebuggerComponent
|
|
||||||
{
|
|
||||||
private sealed class InputLocationInformationWindow : ScrollableDebuggerWindowBase
|
|
||||||
{
|
|
||||||
protected override void OnDrawScrollableWindow()
|
|
||||||
{
|
|
||||||
GUILayout.Label("<b>Input Location Information</b>");
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
{
|
|
||||||
GUILayout.BeginHorizontal();
|
|
||||||
{
|
|
||||||
if (GUILayout.Button("Enable", GUILayout.Height(30f)))
|
|
||||||
{
|
|
||||||
Input.location.Start();
|
|
||||||
}
|
|
||||||
if (GUILayout.Button("Disable", GUILayout.Height(30f)))
|
|
||||||
{
|
|
||||||
Input.location.Stop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GUILayout.EndHorizontal();
|
|
||||||
|
|
||||||
DrawItem("Is Enabled By User", Input.location.isEnabledByUser.ToString());
|
|
||||||
DrawItem("Status", Input.location.status.ToString());
|
|
||||||
if (Input.location.status == LocationServiceStatus.Running)
|
|
||||||
{
|
|
||||||
DrawItem("Horizontal Accuracy", Input.location.lastData.horizontalAccuracy.ToString());
|
|
||||||
DrawItem("Vertical Accuracy", Input.location.lastData.verticalAccuracy.ToString());
|
|
||||||
DrawItem("Longitude", Input.location.lastData.longitude.ToString());
|
|
||||||
DrawItem("Latitude", Input.location.lastData.latitude.ToString());
|
|
||||||
DrawItem("Altitude", Input.location.lastData.altitude.ToString());
|
|
||||||
DrawItem("Timestamp", Input.location.lastData.timestamp.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 74c5698b7ee786442b28b64003f564fc
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
using AlicizaX;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace AlicizaX.Debugger.Runtime
|
|
||||||
{
|
|
||||||
public sealed partial class DebuggerComponent
|
|
||||||
{
|
|
||||||
private sealed class InputSummaryInformationWindow : ScrollableDebuggerWindowBase
|
|
||||||
{
|
|
||||||
protected override void OnDrawScrollableWindow()
|
|
||||||
{
|
|
||||||
GUILayout.Label("<b>Input Summary Information</b>");
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
{
|
|
||||||
DrawItem("Back Button Leaves App", Input.backButtonLeavesApp.ToString());
|
|
||||||
DrawItem("Device Orientation", Input.deviceOrientation.ToString());
|
|
||||||
DrawItem("Mouse Present", Input.mousePresent.ToString());
|
|
||||||
DrawItem("Mouse Position", Input.mousePosition.ToString());
|
|
||||||
DrawItem("Mouse Scroll Delta", Input.mouseScrollDelta.ToString());
|
|
||||||
DrawItem("Any Key", Input.anyKey.ToString());
|
|
||||||
DrawItem("Any Key Down", Input.anyKeyDown.ToString());
|
|
||||||
DrawItem("Input String", Input.inputString);
|
|
||||||
DrawItem("IME Is Selected", Input.imeIsSelected.ToString());
|
|
||||||
DrawItem("IME Composition Mode", Input.imeCompositionMode.ToString());
|
|
||||||
DrawItem("Compensate Sensors", Input.compensateSensors.ToString());
|
|
||||||
DrawItem("Composition Cursor Position", Input.compositionCursorPos.ToString());
|
|
||||||
DrawItem("Composition String", Input.compositionString);
|
|
||||||
}
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a2756ce9647dc6a49a66c75437edef8b
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
using AlicizaX;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace AlicizaX.Debugger.Runtime
|
|
||||||
{
|
|
||||||
public sealed partial class DebuggerComponent
|
|
||||||
{
|
|
||||||
private sealed class InputTouchInformationWindow : ScrollableDebuggerWindowBase
|
|
||||||
{
|
|
||||||
protected override void OnDrawScrollableWindow()
|
|
||||||
{
|
|
||||||
GUILayout.Label("<b>Input Touch Information</b>");
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
{
|
|
||||||
DrawItem("Touch Supported", Input.touchSupported.ToString());
|
|
||||||
DrawItem("Touch Pressure Supported", Input.touchPressureSupported.ToString());
|
|
||||||
DrawItem("Stylus Touch Supported", Input.stylusTouchSupported.ToString());
|
|
||||||
DrawItem("Simulate Mouse With Touches", Input.simulateMouseWithTouches.ToString());
|
|
||||||
DrawItem("Multi Touch Enabled", Input.multiTouchEnabled.ToString());
|
|
||||||
DrawItem("Touch Count", Input.touchCount.ToString());
|
|
||||||
DrawItem("Touches", GetTouchesString(Input.touches));
|
|
||||||
}
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetTouchString(Touch touch)
|
|
||||||
{
|
|
||||||
return Utility.Text.Format("{0}, {1}, {2}, {3}, {4}", touch.position, touch.deltaPosition, touch.rawPosition, touch.pressure, touch.phase);
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetTouchesString(Touch[] touches)
|
|
||||||
{
|
|
||||||
string[] touchStrings = new string[touches.Length];
|
|
||||||
for (int i = 0; i < touches.Length; i++)
|
|
||||||
{
|
|
||||||
touchStrings[i] = GetTouchString(touches[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return string.Join("; ", touchStrings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 6a76aa41d893e994f9630028d5e3001d
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,119 +0,0 @@
|
|||||||
|
|
||||||
using System;
|
|
||||||
using AlicizaX;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace AlicizaX.Debugger.Runtime
|
|
||||||
{
|
|
||||||
public sealed partial class DebuggerComponent
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 日志记录结点。
|
|
||||||
/// </summary>
|
|
||||||
public sealed class LogNode : IMemory
|
|
||||||
{
|
|
||||||
private DateTime m_LogTime;
|
|
||||||
private int m_LogFrameCount;
|
|
||||||
private LogType m_LogType;
|
|
||||||
private string m_LogMessage;
|
|
||||||
private string m_StackTrack;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 初始化日志记录结点的新实例。
|
|
||||||
/// </summary>
|
|
||||||
public LogNode()
|
|
||||||
{
|
|
||||||
m_LogTime = default(DateTime);
|
|
||||||
m_LogFrameCount = 0;
|
|
||||||
m_LogType = LogType.Error;
|
|
||||||
m_LogMessage = null;
|
|
||||||
m_StackTrack = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取日志时间。
|
|
||||||
/// </summary>
|
|
||||||
public DateTime LogTime
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return m_LogTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取日志帧计数。
|
|
||||||
/// </summary>
|
|
||||||
public int LogFrameCount
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return m_LogFrameCount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取日志类型。
|
|
||||||
/// </summary>
|
|
||||||
public LogType LogType
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return m_LogType;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取日志内容。
|
|
||||||
/// </summary>
|
|
||||||
public string LogMessage
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return m_LogMessage;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取日志堆栈信息。
|
|
||||||
/// </summary>
|
|
||||||
public string StackTrack
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return m_StackTrack;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建日志记录结点。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="logType">日志类型。</param>
|
|
||||||
/// <param name="logMessage">日志内容。</param>
|
|
||||||
/// <param name="stackTrack">日志堆栈信息。</param>
|
|
||||||
/// <returns>创建的日志记录结点。</returns>
|
|
||||||
public static LogNode Create(LogType logType, string logMessage, string stackTrack)
|
|
||||||
{
|
|
||||||
LogNode logNode = MemoryPool.Acquire<LogNode>();
|
|
||||||
logNode.m_LogTime = DateTime.UtcNow;
|
|
||||||
logNode.m_LogFrameCount = Time.frameCount;
|
|
||||||
logNode.m_LogType = logType;
|
|
||||||
logNode.m_LogMessage = logMessage;
|
|
||||||
logNode.m_StackTrack = stackTrack;
|
|
||||||
return logNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 清理日志记录结点。
|
|
||||||
/// </summary>
|
|
||||||
public void Clear()
|
|
||||||
{
|
|
||||||
m_LogTime = default(DateTime);
|
|
||||||
m_LogFrameCount = 0;
|
|
||||||
m_LogType = LogType.Error;
|
|
||||||
m_LogMessage = null;
|
|
||||||
m_StackTrack = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 168b4dfdd72224e4bbc5fb606eec23dd
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,87 +0,0 @@
|
|||||||
using AlicizaX.ObjectPool;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace AlicizaX.Debugger.Runtime
|
|
||||||
{
|
|
||||||
public sealed partial class DebuggerComponent
|
|
||||||
{
|
|
||||||
private sealed class ObjectPoolInformationWindow : ScrollableDebuggerWindowBase
|
|
||||||
{
|
|
||||||
private IObjectPoolModule m_ObjectPoolComponent = null;
|
|
||||||
|
|
||||||
public override void Initialize(params object[] args)
|
|
||||||
{
|
|
||||||
m_ObjectPoolComponent = ModuleSystem.GetModule<IObjectPoolModule>();
|
|
||||||
if (m_ObjectPoolComponent == null)
|
|
||||||
{
|
|
||||||
Log.Error("Object pool component is invalid.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnDrawScrollableWindow()
|
|
||||||
{
|
|
||||||
GUILayout.Label("<b>Object Pool Information</b>");
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
{
|
|
||||||
DrawItem("Object Pool Count", m_ObjectPoolComponent.Count.ToString());
|
|
||||||
}
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
ObjectPoolBase[] objectPools = m_ObjectPoolComponent.GetAllObjectPools(true);
|
|
||||||
for (int i = 0; i < objectPools.Length; i++)
|
|
||||||
{
|
|
||||||
DrawObjectPool(objectPools[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawObjectPool(ObjectPoolBase objectPool)
|
|
||||||
{
|
|
||||||
GUILayout.Label(Utility.Text.Format("<b>Object Pool: {0}</b>", objectPool.FullName));
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
{
|
|
||||||
DrawItem("Name", objectPool.Name);
|
|
||||||
DrawItem("Type", objectPool.ObjectType.FullName);
|
|
||||||
DrawItem("Auto Release Interval", objectPool.AutoReleaseInterval.ToString());
|
|
||||||
DrawItem("Capacity", objectPool.Capacity.ToString());
|
|
||||||
DrawItem("Used Count", objectPool.Count.ToString());
|
|
||||||
DrawItem("Can Release Count", objectPool.CanReleaseCount.ToString());
|
|
||||||
DrawItem("Expire Time", objectPool.ExpireTime.ToString());
|
|
||||||
DrawItem("Priority", objectPool.Priority.ToString());
|
|
||||||
ObjectInfo[] objectInfos = objectPool.GetAllObjectInfos();
|
|
||||||
GUILayout.BeginHorizontal();
|
|
||||||
{
|
|
||||||
GUILayout.Label("<b>Name</b>");
|
|
||||||
GUILayout.Label("<b>Locked</b>", GUILayout.Width(60f));
|
|
||||||
GUILayout.Label(objectPool.AllowMultiSpawn ? "<b>Count</b>" : "<b>In Use</b>", GUILayout.Width(60f));
|
|
||||||
GUILayout.Label("<b>Flag</b>", GUILayout.Width(60f));
|
|
||||||
GUILayout.Label("<b>Priority</b>", GUILayout.Width(60f));
|
|
||||||
GUILayout.Label("<b>Last Use Time</b>", GUILayout.Width(120f));
|
|
||||||
}
|
|
||||||
GUILayout.EndHorizontal();
|
|
||||||
|
|
||||||
if (objectInfos.Length > 0)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < objectInfos.Length; i++)
|
|
||||||
{
|
|
||||||
GUILayout.BeginHorizontal();
|
|
||||||
{
|
|
||||||
GUILayout.Label(string.IsNullOrEmpty(objectInfos[i].Name) ? "<None>" : objectInfos[i].Name);
|
|
||||||
GUILayout.Label(objectInfos[i].Locked.ToString(), GUILayout.Width(60f));
|
|
||||||
GUILayout.Label(objectPool.AllowMultiSpawn ? objectInfos[i].SpawnCount.ToString() : objectInfos[i].IsInUse.ToString(), GUILayout.Width(60f));
|
|
||||||
GUILayout.Label(objectInfos[i].CustomCanReleaseFlag.ToString(), GUILayout.Width(60f));
|
|
||||||
GUILayout.Label(objectInfos[i].Priority.ToString(), GUILayout.Width(60f));
|
|
||||||
GUILayout.Label(objectInfos[i].LastUseTime.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"), GUILayout.Width(120f));
|
|
||||||
}
|
|
||||||
GUILayout.EndHorizontal();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GUILayout.Label("<i>Object Pool is Empty ...</i>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 5898a6ad35652924590c863ef4bc6341
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user