diff --git a/Assets/1_Script/Common/EventAggregator.cs b/Assets/1_Script/Common/EventAggregator.cs new file mode 100644 index 0000000..f942c6c --- /dev/null +++ b/Assets/1_Script/Common/EventAggregator.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using Unity.Profiling; +using UnityEngine; + +public static class EventAggregator +{ + // 타입별 SubscriberList 저장 + static readonly Dictionary subscribers = new Dictionary(); + + // Publish 성능 측정을 위한 profiler marker + static readonly ProfilerMarker publishMarker = new ProfilerMarker("EventAggregator.Publish"); + + + /// + /// 이벤트 타입 T를 구독합니다. + /// + public static void Subscribe(Action handler) + { + var key = typeof(T); + if (!subscribers.TryGetValue(key, out var listObj)) + { + listObj = new SubscriberList(initialCapacity: 4); + subscribers[key] = listObj; + } + ((SubscriberList)listObj).Add(handler); + + Logger.LogDebug($"[EA] Subscribe<{key.Name}> → {handler.Target?.GetType().Name}.{handler.Method.Name}"); + } + + /// + /// 이벤트 타입 T의 구독을 해제합니다. + /// + public static void Unsubscribe(Action handler) + { + var key = typeof(T); + if (subscribers.TryGetValue(key, out var listObj)) + ((SubscriberList)listObj).Remove(handler); + + Logger.LogDebug($"[EA] Unsubscribe<{key.Name}> ← {handler.Target?.GetType().Name}.{handler.Method.Name}"); + } + + /// + /// 이벤트를 발행합니다. + /// + public static void Publish(in T payload) + { + var key = typeof(T); + Logger.LogDebug($"[EA] Publish<{key.Name}> payload={payload}"); + + publishMarker.Begin(); + if (subscribers.TryGetValue(key, out var listObj)) + ((SubscriberList)listObj).Invoke(payload); + publishMarker.End(); + } + + class SubscriberList + { + readonly List> handlers; + + public SubscriberList(int initialCapacity) + { + handlers = new List>(initialCapacity); + } + + public void Add(Action handler) => handlers.Add(handler); + public void Remove(Action handler) => handlers.Remove(handler); + + public void Invoke(in T payload) + { + for (int i = 0, cnt = handlers.Count; i < cnt; i++) + { +#if UNITY_EDITOR || DEVELOPMENT_BUILD + try + { + handlers[i].Invoke(payload); + } + catch (Exception ex) + { + // 오류는 항상 남기되, 로깅 메커니즘을 통일 + Logger.LogError($"[EA] Exception in <{typeof(T).Name}> handler: {ex}"); + } +#else + _handlers[i].Invoke(payload); +#endif + } + } + } +} \ No newline at end of file diff --git a/Assets/1_Script/Common/EventAggregator.cs.meta b/Assets/1_Script/Common/EventAggregator.cs.meta new file mode 100644 index 0000000..e7acbb8 --- /dev/null +++ b/Assets/1_Script/Common/EventAggregator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1bdb5ee5978824342bf8f70083212f3b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/1_Script/Common/Logger.cs b/Assets/1_Script/Common/Logger.cs new file mode 100644 index 0000000..50eb71c --- /dev/null +++ b/Assets/1_Script/Common/Logger.cs @@ -0,0 +1,53 @@ +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using UnityEngine; + +/// +/// Debug.Log을 좀 더 편하게 사용하기 위한 헬퍼 클래스입니다. +/// +public static class Logger +{ + public enum Level { Debug, Info, Warning, Error } + + // 릴리즈 빌드에서 불필요한 스택트레이스 끄기 + static Logger() + { +#if !UNITY_EDITOR && !DEVELOPMENT_BUILD + Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None); + Application.SetStackTraceLogType(LogType.Warning,StackTraceLogType.None); + Application.SetStackTraceLogType(LogType.Error, StackTraceLogType.ScriptOnly); +#endif + } + + // 에디터/개발 빌드에서만 컴파일됨 → 릴리즈에선 이 호출 자체가 사라집니다 + [Conditional("UNITY_EDITOR"), Conditional("DEVELOPMENT_BUILD")] + public static void LogDebug(object message, UnityEngine.Object context = null) => LogInternal(Level.Debug, message, context); + + [Conditional("UNITY_EDITOR"), Conditional("DEVELOPMENT_BUILD")] + public static void LogInfo(object message, UnityEngine.Object context = null) => LogInternal(Level.Info, message, context); + + [Conditional("UNITY_EDITOR"), Conditional("DEVELOPMENT_BUILD")] + public static void LogWarning(object message, UnityEngine.Object context = null) => LogInternal(Level.Warning, message, context); + + // 에러는 항상 남겨둡니다 + public static void LogError(object message, UnityEngine.Object context = null) => LogInternal(Level.Error, message, context); + + static void LogInternal(Level level, object message, UnityEngine.Object context = null) + { + switch (level) + { + case Level.Debug: + case Level.Info: + UnityEngine.Debug.Log(message, context); + break; + case Level.Warning: + UnityEngine.Debug.LogWarning(message, context); + break; + case Level.Error: + UnityEngine.Debug.LogError(message, context); + break; + } + } +} \ No newline at end of file diff --git a/Assets/1_Script/Common/Logger.cs.meta b/Assets/1_Script/Common/Logger.cs.meta new file mode 100644 index 0000000..9f12225 --- /dev/null +++ b/Assets/1_Script/Common/Logger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 49e767187741d7a44a8d5a4997eeb9fe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/1_Script/Editor.meta b/Assets/1_Script/Editor.meta new file mode 100644 index 0000000..31c4eac --- /dev/null +++ b/Assets/1_Script/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c668a33c62b41e3418810e6e2cc2e923 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/1_Script/Editor/EventAggregatorDebugger.cs b/Assets/1_Script/Editor/EventAggregatorDebugger.cs new file mode 100644 index 0000000..6008982 --- /dev/null +++ b/Assets/1_Script/Editor/EventAggregatorDebugger.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +/// +/// Window → EventAggregator Debugger 메뉴에서 구독 현황을 확인할 수 있는 에디터 창입니다. +/// +public class EventAggregatorDebugger : EditorWindow +{ + Vector2 scroll; + + [MenuItem("Window/EventAggregator Debugger")] + static void Open() => GetWindow("EA Debugger"); + + void OnGUI() + { + GUILayout.Label("EventAggregator Subscriptions", EditorStyles.boldLabel); + scroll = EditorGUILayout.BeginScrollView(scroll); + + foreach (var info in EventAggregatorInspector.GetSubscriptions()) + { + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField(info.EventType.Name, GUILayout.Width(150)); + EditorGUILayout.LabelField($"{info.SubscriberCount} subscriber(s)"); + EditorGUILayout.EndHorizontal(); + } + + EditorGUILayout.EndScrollView(); + } +} \ No newline at end of file diff --git a/Assets/1_Script/Editor/EventAggregatorDebugger.cs.meta b/Assets/1_Script/Editor/EventAggregatorDebugger.cs.meta new file mode 100644 index 0000000..1475899 --- /dev/null +++ b/Assets/1_Script/Editor/EventAggregatorDebugger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8796eead6592165488e8a1f5a8ef601b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/1_Script/Editor/EventAggregatorInspector.cs b/Assets/1_Script/Editor/EventAggregatorInspector.cs new file mode 100644 index 0000000..00dd6d0 --- /dev/null +++ b/Assets/1_Script/Editor/EventAggregatorInspector.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using UnityEditor; +using UnityEngine; + + +/// +/// EventAggregator의 내부 subscribers 딕셔너리를 리플렉션으로 읽어 구독 정보를 제공하는 헬퍼 클래스입니다. +/// +public static +class EventAggregatorInspector +{ + public struct SubscriptionInfo + { + public Type EventType; + public int SubscriberCount; + } + + /// + /// 현재 등록된 모든 이벤트 타입과 구독자 수를 반환합니다. + /// + public static IEnumerable GetSubscriptions() + { + var eaType = typeof(EventAggregator); + var field = eaType.GetField("subscribers", BindingFlags.Static | BindingFlags.NonPublic); + if (field == null) + yield break; + + var dict = field.GetValue(null) as Dictionary; + if (dict == null) + yield break; + + foreach (var kvp in dict) + { + var listObj = kvp.Value; + var handlersField = listObj.GetType() + .GetField("handlers", BindingFlags.Instance | BindingFlags.NonPublic); + var list = handlersField?.GetValue(listObj) as ICollection; + int count = list != null ? list.Count : 0; + + yield return new SubscriptionInfo + { + EventType = kvp.Key, + SubscriberCount = count + }; + } + } +} diff --git a/Assets/1_Script/Editor/EventAggregatorInspector.cs.meta b/Assets/1_Script/Editor/EventAggregatorInspector.cs.meta new file mode 100644 index 0000000..ca23c39 --- /dev/null +++ b/Assets/1_Script/Editor/EventAggregatorInspector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b1d39327a4bc367478018c4eb32e6a74 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/1_Script/Play/PlayManager.cs.meta b/Assets/1_Script/Play/PlayManager.cs.meta index 86382c1..af3cf9c 100644 --- a/Assets/1_Script/Play/PlayManager.cs.meta +++ b/Assets/1_Script/Play/PlayManager.cs.meta @@ -1,2 +1,11 @@ fileFormatVersion: 2 -guid: 46bd8f1c673ca8e40bf245d298edd854 \ No newline at end of file +guid: 46bd8f1c673ca8e40bf245d298edd854 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/1_Script/Player/PlayerContoller.cs.meta b/Assets/1_Script/Player/PlayerContoller.cs.meta index 936db93..eb54acb 100644 --- a/Assets/1_Script/Player/PlayerContoller.cs.meta +++ b/Assets/1_Script/Player/PlayerContoller.cs.meta @@ -1,2 +1,11 @@ fileFormatVersion: 2 -guid: f5ce1188e2abd3c45b15851146565423 \ No newline at end of file +guid: f5ce1188e2abd3c45b15851146565423 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/1_Script/Test.meta b/Assets/1_Script/Test.meta new file mode 100644 index 0000000..bae390c --- /dev/null +++ b/Assets/1_Script/Test.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e3db7b4373a1c1e4ba8c12dfcff1cf6b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/1_Script/Test/EventAggreagator.meta b/Assets/1_Script/Test/EventAggreagator.meta new file mode 100644 index 0000000..7320375 --- /dev/null +++ b/Assets/1_Script/Test/EventAggreagator.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 393961290d0dfb544ae65ec079bf758e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/1_Script/Test/EventAggreagator/EventTest.unity b/Assets/1_Script/Test/EventAggreagator/EventTest.unity new file mode 100644 index 0000000..2a73a1c --- /dev/null +++ b/Assets/1_Script/Test/EventAggreagator/EventTest.unity @@ -0,0 +1,311 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &100138859 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 100138862} + - component: {fileID: 100138861} + - component: {fileID: 100138860} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &100138860 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100138859} + m_Enabled: 1 +--- !u!20 &100138861 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100138859} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &100138862 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100138859} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &276881589 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 276881591} + - component: {fileID: 276881590} + m_Layer: 0 + m_Name: Subscriber + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &276881590 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 276881589} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 94e38aaf07012704180737c81b6ef3aa, type: 3} + m_Name: + m_EditorClassIdentifier: + isSubscribe: 1 +--- !u!4 &276881591 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 276881589} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2127602929 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2127602931} + - component: {fileID: 2127602930} + m_Layer: 0 + m_Name: Publisher + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2127602930 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2127602929} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a5ad87a4c1dd1d740adf7162b0067215, type: 3} + m_Name: + m_EditorClassIdentifier: + count: 0 +--- !u!4 &2127602931 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2127602929} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 100138862} + - {fileID: 2127602931} + - {fileID: 276881591} diff --git a/Assets/1_Script/Test/EventAggreagator/EventTest.unity.meta b/Assets/1_Script/Test/EventAggreagator/EventTest.unity.meta new file mode 100644 index 0000000..8ac903f --- /dev/null +++ b/Assets/1_Script/Test/EventAggreagator/EventTest.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e3bd7577a327e1f4d888e3111464dd7b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/1_Script/Test/EventAggreagator/EventTestPub.cs b/Assets/1_Script/Test/EventAggreagator/EventTestPub.cs new file mode 100644 index 0000000..b68c3c6 --- /dev/null +++ b/Assets/1_Script/Test/EventAggreagator/EventTestPub.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class EventTestPub : MonoBehaviour +{ + [SerializeField] + private int count = 0; + + // Update is called once per frame + void Update() + { + if(Input.GetKeyDown(KeyCode.Space)) + { + count++; + EventAggregator.Publish(count); + } + } +} diff --git a/Assets/1_Script/Test/EventAggreagator/EventTestPub.cs.meta b/Assets/1_Script/Test/EventAggreagator/EventTestPub.cs.meta new file mode 100644 index 0000000..eee6126 --- /dev/null +++ b/Assets/1_Script/Test/EventAggreagator/EventTestPub.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a5ad87a4c1dd1d740adf7162b0067215 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/1_Script/Test/EventAggreagator/EventTestSub.cs b/Assets/1_Script/Test/EventAggreagator/EventTestSub.cs new file mode 100644 index 0000000..46a0382 --- /dev/null +++ b/Assets/1_Script/Test/EventAggreagator/EventTestSub.cs @@ -0,0 +1,40 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class EventTestSub : MonoBehaviour +{ + [SerializeField] private bool isSubscribe = true; + private void OnEnable() + { + isSubscribe = true; + EventAggregator.Subscribe(OnEvent); + } + + + private void OnEvent(int i) + { + Logger.LogInfo($"EventTestSub : {i}"); + + } + + private void Update() + { + if (Input.GetKeyDown(KeyCode.Escape)) + { + Unsubscribe(); + } + } + private void OnDisable() + { + Unsubscribe(); + } + + + private void Unsubscribe() + { + if(!isSubscribe) return; + isSubscribe = false; + EventAggregator.Unsubscribe(OnEvent); + } +} diff --git a/Assets/1_Script/Test/EventAggreagator/EventTestSub.cs.meta b/Assets/1_Script/Test/EventAggreagator/EventTestSub.cs.meta new file mode 100644 index 0000000..6540309 --- /dev/null +++ b/Assets/1_Script/Test/EventAggreagator/EventTestSub.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94e38aaf07012704180737c81b6ef3aa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Packages/ClosedXML.0.105.0/nuget-logo.png.meta b/Assets/Packages/ClosedXML.0.105.0/nuget-logo.png.meta index bff649f..5b3b0b6 100644 --- a/Assets/Packages/ClosedXML.0.105.0/nuget-logo.png.meta +++ b/Assets/Packages/ClosedXML.0.105.0/nuget-logo.png.meta @@ -128,7 +128,8 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - nameFileIdTable: {} + nameFileIdTable: + nuget-logo_0: -2711032071728996648 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: diff --git a/Assets/Packages/DocumentFormat.OpenXml.3.1.1/icon.png.meta b/Assets/Packages/DocumentFormat.OpenXml.3.1.1/icon.png.meta index f93c222..a9db979 100644 --- a/Assets/Packages/DocumentFormat.OpenXml.3.1.1/icon.png.meta +++ b/Assets/Packages/DocumentFormat.OpenXml.3.1.1/icon.png.meta @@ -128,7 +128,8 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - nameFileIdTable: {} + nameFileIdTable: + icon_0: 6934086728263231946 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: diff --git a/Assets/Packages/DocumentFormat.OpenXml.Framework.3.1.1/icon.png.meta b/Assets/Packages/DocumentFormat.OpenXml.Framework.3.1.1/icon.png.meta index 93b19ae..2db02b6 100644 --- a/Assets/Packages/DocumentFormat.OpenXml.Framework.3.1.1/icon.png.meta +++ b/Assets/Packages/DocumentFormat.OpenXml.Framework.3.1.1/icon.png.meta @@ -128,7 +128,8 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - nameFileIdTable: {} + nameFileIdTable: + icon_0: 6934086728263231946 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: diff --git a/Assets/Packages/ExcelNumberFormat.1.1.0/icon.png.meta b/Assets/Packages/ExcelNumberFormat.1.1.0/icon.png.meta index 46857fd..ee81271 100644 --- a/Assets/Packages/ExcelNumberFormat.1.1.0/icon.png.meta +++ b/Assets/Packages/ExcelNumberFormat.1.1.0/icon.png.meta @@ -128,7 +128,8 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - nameFileIdTable: {} + nameFileIdTable: + icon_0: 6934086728263231946 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: diff --git a/Assets/Packages/SixLabors.Fonts.1.0.0/sixlabors.fonts.128.png.meta b/Assets/Packages/SixLabors.Fonts.1.0.0/sixlabors.fonts.128.png.meta index 8b4b36e..7622e7b 100644 --- a/Assets/Packages/SixLabors.Fonts.1.0.0/sixlabors.fonts.128.png.meta +++ b/Assets/Packages/SixLabors.Fonts.1.0.0/sixlabors.fonts.128.png.meta @@ -128,7 +128,8 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - nameFileIdTable: {} + nameFileIdTable: + sixlabors.fonts.128_0: 471046327715530374 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: diff --git a/Assets/Packages/System.IO.Packaging.8.0.1/Icon.png.meta b/Assets/Packages/System.IO.Packaging.8.0.1/Icon.png.meta index 1efc2a4..b06471a 100644 --- a/Assets/Packages/System.IO.Packaging.8.0.1/Icon.png.meta +++ b/Assets/Packages/System.IO.Packaging.8.0.1/Icon.png.meta @@ -128,7 +128,8 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - nameFileIdTable: {} + nameFileIdTable: + Icon_0: -2278566297644842510 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: