From 7086b592beabb33fecd4b607bfa519594714b7eb Mon Sep 17 00:00:00 2001 From: Vorobey Date: Mon, 12 Feb 2024 21:56:21 +0300 Subject: [PATCH 01/15] Update project --- Assets/Scenes/Empty.unity | 166 +++++++++- Packages/manifest.json | 6 +- Packages/packages-lock.json | 14 +- ProjectSettings/MemorySettings.asset | 35 ++ ProjectSettings/MultiplayerManager.asset | 7 + ProjectSettings/PackageManagerSettings.asset | 26 +- ProjectSettings/ProjectSettings.asset | 331 +++++++++++++++++-- ProjectSettings/ProjectVersion.txt | 4 +- 8 files changed, 517 insertions(+), 72 deletions(-) create mode 100644 ProjectSettings/MemorySettings.asset create mode 100644 ProjectSettings/MultiplayerManager.asset diff --git a/Assets/Scenes/Empty.unity b/Assets/Scenes/Empty.unity index 10483f8..819bfdd 100644 --- a/Assets/Scenes/Empty.unity +++ b/Assets/Scenes/Empty.unity @@ -13,7 +13,7 @@ OcclusionCullingSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 9 + serializedVersion: 10 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -38,13 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} + 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 @@ -67,9 +66,6 @@ LightmapSettings: m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 m_ReflectionCompression: 2 m_MixedBakeMode: 2 m_BakeBackend: 1 @@ -104,7 +100,7 @@ NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -117,7 +113,7 @@ NavMeshSettings: cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 maxJobWorkers: 0 preserveTilesOutsideBounds: 0 debug: @@ -154,9 +150,17 @@ Camera: 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_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -190,12 +194,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 68777780} + serializedVersion: 2 m_LocalRotation: {x: -0.149608, y: 0.8423521, z: -0.29731724, w: -0.4238666} m_LocalPosition: {x: 4.746426, y: 4.7661033, z: 3.5221124} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &729525157 GameObject: @@ -221,12 +226,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 729525157} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &729525159 MonoBehaviour: @@ -268,12 +274,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 770230239} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &770230241 MonoBehaviour: @@ -332,6 +339,8 @@ MeshRenderer: m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -372,12 +381,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1188849071} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1507539452 GameObject: @@ -410,9 +420,17 @@ Camera: 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_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -446,12 +464,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1507539452} + serializedVersion: 2 m_LocalRotation: {x: 0.13052596, y: -0, z: -0, w: 0.99144495} m_LocalPosition: {x: 0, y: 4, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 15, y: 0, z: 0} --- !u!1 &1531290046 GameObject: @@ -489,12 +508,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1531290046} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -3.8, y: 4, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1572831520 GameObject: @@ -531,6 +551,8 @@ MeshRenderer: m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -571,13 +593,107 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1572831520} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: -0.5, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1733260601 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1733260603} + - component: {fileID: 1733260602} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1733260602 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1733260601} + m_Enabled: 1 + serializedVersion: 11 + m_Type: 1 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1733260603 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1733260601} + serializedVersion: 2 + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} --- !u!1 &1823135811 GameObject: m_ObjectHideFlags: 0 @@ -602,12 +718,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1823135811} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 1.25, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1823135813 MonoBehaviour: @@ -621,3 +738,16 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ea847705c4b54489bfd196ce0284b383, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1507539454} + - {fileID: 68777783} + - {fileID: 729525158} + - {fileID: 770230240} + - {fileID: 1531290048} + - {fileID: 1823135812} + - {fileID: 1572831524} + - {fileID: 1188849075} + - {fileID: 1733260603} diff --git a/Packages/manifest.json b/Packages/manifest.json index e328cd0..0715fcb 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,12 +1,12 @@ { "dependencies": { - "com.unity.ide.rider": "3.0.7", - "com.unity.test-framework": "1.1.29" + "com.unity.ide.rider": "3.0.27", + "com.unity.test-framework": "1.3.9" }, "scopedRegistries": [ { "name": "Unity Game Framework", - "url": "https://unitygameframework.jfrog.io/artifactory/api/npm/default", + "url": "https://api.upmhub.org/registries/unity-game-framework", "scopes": [ "com.ugf" ] diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index d6d9816..b0bd998 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -5,7 +5,7 @@ "depth": 1, "source": "registry", "dependencies": {}, - "url": "https://unitygameframework.jfrog.io/artifactory/api/npm/default" + "url": "https://api.upmhub.org/registries/unity-game-framework" }, "com.ugf.debugtools": { "version": "file:UGF.DebugTools", @@ -23,24 +23,24 @@ "depth": 1, "source": "registry", "dependencies": {}, - "url": "https://unitygameframework.jfrog.io/artifactory/api/npm/default" + "url": "https://api.upmhub.org/registries/unity-game-framework" }, "com.ugf.initialize": { "version": "2.6.0", "depth": 1, "source": "registry", "dependencies": {}, - "url": "https://unitygameframework.jfrog.io/artifactory/api/npm/default" + "url": "https://api.upmhub.org/registries/unity-game-framework" }, "com.unity.ext.nunit": { - "version": "1.0.6", + "version": "2.0.5", "depth": 1, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" }, "com.unity.ide.rider": { - "version": "3.0.7", + "version": "3.0.27", "depth": 0, "source": "registry", "dependencies": { @@ -49,11 +49,11 @@ "url": "https://packages.unity.com" }, "com.unity.test-framework": { - "version": "1.1.29", + "version": "1.3.9", "depth": 0, "source": "registry", "dependencies": { - "com.unity.ext.nunit": "1.0.6", + "com.unity.ext.nunit": "2.0.3", "com.unity.modules.imgui": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0" }, diff --git a/ProjectSettings/MemorySettings.asset b/ProjectSettings/MemorySettings.asset new file mode 100644 index 0000000..5b5face --- /dev/null +++ b/ProjectSettings/MemorySettings.asset @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!387306366 &1 +MemorySettings: + m_ObjectHideFlags: 0 + m_EditorMemorySettings: + m_MainAllocatorBlockSize: -1 + m_ThreadAllocatorBlockSize: -1 + m_MainGfxBlockSize: -1 + m_ThreadGfxBlockSize: -1 + m_CacheBlockSize: -1 + m_TypetreeBlockSize: -1 + m_ProfilerBlockSize: -1 + m_ProfilerEditorBlockSize: -1 + m_BucketAllocatorGranularity: -1 + m_BucketAllocatorBucketsCount: -1 + m_BucketAllocatorBlockSize: -1 + m_BucketAllocatorBlockCount: -1 + m_ProfilerBucketAllocatorGranularity: -1 + m_ProfilerBucketAllocatorBucketsCount: -1 + m_ProfilerBucketAllocatorBlockSize: -1 + m_ProfilerBucketAllocatorBlockCount: -1 + m_TempAllocatorSizeMain: -1 + m_JobTempAllocatorBlockSize: -1 + m_BackgroundJobTempAllocatorBlockSize: -1 + m_JobTempAllocatorReducedBlockSize: -1 + m_TempAllocatorSizeGIBakingWorker: -1 + m_TempAllocatorSizeNavMeshWorker: -1 + m_TempAllocatorSizeAudioWorker: -1 + m_TempAllocatorSizeCloudWorker: -1 + m_TempAllocatorSizeGfx: -1 + m_TempAllocatorSizeJobWorker: -1 + m_TempAllocatorSizeBackgroundWorker: -1 + m_TempAllocatorSizePreloadManager: -1 + m_PlatformMemorySettings: {} diff --git a/ProjectSettings/MultiplayerManager.asset b/ProjectSettings/MultiplayerManager.asset new file mode 100644 index 0000000..8073753 --- /dev/null +++ b/ProjectSettings/MultiplayerManager.asset @@ -0,0 +1,7 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!655991488 &1 +MultiplayerManager: + m_ObjectHideFlags: 0 + m_EnableMultiplayerRoles: 0 + m_ActiveMultiplayerRole: 0 diff --git a/ProjectSettings/PackageManagerSettings.asset b/ProjectSettings/PackageManagerSettings.asset index 7a73dfa..ebaa247 100644 --- a/ProjectSettings/PackageManagerSettings.asset +++ b/ProjectSettings/PackageManagerSettings.asset @@ -13,11 +13,12 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_EnablePreReleasePackages: 1 - m_EnablePackageDependencies: 1 m_AdvancedSettingsExpanded: 1 m_ScopedRegistriesSettingsExpanded: 1 m_SeeAllPackageVersions: 0 + m_DismissPreviewPackagesInUse: 0 oneTimeWarningShown: 1 + oneTimeDeprecatedPopUpShown: 0 m_Registries: - m_Id: main m_Name: @@ -25,29 +26,20 @@ MonoBehaviour: m_Scopes: [] m_IsDefault: 1 m_Capabilities: 7 - - m_Id: scoped:Unity Game Framework + m_ConfigSource: 0 + - m_Id: scoped:project:Unity Game Framework m_Name: Unity Game Framework - m_Url: https://unitygameframework.jfrog.io/artifactory/api/npm/default + m_Url: https://api.upmhub.org/registries/unity-game-framework m_Scopes: - com.ugf m_IsDefault: 0 m_Capabilities: 0 + m_ConfigSource: 4 m_UserSelectedRegistryName: Unity Game Framework m_UserAddingNewScopedRegistry: 0 m_RegistryInfoDraft: - m_ErrorMessage: - m_Original: - m_Id: scoped:Unity Game Framework - m_Name: Unity Game Framework - m_Url: https://unitygameframework.jfrog.io/artifactory/api/npm/default - m_Scopes: - - com.ugf - m_IsDefault: 0 - m_Capabilities: 0 m_Modified: 0 - m_Name: Unity Game Framework - m_Url: https://unitygameframework.jfrog.io/artifactory/api/npm/default - m_Scopes: - - com.ugf - m_SelectedScopeIndex: 0 + m_ErrorMessage: + m_UserModificationsInstanceId: -880 + m_OriginalInstanceId: -884 m_LoadAssets: 0 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 00fed85..dc4d525 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -3,7 +3,7 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 21 + serializedVersion: 27 productGUID: 7c19d94e2fdbc244e88c2c8640c81325 AndroidProfiler: 0 AndroidFilterTouchesWhenObscured: 0 @@ -48,14 +48,16 @@ PlayerSettings: defaultScreenHeightWeb: 600 m_StereoRenderingPath: 0 m_ActiveColorSpace: 0 + unsupportedMSAAFallback: 0 + m_SpriteBatchVertexThreshold: 300 m_MTRendering: 1 mipStripping: 0 numberOfMipsStripped: 0 + numberOfMipsStrippedPerMipmapLimitGroup: {} m_StackTraceTypes: 010000000100000001000000010000000100000001000000 iosShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1 iosUseCustomAppBackgroundBehavior: 0 - iosAllowHTTPDownload: 1 allowedAutorotateToPortrait: 1 allowedAutorotateToPortraitUpsideDown: 1 allowedAutorotateToLandscapeRight: 1 @@ -68,6 +70,14 @@ PlayerSettings: androidRenderOutsideSafeArea: 0 androidUseSwappy: 0 androidBlitType: 0 + androidResizableWindow: 0 + androidDefaultWindowWidth: 1920 + androidDefaultWindowHeight: 1080 + androidMinimumWindowWidth: 400 + androidMinimumWindowHeight: 300 + androidFullscreenMode: 1 + androidAutoRotationBehavior: 1 + androidApplicationEntry: 1 defaultIsNativeResolution: 1 macRetinaSupport: 1 runInBackground: 1 @@ -79,6 +89,7 @@ PlayerSettings: hideHomeButton: 0 submitAnalytics: 1 usePlayerLog: 1 + dedicatedServerOptimizations: 0 bakeCollisionMeshes: 0 forceSingleInstance: 0 useFlipModelSwapchain: 1 @@ -86,6 +97,7 @@ PlayerSettings: useMacAppStoreValidation: 0 macAppStoreCategory: public.app-category.games gpuSkinning: 1 + meshDeformation: 2 xboxPIXTextureCapture: 0 xboxEnableAvatar: 0 xboxEnableKinect: 0 @@ -113,20 +125,18 @@ PlayerSettings: switchNVNShaderPoolsGranularity: 33554432 switchNVNDefaultPoolsGranularity: 16777216 switchNVNOtherPoolsGranularity: 16777216 + switchGpuScratchPoolGranularity: 2097152 + switchAllowGpuScratchShrinking: 0 switchNVNMaxPublicTextureIDCount: 0 switchNVNMaxPublicSamplerIDCount: 0 - stadiaPresentMode: 0 - stadiaTargetFramerate: 0 + switchMaxWorkerMultiple: 8 + switchNVNGraphicsFirmwareMemory: 32 vulkanNumSwapchainBuffers: 3 vulkanEnableSetSRGBWrite: 0 vulkanEnablePreTransform: 0 vulkanEnableLateAcquireNextImage: 0 - m_SupportedAspectRatios: - 4:3: 1 - 5:4: 1 - 16:10: 1 - 16:9: 1 - Others: 1 + vulkanEnableCommandBufferRecycling: 1 + loadStoreDebugModeEnabled: 0 bundleVersion: 0.1 preloadedAssets: [] metroInputSource: 0 @@ -138,22 +148,27 @@ PlayerSettings: enable360StereoCapture: 0 isWsaHolographicRemotingEnabled: 0 enableFrameTimingStats: 0 + enableOpenGLProfilerGPURecorders: 1 + allowHDRDisplaySupport: 0 useHDRDisplay: 0 - D3DHDRBitDepth: 0 + hdrBitDepth: 0 m_ColorGamuts: 00000000 targetPixelDensity: 30 resolutionScalingMode: 0 + resetResolutionOnWindowResize: 0 androidSupportedAspectRatio: 1 androidMaxAspectRatio: 2.1 + androidMinAspectRatio: 1 applicationIdentifier: Standalone: com.DefaultCompany.unity-game-framework buildNumber: + Bratwurst: 0 Standalone: 0 iPhone: 0 tvOS: 0 overrideDefaultApplicationIdentifier: 0 AndroidBundleVersionCode: 1 - AndroidMinSdkVersion: 19 + AndroidMinSdkVersion: 23 AndroidTargetSdkVersion: 0 AndroidPreferredInstallLocation: 1 aotOptions: @@ -163,15 +178,18 @@ PlayerSettings: ForceInternetPermission: 0 ForceSDCardPermission: 0 CreateWallpaper: 0 - APKExpansionFiles: 0 + androidSplitApplicationBinary: 0 keepLoadedShadersAlive: 0 StripUnusedMeshComponents: 1 + strictShaderVariantMatching: 0 VertexChannelCompressionMask: 4054 iPhoneSdkVersion: 988 - iOSTargetOSVersionString: 11.0 + iOSTargetOSVersionString: 13.0 tvOSSdkVersion: 0 tvOSRequireExtendedGameController: 0 - tvOSTargetOSVersionString: 11.0 + tvOSTargetOSVersionString: 13.0 + bratwurstSdkVersion: 0 + bratwurstTargetOSVersionString: 13.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 @@ -209,20 +227,25 @@ PlayerSettings: iOSLaunchScreeniPadCustomStoryboardPath: iOSDeviceRequirements: [] iOSURLSchemes: [] + macOSURLSchemes: [] iOSBackgroundModes: 0 iOSMetalForceHardShadows: 0 metalEditorSupport: 1 metalAPIValidation: 1 iOSRenderExtraFrameOnPause: 0 + iosCopyPluginsCodeInsteadOfSymlink: 0 appleDeveloperTeamID: iOSManualSigningProvisioningProfileID: tvOSManualSigningProvisioningProfileID: + bratwurstManualSigningProvisioningProfileID: iOSManualSigningProvisioningProfileType: 0 tvOSManualSigningProvisioningProfileType: 0 + bratwurstManualSigningProvisioningProfileType: 0 appleEnableAutomaticSigning: 0 iOSRequireARKit: 0 iOSAutomaticallyDetectAndAddCapabilities: 1 appleEnableProMotion: 0 + shaderPrecisionModel: 0 clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea templatePackageId: com.unity.template.3d@1.0.11 templateDefaultScene: Assets/Scenes/SampleScene.unity @@ -232,12 +255,16 @@ PlayerSettings: useCustomLauncherGradleManifest: 0 useCustomBaseGradleTemplate: 0 useCustomGradlePropertiesTemplate: 0 + useCustomGradleSettingsTemplate: 0 useCustomProguardFile: 0 AndroidTargetArchitectures: 1 + AndroidTargetDevices: 0 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} AndroidKeystoreName: '{inproject}: ' AndroidKeyaliasName: + AndroidEnableArmv9SecurityFeatures: 0 + AndroidEnableArm64MTE: 0 AndroidBuildApkPerCpuArchitecture: 0 AndroidTVCompatibility: 0 AndroidIsGame: 1 @@ -250,13 +277,203 @@ PlayerSettings: height: 180 banner: {fileID: 0} androidGamepadSupportLevel: 0 - AndroidMinifyWithR8: 0 + chromeosInputEmulation: 1 AndroidMinifyRelease: 0 AndroidMinifyDebug: 0 AndroidValidateAppBundleSize: 1 AndroidAppBundleSizeToValidate: 150 + AndroidReportGooglePlayAppDependencies: 1 m_BuildTargetIcons: [] - m_BuildTargetPlatformIcons: [] + m_BuildTargetPlatformIcons: + - m_BuildTarget: iPhone + m_Icons: + - m_Textures: [] + m_Width: 180 + m_Height: 180 + m_Kind: 0 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 120 + m_Height: 120 + m_Kind: 0 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 167 + m_Height: 167 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 152 + m_Height: 152 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 76 + m_Height: 76 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 120 + m_Height: 120 + m_Kind: 3 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 80 + m_Height: 80 + m_Kind: 3 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 80 + m_Height: 80 + m_Kind: 3 + m_SubKind: iPad + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 3 + m_SubKind: iPad + - m_Textures: [] + m_Width: 87 + m_Height: 87 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 58 + m_Height: 58 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 29 + m_Height: 29 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 58 + m_Height: 58 + m_Kind: 1 + m_SubKind: iPad + - m_Textures: [] + m_Width: 29 + m_Height: 29 + m_Kind: 1 + m_SubKind: iPad + - m_Textures: [] + m_Width: 60 + m_Height: 60 + m_Kind: 2 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 2 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 2 + m_SubKind: iPad + - m_Textures: [] + m_Width: 20 + m_Height: 20 + m_Kind: 2 + m_SubKind: iPad + - m_Textures: [] + m_Width: 1024 + m_Height: 1024 + m_Kind: 4 + m_SubKind: App Store + - m_BuildTarget: Android + m_Icons: + - m_Textures: [] + m_Width: 432 + m_Height: 432 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 324 + m_Height: 324 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 216 + m_Height: 216 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 162 + m_Height: 162 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 108 + m_Height: 108 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 81 + m_Height: 81 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 0 + m_SubKind: m_BuildTargetBatching: - m_BuildTarget: Standalone m_StaticBatching: 1 @@ -273,6 +490,7 @@ PlayerSettings: - m_BuildTarget: WebGL m_StaticBatching: 0 m_DynamicBatching: 0 + m_BuildTargetShaderSettings: [] m_BuildTargetGraphicsJobs: - m_BuildTarget: MacStandaloneSupport m_GraphicsJobs: 0 @@ -308,7 +526,7 @@ PlayerSettings: m_BuildTargetGraphicsAPIs: - m_BuildTarget: AndroidPlayer m_APIs: 150000000b000000 - m_Automatic: 0 + m_Automatic: 1 - m_BuildTarget: iOSSupport m_APIs: 10000000 m_Automatic: 1 @@ -324,6 +542,8 @@ PlayerSettings: m_Devices: - Oculus - OpenVR + m_DefaultShaderChunkSizeInMB: 16 + m_DefaultShaderChunkCount: 0 openGLRequireES31: 0 openGLRequireES31AEP: 0 openGLRequireES32: 0 @@ -333,8 +553,11 @@ PlayerSettings: iPhone: 1 tvOS: 1 m_BuildTargetGroupLightmapEncodingQuality: [] + m_BuildTargetGroupHDRCubemapEncodingQuality: [] m_BuildTargetGroupLightmapSettings: [] + m_BuildTargetGroupLoadStoreDebugModeSettings: [] m_BuildTargetNormalMapEncoding: [] + m_BuildTargetDefaultTextureCompressionFormat: [] playModeTestRunnerEnabled: 0 runPlayModeTestAsEditModeTest: 0 actionOnDotNetUnhandledException: 1 @@ -344,6 +567,8 @@ PlayerSettings: cameraUsageDescription: locationUsageDescription: microphoneUsageDescription: + bluetoothUsageDescription: + macOSTargetOSVersion: 10.13.0 switchNMETAOverride: switchNetLibKey: switchSocketMemoryPoolSize: 6144 @@ -351,9 +576,11 @@ PlayerSettings: switchSocketConcurrencyLimit: 14 switchScreenResolutionBehavior: 2 switchUseCPUProfiler: 0 - switchUseGOLDLinker: 0 + switchEnableFileSystemTrace: 0 + switchLTOSetting: 0 switchApplicationID: 0x01004b9000490000 switchNSODependencies: + switchCompilerFlags: switchTitleNames_0: switchTitleNames_1: switchTitleNames_2: @@ -369,6 +596,7 @@ PlayerSettings: switchTitleNames_12: switchTitleNames_13: switchTitleNames_14: + switchTitleNames_15: switchPublisherNames_0: switchPublisherNames_1: switchPublisherNames_2: @@ -384,6 +612,7 @@ PlayerSettings: switchPublisherNames_12: switchPublisherNames_13: switchPublisherNames_14: + switchPublisherNames_15: switchIcons_0: {fileID: 0} switchIcons_1: {fileID: 0} switchIcons_2: {fileID: 0} @@ -399,6 +628,7 @@ PlayerSettings: switchIcons_12: {fileID: 0} switchIcons_13: {fileID: 0} switchIcons_14: {fileID: 0} + switchIcons_15: {fileID: 0} switchSmallIcons_0: {fileID: 0} switchSmallIcons_1: {fileID: 0} switchSmallIcons_2: {fileID: 0} @@ -414,6 +644,7 @@ PlayerSettings: switchSmallIcons_12: {fileID: 0} switchSmallIcons_13: {fileID: 0} switchSmallIcons_14: {fileID: 0} + switchSmallIcons_15: {fileID: 0} switchManualHTML: switchAccessibleURLs: switchLegalInformation: @@ -423,7 +654,6 @@ PlayerSettings: switchReleaseVersion: 0 switchDisplayVersion: 1.0.0 switchStartupUserAccount: 0 - switchTouchScreenUsage: 0 switchSupportedLanguagesMask: 0 switchLogoType: 0 switchApplicationErrorCodeCategory: @@ -465,6 +695,7 @@ PlayerSettings: switchNativeFsCacheSize: 32 switchIsHoldTypeHorizontal: 0 switchSupportedNpadCount: 8 + switchEnableTouchScreen: 1 switchSocketConfigEnabled: 0 switchTcpInitialSendBufferSize: 32 switchTcpInitialReceiveBufferSize: 64 @@ -475,8 +706,13 @@ PlayerSettings: switchSocketBufferEfficiency: 4 switchSocketInitializeEnabled: 1 switchNetworkInterfaceManagerInitializeEnabled: 1 - switchPlayerConnectionEnabled: 1 + switchDisableHTCSPlayerConnection: 0 switchUseNewStyleFilepaths: 0 + switchUseLegacyFmodPriorities: 0 + switchUseMicroSleepForYield: 1 + switchEnableRamDiskSupport: 0 + switchMicroSleepForYieldTime: 25 + switchRamDiskSpaceSize: 12 ps4NPAgeRating: 12 ps4NPTitleSecret: ps4NPTrophyPackPath: @@ -547,6 +783,7 @@ PlayerSettings: ps4videoRecordingFeaturesUsed: 0 ps4contentSearchFeaturesUsed: 0 ps4CompatibilityPS5: 0 + ps4AllowPS5Detection: 0 ps4GPU800MHz: 1 ps4attribEyeToEyeDistanceSettingVR: 0 ps4IncludedModules: [] @@ -559,6 +796,7 @@ PlayerSettings: webGLMemorySize: 16 webGLExceptionSupport: 1 webGLNameFilesAsHashes: 0 + webGLShowDiagnostics: 0 webGLDataCaching: 1 webGLDebugSymbols: 0 webGLEmscriptenArgs: @@ -571,23 +809,53 @@ PlayerSettings: webGLLinkerTarget: 1 webGLThreadsSupport: 0 webGLDecompressionFallback: 0 + webGLInitialMemorySize: 32 + webGLMaximumMemorySize: 2048 + webGLMemoryGrowthMode: 2 + webGLMemoryLinearGrowthStep: 16 + webGLMemoryGeometricGrowthStep: 0.2 + webGLMemoryGeometricGrowthCap: 96 + webGLEnableWebGPU: 0 + webGLPowerPreference: 2 + webGLWebAssemblyTable: 0 + webGLWebAssemblyBigInt: 0 + webGLCloseOnQuit: 0 scriptingDefineSymbols: - 1: + Standalone: + additionalCompilerArguments: {} platformArchitecture: {} scriptingBackend: + Android: 0 Standalone: 1 il2cppCompilerConfiguration: {} - managedStrippingLevel: {} + il2cppCodeGeneration: {} + il2cppStacktraceInformation: {} + managedStrippingLevel: + Android: 1 + Bratwurst: 1 + EmbeddedLinux: 1 + GameCoreScarlett: 1 + GameCoreXboxOne: 1 + Nintendo Switch: 1 + PS4: 1 + PS5: 1 + QNX: 1 + Standalone: 1 + WebGL: 1 + Windows Store Apps: 1 + XboxOne: 1 + iPhone: 1 + tvOS: 1 incrementalIl2cppBuild: {} + suppressCommonWarnings: 1 allowUnsafeCode: 0 useDeterministicCompilation: 1 - useReferenceAssemblies: 1 - enableRoslynAnalyzers: 1 additionalIl2CppArgs: scriptingRuntimeVersion: 1 gcIncremental: 0 gcWBarrierValidation: 0 apiCompatibilityLevelPerPlatform: {} + editorAssembliesCompatibilityLevel: 1 m_RenderingPath: 1 m_MobileRenderingPath: 1 metroPackageName: Template_3D @@ -616,6 +884,7 @@ PlayerSettings: metroFTAName: metroFTAFileTypes: [] metroProtocolName: + vcxProjDefaultLanguage: XboxOneProductId: XboxOneUpdateKey: XboxOneSandboxId: @@ -634,6 +903,7 @@ PlayerSettings: XboxOneCapability: [] XboxOneGameRating: {} XboxOneIsContentPackage: 0 + XboxOneEnhancedXboxCompatibilityMode: 0 XboxOneEnableGPUVariability: 0 XboxOneSockets: {} XboxOneSplashScreen: {fileID: 0} @@ -656,8 +926,16 @@ PlayerSettings: luminVersion: m_VersionCode: 1 m_VersionName: + hmiPlayerDataPath: + hmiForceSRGBBlit: 0 + embeddedLinuxEnableGamepadInput: 0 + hmiCpuConfiguration: + hmiLogStartupTiming: 0 + qnxGraphicConfPath: apiCompatibilityLevel: 6 + captureStartupLogs: {} activeInputHandler: 0 + windowsGamepadBackendHint: 0 cloudProjectId: framebufferDepthMemorylessMode: 0 qualitySettingsNames: [] @@ -665,4 +943,7 @@ PlayerSettings: organizationId: cloudEnabled: 0 legacyClampBlendShapeWeights: 1 + hmiLoadingImage: {fileID: 0} + platformRequiresReadableAssets: 0 virtualTexturingSupportEnabled: 0 + insecureHttpOption: 0 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index ea174da..0eb2c62 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2021.1.19f1 -m_EditorVersionWithRevision: 2021.1.19f1 (5f5eb8bbdc25) +m_EditorVersion: 2023.2.9f1 +m_EditorVersionWithRevision: 2023.2.9f1 (0c9c2e1f4bef) From 9d64eae395306d7fafc78a564f824aff562a2951 Mon Sep 17 00:00:00 2001 From: Vorobey Date: Mon, 12 Feb 2024 21:56:44 +0300 Subject: [PATCH 02/15] Update package.json --- Packages/UGF.DebugTools/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/UGF.DebugTools/package.json b/Packages/UGF.DebugTools/package.json index de1ca76..47806e3 100644 --- a/Packages/UGF.DebugTools/package.json +++ b/Packages/UGF.DebugTools/package.json @@ -2,7 +2,7 @@ "name": "com.ugf.debugtools", "displayName": "UGF.DebugTools", "version": "1.0.0-preview.4", - "unity": "2021.1", + "unity": "2023.2", "apiCompatibility": ".NET Standard 2.0", "description": "Provides tools for working with debug information.", "author": { @@ -16,7 +16,7 @@ "changelogUrl": "https://github.com/unity-game-framework/ugf-debugtools/blob/main/changelog.md", "licensesUrl": "https://github.com/unity-game-framework/ugf-debugtools/blob/main/license", "publishConfig": { - "registry": "https://unitygameframework.jfrog.io/artifactory/api/npm/default" + "registry": "https://api.upmhub.org/registries/unity-game-framework" }, "dependencies": { "com.ugf.editortools": "1.13.1", From 5efccb39a425b89162cd09b59fe12d64c6fb63cf Mon Sep 17 00:00:00 2001 From: Vorobey Date: Mon, 12 Feb 2024 21:57:43 +0300 Subject: [PATCH 03/15] Update dependencies --- Packages/UGF.DebugTools/package.json | 6 +++--- Packages/packages-lock.json | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Packages/UGF.DebugTools/package.json b/Packages/UGF.DebugTools/package.json index 47806e3..b823a34 100644 --- a/Packages/UGF.DebugTools/package.json +++ b/Packages/UGF.DebugTools/package.json @@ -19,9 +19,9 @@ "registry": "https://api.upmhub.org/registries/unity-game-framework" }, "dependencies": { - "com.ugf.editortools": "1.13.1", - "com.ugf.builder": "2.0.1", - "com.ugf.initialize": "2.6.0", + "com.ugf.editortools": "3.0.0-preview.2", + "com.ugf.builder": "2.0.2", + "com.ugf.initialize": "2.9.0", "com.unity.modules.imgui": "1.0.0" } } \ No newline at end of file diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index b0bd998..1a09692 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -1,7 +1,7 @@ { "dependencies": { "com.ugf.builder": { - "version": "2.0.1", + "version": "2.0.2", "depth": 1, "source": "registry", "dependencies": {}, @@ -12,21 +12,21 @@ "depth": 0, "source": "embedded", "dependencies": { - "com.ugf.editortools": "1.13.1", - "com.ugf.builder": "2.0.1", - "com.ugf.initialize": "2.6.0", + "com.ugf.editortools": "3.0.0-preview.2", + "com.ugf.builder": "2.0.2", + "com.ugf.initialize": "2.9.0", "com.unity.modules.imgui": "1.0.0" } }, "com.ugf.editortools": { - "version": "1.13.1", + "version": "3.0.0-preview.2", "depth": 1, "source": "registry", "dependencies": {}, "url": "https://api.upmhub.org/registries/unity-game-framework" }, "com.ugf.initialize": { - "version": "2.6.0", + "version": "2.9.0", "depth": 1, "source": "registry", "dependencies": {}, From 351ef8a7ea0939df284d9f814376e8fbafbaad16 Mon Sep 17 00:00:00 2001 From: Vorobey Date: Tue, 13 Feb 2024 15:39:15 +0300 Subject: [PATCH 04/15] Change dependencies --- Packages/UGF.DebugTools/package.json | 1 + Packages/packages-lock.json | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Packages/UGF.DebugTools/package.json b/Packages/UGF.DebugTools/package.json index b823a34..27d9a08 100644 --- a/Packages/UGF.DebugTools/package.json +++ b/Packages/UGF.DebugTools/package.json @@ -22,6 +22,7 @@ "com.ugf.editortools": "3.0.0-preview.2", "com.ugf.builder": "2.0.2", "com.ugf.initialize": "2.9.0", + "com.ugf.runtimetools": "3.0.0-preview.7", "com.unity.modules.imgui": "1.0.0" } } \ No newline at end of file diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 1a09692..2f79d47 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -7,6 +7,16 @@ "dependencies": {}, "url": "https://api.upmhub.org/registries/unity-game-framework" }, + "com.ugf.customsettings": { + "version": "3.4.1", + "depth": 2, + "source": "registry", + "dependencies": { + "com.ugf.editortools": "1.7.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://api.upmhub.org/registries/unity-game-framework" + }, "com.ugf.debugtools": { "version": "file:UGF.DebugTools", "depth": 0, @@ -15,6 +25,7 @@ "com.ugf.editortools": "3.0.0-preview.2", "com.ugf.builder": "2.0.2", "com.ugf.initialize": "2.9.0", + "com.ugf.runtimetools": "3.0.0-preview.7", "com.unity.modules.imgui": "1.0.0" } }, @@ -32,6 +43,16 @@ "dependencies": {}, "url": "https://api.upmhub.org/registries/unity-game-framework" }, + "com.ugf.runtimetools": { + "version": "3.0.0-preview.7", + "depth": 1, + "source": "registry", + "dependencies": { + "com.ugf.editortools": "3.0.0-preview.2", + "com.ugf.customsettings": "3.4.1" + }, + "url": "https://api.upmhub.org/registries/unity-game-framework" + }, "com.unity.ext.nunit": { "version": "2.0.5", "depth": 1, From 0c39c2e48ec6d18b813b18c19c74a97410c14851 Mon Sep 17 00:00:00 2001 From: Vorobey Date: Tue, 13 Feb 2024 15:39:29 +0300 Subject: [PATCH 05/15] Add refactoring --- .../TestDebugUIDrawerComponent.cs | 2 +- .../Editor/DebugGLComponentEditor.cs.meta | 3 - ...ditor.cs => DebugGLProviderAssetEditor.cs} | 24 ++- .../Editor/DebugGLProviderAssetEditor.cs.meta | 3 + .../Editor/DebugUIComponentEditor.cs.meta | 3 - ...ditor.cs => DebugUIProviderAssetEditor.cs} | 24 ++- .../Editor/DebugUIProviderAssetEditor.cs.meta | 3 + .../DebugUIFunctionDrawerAssetEditor.cs | 11 ++ .../DebugUISectionSkinsAssetEditor.cs | 3 +- .../DebugUISectionDrawerAssetEditor.cs | 17 +- .../UGF.DebugTools/Runtime/DebugGL.Shapes.cs | 24 +-- Packages/UGF.DebugTools/Runtime/DebugGL.cs | 14 +- .../Runtime/DebugGLComponent.cs | 73 +++----- .../Runtime/DebugGLDrawCommand.cs | 21 +-- .../{DebugGLDrawer.cs => DebugGLProvider.cs} | 54 +----- ...Drawer.cs.meta => DebugGLProvider.cs.meta} | 0 .../Runtime/DebugGLProviderAsset.cs | 51 ++++++ .../Runtime/DebugGLProviderAsset.cs.meta | 3 + .../UGF.DebugTools/Runtime/DebugGLShape.cs | 3 +- .../Runtime/DebugUI.Elements.cs | 2 + .../Runtime/DebugUI.Functions.cs | 8 +- .../UGF.DebugTools/Runtime/DebugUI.Menu.cs | 7 +- .../UGF.DebugTools/Runtime/DebugUI.Panel.cs | 14 +- Packages/UGF.DebugTools/Runtime/DebugUI.cs | 14 +- .../Runtime/DebugUIComponent.cs | 54 ++---- .../UGF.DebugTools/Runtime/DebugUIDrawer.cs | 169 +----------------- .../Runtime/DebugUIDrawer.cs.meta | 4 +- .../Runtime/DebugUIDrawerAsset.cs | 2 +- .../Runtime/DebugUIDrawerBase.cs | 14 -- .../Runtime/DebugUIDrawerBase.cs.meta | 3 - .../UGF.DebugTools/Runtime/DebugUIProvider.cs | 86 +++++++++ .../Runtime/DebugUIProvider.cs.meta | 3 + .../Runtime/DebugUIProviderAsset.cs | 44 +++++ .../Runtime/DebugUIProviderAsset.cs.meta | 3 + .../Runtime/DebugUIWindowDrawer.cs | 4 +- .../Runtime/GL.Scopes/DebugGLDrawScope.cs | 2 +- .../Runtime/GL.Scopes/DebugGLMatrixScope.cs | 2 +- .../GL.Sections/DebugGLOptionsSection.cs | 2 +- .../UGF.DebugTools/Runtime/IDebugUIDrawer.cs | 9 - .../Runtime/IDebugUIDrawer.cs.meta | 3 - .../Runtime/UGF.DebugTools.Runtime.asmdef | 3 +- .../UI.Functions/DebugUIFunctionDrawer.cs | 18 +- .../DebugUIFunctionDrawerAsset.cs | 2 +- .../UI.Functions/DebugUIFunctionHandler.cs | 2 +- .../Runtime/UI.Menu/DebugUIMenu.cs | 36 +--- .../Runtime/UI.Menu/DebugUIMenuExtensions.cs | 6 +- .../UI.Menu/DebugUIMenuItemDisabled.cs | 2 +- .../Runtime/UI.Panels/DebugUIPanelDrawer.cs | 46 ++--- .../UI.Panels/DebugUIPanelDrawerAsset.cs | 2 +- .../Runtime/UI.Scopes/DebugUICenterScope.cs | 2 +- .../Runtime/UI.Scopes/DebugUIGroupScope.cs | 2 +- .../UI.Scopes/DebugUIHorizontalScope.cs | 2 +- .../UI.Scopes/DebugUILayoutAreaScope.cs | 2 +- .../UI.Scopes/DebugUIScrollViewScope.cs | 4 +- .../Runtime/UI.Scopes/DebugUIVerticalScope.cs | 2 +- .../UI.Sections.Skins/DebugUISectionSkins.cs | 2 +- .../UI.Sections/DebugUISectionDrawer.cs | 72 +++----- .../UI.Sections/DebugUISectionDrawerAsset.cs | 13 +- .../UI.Sections/DebugUISectionOptions.cs | 2 +- 59 files changed, 440 insertions(+), 565 deletions(-) delete mode 100644 Packages/UGF.DebugTools/Editor/DebugGLComponentEditor.cs.meta rename Packages/UGF.DebugTools/Editor/{DebugGLComponentEditor.cs => DebugGLProviderAssetEditor.cs} (58%) create mode 100644 Packages/UGF.DebugTools/Editor/DebugGLProviderAssetEditor.cs.meta delete mode 100644 Packages/UGF.DebugTools/Editor/DebugUIComponentEditor.cs.meta rename Packages/UGF.DebugTools/Editor/{DebugUIComponentEditor.cs => DebugUIProviderAssetEditor.cs} (56%) create mode 100644 Packages/UGF.DebugTools/Editor/DebugUIProviderAssetEditor.cs.meta rename Packages/UGF.DebugTools/Runtime/{DebugGLDrawer.cs => DebugGLProvider.cs} (57%) rename Packages/UGF.DebugTools/Runtime/{DebugGLDrawer.cs.meta => DebugGLProvider.cs.meta} (100%) create mode 100644 Packages/UGF.DebugTools/Runtime/DebugGLProviderAsset.cs create mode 100644 Packages/UGF.DebugTools/Runtime/DebugGLProviderAsset.cs.meta delete mode 100644 Packages/UGF.DebugTools/Runtime/DebugUIDrawerBase.cs delete mode 100644 Packages/UGF.DebugTools/Runtime/DebugUIDrawerBase.cs.meta create mode 100644 Packages/UGF.DebugTools/Runtime/DebugUIProvider.cs create mode 100644 Packages/UGF.DebugTools/Runtime/DebugUIProvider.cs.meta create mode 100644 Packages/UGF.DebugTools/Runtime/DebugUIProviderAsset.cs create mode 100644 Packages/UGF.DebugTools/Runtime/DebugUIProviderAsset.cs.meta delete mode 100644 Packages/UGF.DebugTools/Runtime/IDebugUIDrawer.cs delete mode 100644 Packages/UGF.DebugTools/Runtime/IDebugUIDrawer.cs.meta diff --git a/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIDrawerComponent.cs b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIDrawerComponent.cs index e3758c2..cfaef56 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIDrawerComponent.cs +++ b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIDrawerComponent.cs @@ -143,7 +143,7 @@ private void OnMenuSelect(DebugUIMenuItem item) private void Start() { - DebugUI.PanelAdd().BindTransform(transform); + DebugUI.AddPanel().BindTransform(transform); } } } diff --git a/Packages/UGF.DebugTools/Editor/DebugGLComponentEditor.cs.meta b/Packages/UGF.DebugTools/Editor/DebugGLComponentEditor.cs.meta deleted file mode 100644 index 263fc30..0000000 --- a/Packages/UGF.DebugTools/Editor/DebugGLComponentEditor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: bbb29d8d797c460885e3d65248c151e9 -timeCreated: 1632321521 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Editor/DebugGLComponentEditor.cs b/Packages/UGF.DebugTools/Editor/DebugGLProviderAssetEditor.cs similarity index 58% rename from Packages/UGF.DebugTools/Editor/DebugGLComponentEditor.cs rename to Packages/UGF.DebugTools/Editor/DebugGLProviderAssetEditor.cs index fb67132..bdd3c5d 100644 --- a/Packages/UGF.DebugTools/Editor/DebugGLComponentEditor.cs +++ b/Packages/UGF.DebugTools/Editor/DebugGLProviderAssetEditor.cs @@ -1,41 +1,55 @@ using UGF.DebugTools.Runtime; -using UGF.EditorTools.Editor.IMGUI.AssetReferences; +using UGF.EditorTools.Editor.Assets; +using UGF.EditorTools.Editor.IMGUI; using UGF.EditorTools.Editor.IMGUI.Scopes; using UnityEditor; namespace UGF.DebugTools.Editor { - [CustomEditor(typeof(DebugGLComponent), true)] - internal class DebugGLComponentEditor : UnityEditor.Editor + [CustomEditor(typeof(DebugGLProviderAsset), true)] + internal class DebugGLProviderAssetEditor : UnityEditor.Editor { private SerializedProperty m_propertyEnable; private SerializedProperty m_propertyDefaultShapes; private SerializedProperty m_propertyDefaultMaterial; - private AssetReferenceListDrawer m_listShapes; + private AssetIdReferenceListDrawer m_listShapes; + private ReorderableListSelectionDrawerByPath m_listShapesSelection; private void OnEnable() { m_propertyEnable = serializedObject.FindProperty("m_enable"); m_propertyDefaultShapes = serializedObject.FindProperty("m_defaultShapes"); m_propertyDefaultMaterial = serializedObject.FindProperty("m_defaultMaterial"); - m_listShapes = new AssetReferenceListDrawer(serializedObject.FindProperty("m_shapes")); + + m_listShapes = new AssetIdReferenceListDrawer(serializedObject.FindProperty("m_shapes")); + + m_listShapesSelection = new ReorderableListSelectionDrawerByPath(m_listShapes, "m_asset") + { + Drawer = { DisplayTitlebar = true } + }; + m_listShapes.Enable(); + m_listShapesSelection.Enable(); } private void OnDisable() { m_listShapes.Disable(); + m_listShapesSelection.Disable(); } public override void OnInspectorGUI() { using (new SerializedObjectUpdateScope(serializedObject)) { + EditorIMGUIUtility.DrawScriptProperty(serializedObject); + EditorGUILayout.PropertyField(m_propertyEnable); EditorGUILayout.PropertyField(m_propertyDefaultShapes); EditorGUILayout.PropertyField(m_propertyDefaultMaterial); m_listShapes.DrawGUILayout(); + m_listShapesSelection.DrawGUILayout(); } } } diff --git a/Packages/UGF.DebugTools/Editor/DebugGLProviderAssetEditor.cs.meta b/Packages/UGF.DebugTools/Editor/DebugGLProviderAssetEditor.cs.meta new file mode 100644 index 0000000..7c76eba --- /dev/null +++ b/Packages/UGF.DebugTools/Editor/DebugGLProviderAssetEditor.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c8c65479ffa54086a22fac1753c5ae40 +timeCreated: 1707827602 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Editor/DebugUIComponentEditor.cs.meta b/Packages/UGF.DebugTools/Editor/DebugUIComponentEditor.cs.meta deleted file mode 100644 index 0bb8b62..0000000 --- a/Packages/UGF.DebugTools/Editor/DebugUIComponentEditor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: a2c219fe0a1f454fab3800d731c3ae31 -timeCreated: 1632321567 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Editor/DebugUIComponentEditor.cs b/Packages/UGF.DebugTools/Editor/DebugUIProviderAssetEditor.cs similarity index 56% rename from Packages/UGF.DebugTools/Editor/DebugUIComponentEditor.cs rename to Packages/UGF.DebugTools/Editor/DebugUIProviderAssetEditor.cs index f8fe462..f7a380c 100644 --- a/Packages/UGF.DebugTools/Editor/DebugUIComponentEditor.cs +++ b/Packages/UGF.DebugTools/Editor/DebugUIProviderAssetEditor.cs @@ -1,41 +1,55 @@ using UGF.DebugTools.Runtime; -using UGF.EditorTools.Editor.IMGUI.AssetReferences; +using UGF.EditorTools.Editor.Assets; +using UGF.EditorTools.Editor.IMGUI; using UGF.EditorTools.Editor.IMGUI.Scopes; using UnityEditor; namespace UGF.DebugTools.Editor { - [CustomEditor(typeof(DebugUIComponent), true)] - internal class DebugUIComponentEditor : UnityEditor.Editor + [CustomEditor(typeof(DebugUIProviderAsset), true)] + internal class DebugUIProviderAssetEditor : UnityEditor.Editor { private SerializedProperty m_propertyEnable; private SerializedProperty m_propertyScale; private SerializedProperty m_propertySkin; - private AssetReferenceListDrawer m_listDrawers; + private AssetIdReferenceListDrawer m_listDrawers; + private ReorderableListSelectionDrawerByPath m_listDrawersSelection; private void OnEnable() { m_propertyEnable = serializedObject.FindProperty("m_enable"); m_propertyScale = serializedObject.FindProperty("m_scale"); m_propertySkin = serializedObject.FindProperty("m_skin"); - m_listDrawers = new AssetReferenceListDrawer(serializedObject.FindProperty("m_drawers")); + + m_listDrawers = new AssetIdReferenceListDrawer(serializedObject.FindProperty("m_drawers")); + + m_listDrawersSelection = new ReorderableListSelectionDrawerByPath(m_listDrawers, "m_asset") + { + Drawer = { DisplayTitlebar = true } + }; + m_listDrawers.Enable(); + m_listDrawersSelection.Enable(); } private void OnDisable() { m_listDrawers.Disable(); + m_listDrawersSelection.Disable(); } public override void OnInspectorGUI() { using (new SerializedObjectUpdateScope(serializedObject)) { + EditorIMGUIUtility.DrawScriptProperty(serializedObject); + EditorGUILayout.PropertyField(m_propertyEnable); EditorGUILayout.PropertyField(m_propertyScale); EditorGUILayout.PropertyField(m_propertySkin); m_listDrawers.DrawGUILayout(); + m_listDrawersSelection.DrawGUILayout(); } } } diff --git a/Packages/UGF.DebugTools/Editor/DebugUIProviderAssetEditor.cs.meta b/Packages/UGF.DebugTools/Editor/DebugUIProviderAssetEditor.cs.meta new file mode 100644 index 0000000..41343e6 --- /dev/null +++ b/Packages/UGF.DebugTools/Editor/DebugUIProviderAssetEditor.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bcd0a489535c4788b3d30188b61bb2d8 +timeCreated: 1707827390 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Editor/UI.Functions/DebugUIFunctionDrawerAssetEditor.cs b/Packages/UGF.DebugTools/Editor/UI.Functions/DebugUIFunctionDrawerAssetEditor.cs index bfcde98..ee1410a 100644 --- a/Packages/UGF.DebugTools/Editor/UI.Functions/DebugUIFunctionDrawerAssetEditor.cs +++ b/Packages/UGF.DebugTools/Editor/UI.Functions/DebugUIFunctionDrawerAssetEditor.cs @@ -11,18 +11,28 @@ internal class DebugUIFunctionDrawerAssetEditor : UnityEditor.Editor private SerializedProperty m_propertyDisplay; private SerializedProperty m_propertyWidth; private ReorderableListDrawer m_listFunctions; + private ReorderableListSelectionDrawerByElement m_listFunctionsSelection; private void OnEnable() { m_propertyDisplay = serializedObject.FindProperty("m_display"); m_propertyWidth = serializedObject.FindProperty("m_width"); + m_listFunctions = new ReorderableListDrawer(serializedObject.FindProperty("m_functions")); + + m_listFunctionsSelection = new ReorderableListSelectionDrawerByElement(m_listFunctions) + { + Drawer = { DisplayTitlebar = true } + }; + m_listFunctions.Enable(); + m_listFunctionsSelection.Enable(); } private void OnDisable() { m_listFunctions.Disable(); + m_listFunctionsSelection.Disable(); } public override void OnInspectorGUI() @@ -35,6 +45,7 @@ public override void OnInspectorGUI() EditorGUILayout.PropertyField(m_propertyWidth); m_listFunctions.DrawGUILayout(); + m_listFunctionsSelection.DrawGUILayout(); } } } diff --git a/Packages/UGF.DebugTools/Editor/UI.Sections.Skins/DebugUISectionSkinsAssetEditor.cs b/Packages/UGF.DebugTools/Editor/UI.Sections.Skins/DebugUISectionSkinsAssetEditor.cs index 6829a2f..09fbb29 100644 --- a/Packages/UGF.DebugTools/Editor/UI.Sections.Skins/DebugUISectionSkinsAssetEditor.cs +++ b/Packages/UGF.DebugTools/Editor/UI.Sections.Skins/DebugUISectionSkinsAssetEditor.cs @@ -1,5 +1,4 @@ -using System; -using UGF.DebugTools.Runtime.UI.Sections.Skins; +using UGF.DebugTools.Runtime.UI.Sections.Skins; using UGF.EditorTools.Editor.IMGUI; using UGF.EditorTools.Editor.IMGUI.Scopes; using UnityEditor; diff --git a/Packages/UGF.DebugTools/Editor/UI.Sections/DebugUISectionDrawerAssetEditor.cs b/Packages/UGF.DebugTools/Editor/UI.Sections/DebugUISectionDrawerAssetEditor.cs index 97efc7b..5559e57 100644 --- a/Packages/UGF.DebugTools/Editor/UI.Sections/DebugUISectionDrawerAssetEditor.cs +++ b/Packages/UGF.DebugTools/Editor/UI.Sections/DebugUISectionDrawerAssetEditor.cs @@ -1,6 +1,6 @@ using UGF.DebugTools.Runtime.UI.Sections; +using UGF.EditorTools.Editor.Assets; using UGF.EditorTools.Editor.IMGUI; -using UGF.EditorTools.Editor.IMGUI.AssetReferences; using UGF.EditorTools.Editor.IMGUI.Scopes; using UnityEditor; @@ -12,20 +12,30 @@ internal class DebugUISectionDrawerAssetEditor : UnityEditor.Editor private SerializedProperty m_propertyWidth; private SerializedProperty m_propertyHeight; private SerializedProperty m_propertyAlignment; - private AssetReferenceListDrawer m_listSections; + private AssetIdReferenceListDrawer m_listSections; + private ReorderableListSelectionDrawerByPath m_listSectionsSelection; private void OnEnable() { m_propertyWidth = serializedObject.FindProperty("m_width"); m_propertyHeight = serializedObject.FindProperty("m_height"); m_propertyAlignment = serializedObject.FindProperty("m_alignment"); - m_listSections = new AssetReferenceListDrawer(serializedObject.FindProperty("m_sections")); + + m_listSections = new AssetIdReferenceListDrawer(serializedObject.FindProperty("m_sections")); + + m_listSectionsSelection = new ReorderableListSelectionDrawerByPath(m_listSections, "m_asset") + { + Drawer = { DisplayTitlebar = true } + }; + m_listSections.Enable(); + m_listSectionsSelection.Enable(); } private void OnDisable() { m_listSections.Disable(); + m_listSectionsSelection.Disable(); } public override void OnInspectorGUI() @@ -39,6 +49,7 @@ public override void OnInspectorGUI() EditorGUILayout.PropertyField(m_propertyAlignment); m_listSections.DrawGUILayout(); + m_listSectionsSelection.DrawGUILayout(); } } } diff --git a/Packages/UGF.DebugTools/Runtime/DebugGL.Shapes.cs b/Packages/UGF.DebugTools/Runtime/DebugGL.Shapes.cs index 15d2e46..c50b114 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugGL.Shapes.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugGL.Shapes.cs @@ -1,17 +1,17 @@ -using System; +using UGF.EditorTools.Runtime.Ids; using UnityEngine; namespace UGF.DebugTools.Runtime { public static partial class DebugGL { - public static string ShapeLineWireId { get; } = Guid.NewGuid().ToString("N"); - public static string ShapeTriangleWireId { get; } = Guid.NewGuid().ToString("N"); - public static string ShapeQuadWireId { get; } = Guid.NewGuid().ToString("N"); - public static string ShapeCircleWireId { get; } = Guid.NewGuid().ToString("N"); - public static string ShapeCubeWireId { get; } = Guid.NewGuid().ToString("N"); - public static string ShapeSphereWireId { get; } = Guid.NewGuid().ToString("N"); - public static string ShapeCylinderWireId { get; } = Guid.NewGuid().ToString("N"); + public static GlobalId ShapeLineWireId { get; } = GlobalId.Generate(); + public static GlobalId ShapeTriangleWireId { get; } = GlobalId.Generate(); + public static GlobalId ShapeQuadWireId { get; } = GlobalId.Generate(); + public static GlobalId ShapeCircleWireId { get; } = GlobalId.Generate(); + public static GlobalId ShapeCubeWireId { get; } = GlobalId.Generate(); + public static GlobalId ShapeSphereWireId { get; } = GlobalId.Generate(); + public static GlobalId ShapeCylinderWireId { get; } = GlobalId.Generate(); public static void Line(Vector3 start, Vector3 end, Color color) { @@ -52,14 +52,14 @@ public static void CylinderWire(Vector3 position, Quaternion rotation, Vector3 s Shape(ShapeCylinderWireId, position, rotation, scale, color); } - public static void Shape(string id, Vector3 position, Quaternion rotation, Vector3 scale, Color color) + public static void Shape(GlobalId id, Vector3 position, Quaternion rotation, Vector3 scale, Color color) { - Shape(id, position, rotation, scale, color, Drawer.DefaultMaterial); + Shape(id, position, rotation, scale, color, Provider.DefaultMaterial); } - public static void Shape(string id, Vector3 position, Quaternion rotation, Vector3 scale, Color color, Material material) + public static void Shape(GlobalId id, Vector3 position, Quaternion rotation, Vector3 scale, Color color, Material material) { - Drawer.AddCommand(new DebugGLDrawCommand(id, position, rotation, scale, color, material)); + Provider.Commands.Add(new DebugGLDrawCommand(id, position, rotation, scale, color, material)); } } } diff --git a/Packages/UGF.DebugTools/Runtime/DebugGL.cs b/Packages/UGF.DebugTools/Runtime/DebugGL.cs index c4cfcb8..4cdfc39 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugGL.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugGL.cs @@ -4,19 +4,19 @@ namespace UGF.DebugTools.Runtime { public static partial class DebugGL { - public static DebugGLDrawer Drawer { get { return m_drawer ?? throw new ArgumentException("Value not specified."); } } - public static bool HasDrawer { get { return m_drawer != null; } } + public static DebugGLProvider Provider { get { return m_provider ?? throw new ArgumentException("Value not specified."); } } + public static bool HasProvider { get { return m_provider != null; } } - private static DebugGLDrawer m_drawer; + private static DebugGLProvider m_provider; - public static void DrawerSet(DebugGLDrawer drawer) + public static void SetProvider(DebugGLProvider provider) { - m_drawer = drawer ?? throw new ArgumentNullException(nameof(drawer)); + m_provider = provider ?? throw new ArgumentNullException(nameof(provider)); } - public static void DrawerClear() + public static void ClearProvider() { - m_drawer = null; + m_provider = null; } } } diff --git a/Packages/UGF.DebugTools/Runtime/DebugGLComponent.cs b/Packages/UGF.DebugTools/Runtime/DebugGLComponent.cs index 4bf9b7a..0b07b29 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugGLComponent.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugGLComponent.cs @@ -1,7 +1,5 @@ using System; using System.Collections; -using System.Collections.Generic; -using UGF.EditorTools.Runtime.IMGUI.AssetReferences; using UnityEngine; namespace UGF.DebugTools.Runtime @@ -9,21 +7,15 @@ namespace UGF.DebugTools.Runtime [AddComponentMenu("Unity Game Framework/Debug/Debug GL", 2000)] public class DebugGLComponent : MonoBehaviour { - [SerializeField] private bool m_enable = true; - [SerializeField] private bool m_defaultShapes = true; - [SerializeField] private Material m_defaultMaterial; - [SerializeField] private List> m_shapes = new List>(); - - public bool Enable { get { return m_enable; } set { m_enable = value; } } - public bool DefaultShapes { get { return m_defaultShapes; } set { m_defaultShapes = value; } } - public Material DefaultMaterial { get { return m_defaultMaterial; } set { m_defaultMaterial = value; } } - public List> Shapes { get { return m_shapes; } } - public DebugGLDrawer Drawer { get { return m_drawer ?? throw new ArgumentException("Value not specified."); } } - public bool HasDrawer { get { return m_drawer != null; } } - - private DebugGLDrawer m_drawer; + [SerializeField] private DebugGLProviderAsset m_provider; + + public DebugGLProviderAsset Provider { get { return m_provider; } set { m_provider = value; } } + public DebugGLProvider Instance { get { return m_instance ?? throw new ArgumentException("Value not specified."); } } + public bool HasInstance { get { return m_instance != null; } } + private readonly Camera.CameraCallback m_onPostRenderHandler; - private static readonly WaitForEndOfFrame m_waitForEndOfFrame = new WaitForEndOfFrame(); + private readonly WaitForEndOfFrame m_waitForEndOfFrame = new WaitForEndOfFrame(); + private DebugGLProvider m_instance; public DebugGLComponent() { @@ -32,36 +24,13 @@ public DebugGLComponent() private void Start() { - if (DebugGL.HasDrawer) throw new InvalidOperationException("Debug GL Drawer already specified."); - - m_drawer = new DebugGLDrawer - { - Enable = m_enable - }; - - m_drawer.SetDefaultMaterial(m_defaultMaterial ? m_defaultMaterial : DebugGLUtility.CreateDefaultMaterial()); + if (DebugGL.HasProvider) throw new InvalidOperationException("Debug GL Drawer already specified."); - if (m_defaultShapes) - { - m_drawer.AddShape(DebugGL.ShapeLineWireId, DebugGLUtility.CreateShapeLineWire()); - m_drawer.AddShape(DebugGL.ShapeTriangleWireId, DebugGLUtility.CreateShapeTriangleWire()); - m_drawer.AddShape(DebugGL.ShapeQuadWireId, DebugGLUtility.CreateShapeQuadWire()); - m_drawer.AddShape(DebugGL.ShapeCircleWireId, DebugGLUtility.CreateShapeCircleWire()); - m_drawer.AddShape(DebugGL.ShapeCubeWireId, DebugGLUtility.CreateShapeCubeWire()); - m_drawer.AddShape(DebugGL.ShapeSphereWireId, DebugGLUtility.CreateShapeSphereWire()); - m_drawer.AddShape(DebugGL.ShapeCylinderWireId, DebugGLUtility.CreateShapeCylinderWire()); - } - - for (int i = 0; i < m_shapes.Count; i++) - { - AssetReference reference = m_shapes[i]; - - m_drawer.AddShape(reference.Guid, reference.Asset.Build()); - } + m_instance = m_provider.Build(); - DebugGL.DrawerSet(m_drawer); + DebugGL.SetProvider(m_instance); - m_drawer.Initialize(); + m_instance.Initialize(); Camera.onPostRender += m_onPostRenderHandler; @@ -72,34 +41,34 @@ private void OnDestroy() { Camera.onPostRender -= m_onPostRenderHandler; - if (HasDrawer) + if (HasInstance) { - m_drawer.Uninitialize(); + m_instance.Uninitialize(); - if (DebugGL.HasDrawer && DebugGL.Drawer == m_drawer) + if (DebugGL.HasProvider && DebugGL.Provider == m_instance) { - DebugGL.DrawerClear(); + DebugGL.ClearProvider(); } - m_drawer = null; + m_instance = null; } } private void OnRender(Camera _) { - if (HasDrawer) + if (HasInstance) { - m_drawer.DrawGL(); + m_instance.DrawGL(); } } private IEnumerator OnRenderEndRoutine() { - while (enabled && HasDrawer) + while (enabled && HasInstance) { yield return m_waitForEndOfFrame; - m_drawer.ClearCommands(); + m_instance.Commands.Clear(); } } } diff --git a/Packages/UGF.DebugTools/Runtime/DebugGLDrawCommand.cs b/Packages/UGF.DebugTools/Runtime/DebugGLDrawCommand.cs index 5dc67a5..2109a2f 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugGLDrawCommand.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugGLDrawCommand.cs @@ -1,20 +1,21 @@ using System; +using UGF.EditorTools.Runtime.Ids; using UnityEngine; namespace UGF.DebugTools.Runtime { public readonly struct DebugGLDrawCommand { - public string ShapeId { get; } + public GlobalId ShapeId { get; } public Vector3 Position { get; } public Quaternion Rotation { get; } public Vector3 Scale { get; } public Color Color { get; } public Material Material { get; } - public DebugGLDrawCommand(string shapeId, Vector3 position, Quaternion rotation, Vector3 scale, Color color, Material material) + public DebugGLDrawCommand(GlobalId shapeId, Vector3 position, Quaternion rotation, Vector3 scale, Color color, Material material) { - if (string.IsNullOrEmpty(shapeId)) throw new ArgumentException("Value cannot be null or empty.", nameof(shapeId)); + if (!shapeId.IsValid()) throw new ArgumentException("Value should be valid.", nameof(shapeId)); ShapeId = shapeId; Position = position; @@ -26,12 +27,12 @@ public DebugGLDrawCommand(string shapeId, Vector3 position, Quaternion rotation, public bool IsValid() { - return !string.IsNullOrEmpty(ShapeId); + return ShapeId.IsValid() && Material != null; } public bool Equals(DebugGLDrawCommand other) { - return ShapeId == other.ShapeId && Position.Equals(other.Position) && Rotation.Equals(other.Rotation) && Scale.Equals(other.Scale) && Color.Equals(other.Color); + return ShapeId.Equals(other.ShapeId) && Position.Equals(other.Position) && Rotation.Equals(other.Rotation) && Scale.Equals(other.Scale) && Color.Equals(other.Color) && Equals(Material, other.Material); } public override bool Equals(object obj) @@ -41,15 +42,7 @@ public override bool Equals(object obj) public override int GetHashCode() { - unchecked - { - int hashCode = ShapeId != null ? ShapeId.GetHashCode() : 0; - hashCode = (hashCode * 397) ^ Position.GetHashCode(); - hashCode = (hashCode * 397) ^ Rotation.GetHashCode(); - hashCode = (hashCode * 397) ^ Scale.GetHashCode(); - hashCode = (hashCode * 397) ^ Color.GetHashCode(); - return hashCode; - } + return HashCode.Combine(ShapeId, Position, Rotation, Scale, Color, Material); } } } diff --git a/Packages/UGF.DebugTools/Runtime/DebugGLDrawer.cs b/Packages/UGF.DebugTools/Runtime/DebugGLProvider.cs similarity index 57% rename from Packages/UGF.DebugTools/Runtime/DebugGLDrawer.cs rename to Packages/UGF.DebugTools/Runtime/DebugGLProvider.cs index 6dc4a2c..f28327a 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugGLDrawer.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugGLProvider.cs @@ -1,67 +1,28 @@ using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using UGF.DebugTools.Runtime.GL.Scopes; +using UGF.EditorTools.Runtime.Ids; using UGF.Initialize.Runtime; +using UGF.RuntimeTools.Runtime.Providers; using UnityEngine; namespace UGF.DebugTools.Runtime { - public class DebugGLDrawer : InitializeBase + public class DebugGLProvider : InitializeBase { + public Provider Shapes { get; } = new Provider(); + public List Commands { get; } = new List(); public bool Enable { get; set; } = true; - public IReadOnlyDictionary Shapes { get; } - public IReadOnlyList Commands { get; } public Material DefaultMaterial { get { return m_defaultMaterial != null ? m_defaultMaterial : throw new ArgumentException("Value not specified."); } } public bool HasDefaultMaterial { get { return m_defaultMaterial != null; } } - private readonly Dictionary m_shapes = new Dictionary(); - private readonly List m_commands = new List(); private Material m_defaultMaterial; - public DebugGLDrawer() - { - Shapes = new ReadOnlyDictionary(m_shapes); - Commands = new ReadOnlyCollection(m_commands); - } - - public void AddShape(string id, DebugGLShape shape) - { - if (string.IsNullOrEmpty(id)) throw new ArgumentException("Value cannot be null or empty.", nameof(id)); - if (shape == null) throw new ArgumentNullException(nameof(shape)); - - m_shapes.Add(id, shape); - } - - public bool RemoveShape(string id) - { - if (string.IsNullOrEmpty(id)) throw new ArgumentException("Value cannot be null or empty.", nameof(id)); - - return m_shapes.Remove(id); - } - - public void ClearShapes() - { - m_shapes.Clear(); - } - - public void AddCommand(DebugGLDrawCommand command) - { - if (!command.IsValid()) throw new ArgumentException("Value should be valid.", nameof(command)); - - m_commands.Add(command); - } - - public void ClearCommands() - { - m_commands.Clear(); - } - public void DrawGL() { if (Enable) { - DrawGLCommands(m_commands); + DrawGLCommands(Commands); } } @@ -73,7 +34,7 @@ public void DrawGLCommands(IReadOnlyList commands) { DebugGLDrawCommand command = commands[i]; - if (m_shapes.TryGetValue(command.ShapeId, out DebugGLShape shape)) + if (Shapes.TryGet(command.ShapeId, out DebugGLShape shape)) { Matrix4x4 matrix = Matrix4x4.TRS(command.Position, command.Rotation, command.Scale); @@ -88,6 +49,7 @@ public void DrawGLCommands(IReadOnlyList commands) public void DrawGLVertices(IReadOnlyList vertices, DebugGLMode mode, Matrix4x4 matrix, Color color, Material material, int pass = 0) { + if (vertices == null) throw new ArgumentNullException(nameof(vertices)); if (material == null) throw new ArgumentNullException(nameof(material)); using (new DebugGLMatrixScope(matrix)) diff --git a/Packages/UGF.DebugTools/Runtime/DebugGLDrawer.cs.meta b/Packages/UGF.DebugTools/Runtime/DebugGLProvider.cs.meta similarity index 100% rename from Packages/UGF.DebugTools/Runtime/DebugGLDrawer.cs.meta rename to Packages/UGF.DebugTools/Runtime/DebugGLProvider.cs.meta diff --git a/Packages/UGF.DebugTools/Runtime/DebugGLProviderAsset.cs b/Packages/UGF.DebugTools/Runtime/DebugGLProviderAsset.cs new file mode 100644 index 0000000..a498e60 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/DebugGLProviderAsset.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using UGF.Builder.Runtime; +using UGF.EditorTools.Runtime.Assets; +using UnityEngine; + +namespace UGF.DebugTools.Runtime +{ + [CreateAssetMenu(menuName = "Unity Game Framework/Debug/Debug GL Provider", order = 2000)] + public class DebugGLProviderAsset : BuilderAsset + { + [SerializeField] private bool m_enable = true; + [SerializeField] private bool m_defaultShapes = true; + [SerializeField] private Material m_defaultMaterial; + [SerializeField] private List> m_shapes = new List>(); + + public bool Enable { get { return m_enable; } set { m_enable = value; } } + public bool DefaultShapes { get { return m_defaultShapes; } set { m_defaultShapes = value; } } + public Material DefaultMaterial { get { return m_defaultMaterial; } set { m_defaultMaterial = value; } } + public List> Shapes { get { return m_shapes; } } + + protected override DebugGLProvider OnBuild() + { + var provider = new DebugGLProvider + { + Enable = m_enable + }; + + provider.SetDefaultMaterial(m_defaultMaterial ? m_defaultMaterial : DebugGLUtility.CreateDefaultMaterial()); + + if (m_defaultShapes) + { + provider.Shapes.Add(DebugGL.ShapeLineWireId, DebugGLUtility.CreateShapeLineWire()); + provider.Shapes.Add(DebugGL.ShapeTriangleWireId, DebugGLUtility.CreateShapeTriangleWire()); + provider.Shapes.Add(DebugGL.ShapeQuadWireId, DebugGLUtility.CreateShapeQuadWire()); + provider.Shapes.Add(DebugGL.ShapeCircleWireId, DebugGLUtility.CreateShapeCircleWire()); + provider.Shapes.Add(DebugGL.ShapeCubeWireId, DebugGLUtility.CreateShapeCubeWire()); + provider.Shapes.Add(DebugGL.ShapeSphereWireId, DebugGLUtility.CreateShapeSphereWire()); + provider.Shapes.Add(DebugGL.ShapeCylinderWireId, DebugGLUtility.CreateShapeCylinderWire()); + } + + for (int i = 0; i < m_shapes.Count; i++) + { + AssetIdReference reference = m_shapes[i]; + + provider.Shapes.Add(reference.Guid, reference.Asset.Build()); + } + + return provider; + } + } +} diff --git a/Packages/UGF.DebugTools/Runtime/DebugGLProviderAsset.cs.meta b/Packages/UGF.DebugTools/Runtime/DebugGLProviderAsset.cs.meta new file mode 100644 index 0000000..d872133 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/DebugGLProviderAsset.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3b5a8ccbb9da4c599c1ba7f1ba669a22 +timeCreated: 1707825383 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/DebugGLShape.cs b/Packages/UGF.DebugTools/Runtime/DebugGLShape.cs index abf0009..67f38c8 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugGLShape.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugGLShape.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using UnityEngine; namespace UGF.DebugTools.Runtime diff --git a/Packages/UGF.DebugTools/Runtime/DebugUI.Elements.cs b/Packages/UGF.DebugTools/Runtime/DebugUI.Elements.cs index ea92e07..78b11c6 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugUI.Elements.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugUI.Elements.cs @@ -64,6 +64,7 @@ public static bool Dropdown(Rect position, GUIContent content) if (Event.current.type == EventType.Repaint) { float padding = GUI.skin.button.padding.right; + var rectFoldout = new Rect(position.xMax - position.height - padding, position.y, LineHeight, LineHeight); GUI.skin.FindStyle(DebugUIStyles.Foldout).Draw(rectFoldout, false, false, true, false); @@ -113,6 +114,7 @@ public static string DelayedTextField(string value) public static string DelayedTextField(Rect position, string value) { int controlId = GUIUtility.GetControlID(m_delayedTextFieldControlHint, FocusType.Keyboard, position); + string controlName = $"{m_delayedTextFieldControlName}:{controlId}"; GUI.SetNextControlName(controlName); diff --git a/Packages/UGF.DebugTools/Runtime/DebugUI.Functions.cs b/Packages/UGF.DebugTools/Runtime/DebugUI.Functions.cs index 5999f45..ee492cc 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugUI.Functions.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugUI.Functions.cs @@ -19,22 +19,22 @@ public static DebugUIFunction AddFunction(string groupName, string content, Debu public static DebugUIFunction AddFunction(string groupName, GUIContent content, DebugUIFunctionExecuteHandler executeHandler) { - return Drawer.Get().Add(groupName, content, executeHandler); + return Provider.Drawers.Get().Add(groupName, content, executeHandler); } public static DebugUIFunction AddFunction(string groupName, GUIContent content, DebugUIFunctionExecuteHandler executeHandler, DebugUIFunctionValidateHandler validateHandler) { - return Drawer.Get().Add(groupName, content, executeHandler, validateHandler); + return Provider.Drawers.Get().Add(groupName, content, executeHandler, validateHandler); } public static void AddFunction(string groupName, DebugUIFunction function) { - Drawer.Get().Add(groupName, function); + Provider.Drawers.Get().Add(groupName, function); } public static bool RemoveFunction(string groupName, DebugUIFunction function) { - return Drawer.Get().Remove(groupName, function); + return Provider.Drawers.Get().Remove(groupName, function); } } } diff --git a/Packages/UGF.DebugTools/Runtime/DebugUI.Menu.cs b/Packages/UGF.DebugTools/Runtime/DebugUI.Menu.cs index 0679d34..3d22c7b 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugUI.Menu.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugUI.Menu.cs @@ -1,5 +1,6 @@ using System; using UGF.DebugTools.Runtime.UI.Menu; +using UGF.EditorTools.Runtime.Ids; using UnityEngine; namespace UGF.DebugTools.Runtime @@ -109,16 +110,14 @@ public static DebugUIMenu GetMenuFromEnum(object value, DebugUIMenuItemHandler h private static DebugUIMenuDrawer GetMenuDrawer() { - if (!Drawer.TryGet(out DebugUIMenuDrawer drawer)) + if (!Provider.Drawers.TryGet(out DebugUIMenuDrawer drawer)) { - string id = Guid.NewGuid().ToString("N"); - drawer = new DebugUIMenuDrawer { Display = true }; - Drawer.Add(id, drawer); + Provider.Drawers.Add(GlobalId.Generate(), drawer); drawer.Initialize(); } diff --git a/Packages/UGF.DebugTools/Runtime/DebugUI.Panel.cs b/Packages/UGF.DebugTools/Runtime/DebugUI.Panel.cs index df854c5..ce6482b 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugUI.Panel.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugUI.Panel.cs @@ -6,34 +6,34 @@ public static partial class DebugUI { public static DebugUIPanelText PanelText(string text) { - var panel = PanelAdd(); + var panel = AddPanel(); panel.Text = text; return panel; } - public static T PanelAdd() where T : DebugUIPanel, new() + public static T AddPanel() where T : DebugUIPanel, new() { var panel = new T(); - PanelAdd(panel); + AddPanel(panel); return panel; } - public static void PanelAdd(DebugUIPanel panel) + public static void AddPanel(DebugUIPanel panel) { - Drawer.Get().Add(panel); + Provider.Drawers.Get().Panels.Add(panel); panel.Initialize(); } - public static bool PanelRemove(DebugUIPanel panel) + public static bool RemovePanel(DebugUIPanel panel) { panel.Uninitialize(); - return Drawer.Get().Remove(panel); + return Provider.Drawers.Get().Panels.Remove(panel); } } } diff --git a/Packages/UGF.DebugTools/Runtime/DebugUI.cs b/Packages/UGF.DebugTools/Runtime/DebugUI.cs index ace4c44..ee727df 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugUI.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugUI.cs @@ -4,19 +4,19 @@ namespace UGF.DebugTools.Runtime { public static partial class DebugUI { - public static DebugUIDrawer Drawer { get { return m_drawer ?? throw new ArgumentException("Value not specified."); } } - public static bool HasDrawer { get { return m_drawer != null; } } + public static DebugUIProvider Provider { get { return m_provider ?? throw new ArgumentException("Value not specified."); } } + public static bool HasProvider { get { return m_provider != null; } } - private static DebugUIDrawer m_drawer; + private static DebugUIProvider m_provider; - public static void DrawerSet(DebugUIDrawer drawer) + public static void SetProvider(DebugUIProvider provider) { - m_drawer = drawer ?? throw new ArgumentNullException(nameof(drawer)); + m_provider = provider ?? throw new ArgumentNullException(nameof(provider)); } - public static void DrawerClear() + public static void ClearProvider() { - m_drawer = null; + m_provider = null; } } } diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIComponent.cs b/Packages/UGF.DebugTools/Runtime/DebugUIComponent.cs index 9e40c58..7527004 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugUIComponent.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugUIComponent.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using UGF.EditorTools.Runtime.IMGUI.AssetReferences; using UnityEngine; namespace UGF.DebugTools.Runtime @@ -8,65 +6,43 @@ namespace UGF.DebugTools.Runtime [AddComponentMenu("Unity Game Framework/Debug/Debug UI", 2000)] public class DebugUIComponent : MonoBehaviour { - [SerializeField] private bool m_enable = true; - [SerializeField] private float m_scale = 1F; - [SerializeField] private GUISkin m_skin; - [SerializeField] private List> m_drawers = new List>(); + [SerializeField] private DebugUIProviderAsset m_provider; - public bool Enable { get { return m_enable; } set { m_enable = value; } } - public float Scale { get { return m_scale; } set { m_scale = value; } } - public GUISkin Skin { get { return m_skin; } set { m_skin = value; } } - public List> Drawers { get { return m_drawers; } } - public DebugUIDrawer Drawer { get { return m_drawer ?? throw new ArgumentException("Value not specified."); } } - public bool HasDrawer { get { return m_drawer != null; } } + public DebugUIProviderAsset Provider { get { return m_provider; } set { m_provider = value; } } + public DebugUIProvider Instance { get { return m_instance ?? throw new ArgumentException("Value not specified."); } } + public bool HasInstance { get { return m_instance != null; } } - private DebugUIDrawer m_drawer; + private DebugUIProvider m_instance; private void Start() { - if (DebugUI.HasDrawer) throw new InvalidOperationException("Debug UI Drawer already specified."); + if (DebugUI.HasProvider) throw new InvalidOperationException("Debug UI Drawer already specified."); - m_drawer = new DebugUIDrawer - { - Enable = m_enable, - Scale = Vector2.one * m_scale - }; - - if (m_skin != null) - { - m_drawer.SetSkin(m_skin); - } - - for (int i = 0; i < m_drawers.Count; i++) - { - AssetReference reference = m_drawers[i]; - - m_drawer.Add(reference.Guid, reference.Asset.Build()); - } + m_instance = m_provider.Build(); - DebugUI.DrawerSet(m_drawer); + DebugUI.SetProvider(m_instance); - m_drawer.Initialize(); + m_instance.Initialize(); } private void OnDestroy() { - if (HasDrawer) + if (HasInstance) { - m_drawer.Uninitialize(); + m_instance.Uninitialize(); - if (DebugUI.HasDrawer && DebugUI.Drawer == m_drawer) + if (DebugUI.HasProvider && DebugUI.Provider == m_instance) { - DebugUI.DrawerClear(); + DebugUI.ClearProvider(); } - m_drawer = null; + m_instance = null; } } private void OnGUI() { - m_drawer.DrawGUI(); + m_instance.DrawGUI(); DebugUIContentCache.Reset(); } diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIDrawer.cs b/Packages/UGF.DebugTools/Runtime/DebugUIDrawer.cs index 9265762..a0a05f2 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugUIDrawer.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugUIDrawer.cs @@ -1,175 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using UGF.DebugTools.Runtime.UI.Scopes; -using UGF.Initialize.Runtime; -using UnityEngine; +using UGF.Initialize.Runtime; namespace UGF.DebugTools.Runtime { - public class DebugUIDrawer : InitializeBase + public abstract class DebugUIDrawer : InitializeBase { - public bool Enable { get; set; } = true; - public IReadOnlyDictionary Drawers { get; } - public Vector2 Scale { get; set; } = Vector2.one; - public GUISkin Skin { get { return HasSkin ? m_skin : throw new ArgumentException("Value not specified."); } } - public bool HasSkin { get { return m_skin != null; } } - - private readonly Dictionary m_drawers = new Dictionary(); - private readonly Dictionary m_drawersUpdate = new Dictionary(); - private GUISkin m_skin; - - public DebugUIDrawer() - { - Drawers = new ReadOnlyDictionary(m_drawers); - } - - protected override void OnInitialize() - { - base.OnInitialize(); - - foreach (KeyValuePair pair in m_drawers) - { - pair.Value.Initialize(); - } - } - - protected override void OnUninitialize() - { - base.OnUninitialize(); - - foreach (KeyValuePair pair in m_drawers) - { - pair.Value.Uninitialize(); - } - } - - public void Add(string id, IDebugUIDrawer drawer) - { - if (string.IsNullOrEmpty(id)) throw new ArgumentException("Value cannot be null or empty.", nameof(id)); - if (drawer == null) throw new ArgumentNullException(nameof(drawer)); - - m_drawers.Add(id, drawer); - } - - public bool Remove(string id) - { - if (string.IsNullOrEmpty(id)) throw new ArgumentException("Value cannot be null or empty.", nameof(id)); - - return m_drawers.Remove(id); - } - - public void Clear() - { - foreach (KeyValuePair pair in m_drawers) - { - pair.Value.Uninitialize(); - } - - m_drawers.Clear(); - } - public void DrawGUI() { - if (Enable) - { - foreach (KeyValuePair pair in m_drawers) - { - m_drawersUpdate.Add(pair.Key, pair.Value); - } - - Matrix4x4 matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(Scale.x, Scale.y, 1F)); - GUISkin skin = HasSkin ? Skin : GUI.skin; - - using (new DebugUIMatrixScope(matrix)) - using (new DebugUISkinScope(skin)) - { - foreach (KeyValuePair pair in m_drawersUpdate) - { - pair.Value.DrawGUI(); - } - } - - m_drawersUpdate.Clear(); - } - } - - public void SetSkin(GUISkin skin) - { - m_skin = skin ? skin : throw new ArgumentNullException(nameof(skin)); + OnDrawGUI(); } - public void ClearSkin() - { - m_skin = null; - } - - public T Get() where T : DebugUIDrawerBase - { - return (T)Get(typeof(T)); - } - - public IDebugUIDrawer Get(Type type) - { - return TryGet(type, out IDebugUIDrawer drawer) ? drawer : throw new ArgumentException($"Drawer not found by the specified type: '{type}'."); - } - - public bool TryGet(out T drawer) where T : IDebugUIDrawer - { - if (TryGet(typeof(T), out IDebugUIDrawer value)) - { - drawer = (T)value; - return true; - } - - drawer = default; - return false; - } - - public bool TryGet(Type type, out IDebugUIDrawer drawer) - { - if (type == null) throw new ArgumentNullException(nameof(type)); - - foreach (KeyValuePair pair in m_drawers) - { - if (type.IsInstanceOfType(pair.Value)) - { - drawer = pair.Value; - return true; - } - } - - drawer = null; - return false; - } - - public T Get(string id) - { - return (T)Get(id); - } - - public IDebugUIDrawer Get(string id) - { - return TryGet(id, out IDebugUIDrawer drawer) ? drawer : throw new ArgumentException($"Drawer not found by the specified id: '{id}'."); - } - - public bool TryGet(string id, out T drawer) where T : IDebugUIDrawer - { - if (TryGet(id, out IDebugUIDrawer value)) - { - drawer = (T)value; - return true; - } - - drawer = default; - return false; - } - - public bool TryGet(string id, out IDebugUIDrawer drawer) - { - if (string.IsNullOrEmpty(id)) throw new ArgumentException("Value cannot be null or empty.", nameof(id)); - - return m_drawers.TryGetValue(id, out drawer); - } + protected abstract void OnDrawGUI(); } } diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIDrawer.cs.meta b/Packages/UGF.DebugTools/Runtime/DebugUIDrawer.cs.meta index f0d8e75..42e2d2a 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugUIDrawer.cs.meta +++ b/Packages/UGF.DebugTools/Runtime/DebugUIDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: c49e8e7d42b649a58c74ae08d60f7b22 -timeCreated: 1631726566 \ No newline at end of file +guid: f9f228f5af164bc4b78fbcf66e26349f +timeCreated: 1631725154 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIDrawerAsset.cs b/Packages/UGF.DebugTools/Runtime/DebugUIDrawerAsset.cs index a5531b4..a5ac2f6 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugUIDrawerAsset.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugUIDrawerAsset.cs @@ -2,7 +2,7 @@ namespace UGF.DebugTools.Runtime { - public abstract class DebugUIDrawerAsset : BuilderAsset + public abstract class DebugUIDrawerAsset : BuilderAsset { } } diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIDrawerBase.cs b/Packages/UGF.DebugTools/Runtime/DebugUIDrawerBase.cs deleted file mode 100644 index 395850d..0000000 --- a/Packages/UGF.DebugTools/Runtime/DebugUIDrawerBase.cs +++ /dev/null @@ -1,14 +0,0 @@ -using UGF.Initialize.Runtime; - -namespace UGF.DebugTools.Runtime -{ - public abstract class DebugUIDrawerBase : InitializeBase, IDebugUIDrawer - { - public void DrawGUI() - { - OnDrawGUI(); - } - - protected abstract void OnDrawGUI(); - } -} diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIDrawerBase.cs.meta b/Packages/UGF.DebugTools/Runtime/DebugUIDrawerBase.cs.meta deleted file mode 100644 index 42e2d2a..0000000 --- a/Packages/UGF.DebugTools/Runtime/DebugUIDrawerBase.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: f9f228f5af164bc4b78fbcf66e26349f -timeCreated: 1631725154 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIProvider.cs b/Packages/UGF.DebugTools/Runtime/DebugUIProvider.cs new file mode 100644 index 0000000..69c0076 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/DebugUIProvider.cs @@ -0,0 +1,86 @@ +using System; +using UGF.DebugTools.Runtime.UI.Scopes; +using UGF.EditorTools.Runtime.Ids; +using UGF.Initialize.Runtime; +using UGF.RuntimeTools.Runtime.Providers; +using UnityEngine; + +namespace UGF.DebugTools.Runtime +{ + public class DebugUIProvider : InitializeBase + { + public Provider Drawers { get; } = new Provider(); + public bool Enable { get; set; } = true; + public Vector2 Scale { get; set; } = Vector2.one; + public GUISkin Skin { get { return HasSkin ? m_skin : throw new ArgumentException("Value not specified."); } } + public bool HasSkin { get { return m_skin != null; } } + + private readonly Provider m_update = new Provider(); + private GUISkin m_skin; + + protected override void OnInitialize() + { + base.OnInitialize(); + + foreach ((_, DebugUIDrawer drawer) in Drawers) + { + drawer.Initialize(); + } + } + + protected override void OnUninitialize() + { + base.OnUninitialize(); + + foreach ((_, DebugUIDrawer drawer) in Drawers) + { + drawer.Uninitialize(); + } + } + + public void Clear() + { + foreach ((_, DebugUIDrawer drawer) in Drawers) + { + drawer.Uninitialize(); + } + + Drawers.Clear(); + } + + public void DrawGUI() + { + if (Enable) + { + foreach ((GlobalId id, DebugUIDrawer drawer) in Drawers) + { + m_update.Add(id, drawer); + } + + Matrix4x4 matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(Scale.x, Scale.y, 1F)); + GUISkin skin = HasSkin ? Skin : GUI.skin; + + using (new DebugUIMatrixScope(matrix)) + using (new DebugUISkinScope(skin)) + { + foreach ((_, DebugUIDrawer drawer) in m_update) + { + drawer.DrawGUI(); + } + } + + m_update.Clear(); + } + } + + public void SetSkin(GUISkin skin) + { + m_skin = skin ? skin : throw new ArgumentNullException(nameof(skin)); + } + + public void ClearSkin() + { + m_skin = null; + } + } +} diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIProvider.cs.meta b/Packages/UGF.DebugTools/Runtime/DebugUIProvider.cs.meta new file mode 100644 index 0000000..f0d8e75 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/DebugUIProvider.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c49e8e7d42b649a58c74ae08d60f7b22 +timeCreated: 1631726566 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIProviderAsset.cs b/Packages/UGF.DebugTools/Runtime/DebugUIProviderAsset.cs new file mode 100644 index 0000000..67626f8 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/DebugUIProviderAsset.cs @@ -0,0 +1,44 @@ +using System.Collections.Generic; +using UGF.Builder.Runtime; +using UGF.EditorTools.Runtime.Assets; +using UnityEngine; + +namespace UGF.DebugTools.Runtime +{ + [CreateAssetMenu(menuName = "Unity Game Framework/Debug/Debug UI Provider", order = 2000)] + public class DebugUIProviderAsset : BuilderAsset + { + [SerializeField] private bool m_enable = true; + [SerializeField] private float m_scale = 1F; + [SerializeField] private GUISkin m_skin; + [SerializeField] private List> m_drawers = new List>(); + + public bool Enable { get { return m_enable; } set { m_enable = value; } } + public float Scale { get { return m_scale; } set { m_scale = value; } } + public GUISkin Skin { get { return m_skin; } set { m_skin = value; } } + public List> Drawers { get { return m_drawers; } } + + protected override DebugUIProvider OnBuild() + { + var provider = new DebugUIProvider + { + Enable = m_enable, + Scale = Vector2.one * m_scale + }; + + for (int i = 0; i < m_drawers.Count; i++) + { + AssetIdReference reference = m_drawers[i]; + + provider.Drawers.Add(reference.Guid, reference.Asset.Build()); + } + + if (m_skin != null) + { + provider.SetSkin(m_skin); + } + + return provider; + } + } +} diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIProviderAsset.cs.meta b/Packages/UGF.DebugTools/Runtime/DebugUIProviderAsset.cs.meta new file mode 100644 index 0000000..00d1068 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/DebugUIProviderAsset.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2d0fa9b121f64e1f83b28ca10e31f731 +timeCreated: 1707825082 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIWindowDrawer.cs b/Packages/UGF.DebugTools/Runtime/DebugUIWindowDrawer.cs index 2d3473f..c06a989 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugUIWindowDrawer.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugUIWindowDrawer.cs @@ -4,7 +4,7 @@ namespace UGF.DebugTools.Runtime { - public abstract class DebugUIWindowDrawer : DebugUIDrawerBase + public abstract class DebugUIWindowDrawer : DebugUIDrawer { public bool Display { get; set; } public bool DisplayBackground { get; set; } = true; @@ -36,7 +36,7 @@ public void Focus() } } - public void Unfocus() + public void UnFocus() { GUI.UnfocusWindow(); } diff --git a/Packages/UGF.DebugTools/Runtime/GL.Scopes/DebugGLDrawScope.cs b/Packages/UGF.DebugTools/Runtime/GL.Scopes/DebugGLDrawScope.cs index 6fd8209..975783c 100644 --- a/Packages/UGF.DebugTools/Runtime/GL.Scopes/DebugGLDrawScope.cs +++ b/Packages/UGF.DebugTools/Runtime/GL.Scopes/DebugGLDrawScope.cs @@ -2,7 +2,7 @@ namespace UGF.DebugTools.Runtime.GL.Scopes { - public struct DebugGLDrawScope : IDisposable + public readonly struct DebugGLDrawScope : IDisposable { public DebugGLDrawScope(DebugGLMode mode) : this((int)mode) { diff --git a/Packages/UGF.DebugTools/Runtime/GL.Scopes/DebugGLMatrixScope.cs b/Packages/UGF.DebugTools/Runtime/GL.Scopes/DebugGLMatrixScope.cs index 3cb303a..a5c8f92 100644 --- a/Packages/UGF.DebugTools/Runtime/GL.Scopes/DebugGLMatrixScope.cs +++ b/Packages/UGF.DebugTools/Runtime/GL.Scopes/DebugGLMatrixScope.cs @@ -3,7 +3,7 @@ namespace UGF.DebugTools.Runtime.GL.Scopes { - public struct DebugGLMatrixScope : IDisposable + public readonly struct DebugGLMatrixScope : IDisposable { public DebugGLMatrixScope(Matrix4x4 matrix) { diff --git a/Packages/UGF.DebugTools/Runtime/GL.Sections/DebugGLOptionsSection.cs b/Packages/UGF.DebugTools/Runtime/GL.Sections/DebugGLOptionsSection.cs index 7cce81f..791d315 100644 --- a/Packages/UGF.DebugTools/Runtime/GL.Sections/DebugGLOptionsSection.cs +++ b/Packages/UGF.DebugTools/Runtime/GL.Sections/DebugGLOptionsSection.cs @@ -10,7 +10,7 @@ public DebugGLOptionsSection() : base("GL Options") protected override void OnDrawGUILayout() { - DebugGL.Drawer.Enable = DebugUI.FieldToggle("Enable", DebugGL.Drawer.Enable); + DebugGL.Provider.Enable = DebugUI.FieldToggle("Enable", DebugGL.Provider.Enable); } } } diff --git a/Packages/UGF.DebugTools/Runtime/IDebugUIDrawer.cs b/Packages/UGF.DebugTools/Runtime/IDebugUIDrawer.cs deleted file mode 100644 index a0add10..0000000 --- a/Packages/UGF.DebugTools/Runtime/IDebugUIDrawer.cs +++ /dev/null @@ -1,9 +0,0 @@ -using UGF.Initialize.Runtime; - -namespace UGF.DebugTools.Runtime -{ - public interface IDebugUIDrawer : IInitialize - { - void DrawGUI(); - } -} diff --git a/Packages/UGF.DebugTools/Runtime/IDebugUIDrawer.cs.meta b/Packages/UGF.DebugTools/Runtime/IDebugUIDrawer.cs.meta deleted file mode 100644 index 13597bd..0000000 --- a/Packages/UGF.DebugTools/Runtime/IDebugUIDrawer.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 06f708cd90314e8e9ade6fb09cf3da90 -timeCreated: 1631727058 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/UGF.DebugTools.Runtime.asmdef b/Packages/UGF.DebugTools/Runtime/UGF.DebugTools.Runtime.asmdef index ee9802a..ebd48b4 100644 --- a/Packages/UGF.DebugTools/Runtime/UGF.DebugTools.Runtime.asmdef +++ b/Packages/UGF.DebugTools/Runtime/UGF.DebugTools.Runtime.asmdef @@ -4,7 +4,8 @@ "references": [ "GUID:088d00b6871540e44bce58af1a3f0f17", "GUID:6c7389a7d4bbed54e96eb1e71a69798e", - "GUID:d067af32d09350a4bb33960432735e4d" + "GUID:d067af32d09350a4bb33960432735e4d", + "GUID:16fde9420ef50f34db61e711e19381dd" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDrawer.cs b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDrawer.cs index b68311b..33ee1e9 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDrawer.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDrawer.cs @@ -32,7 +32,7 @@ public void Add(string groupName, DebugUIFunction function) functions.Add(function); - Sort(functions); + OnSort(functions); } public bool Remove(string groupName, DebugUIFunction function) @@ -44,7 +44,7 @@ public bool Remove(string groupName, DebugUIFunction function) { if (functions.Count > 0) { - Sort(functions); + OnSort(functions); } else { @@ -82,18 +82,18 @@ protected override void OnDrawGUILayout() if (DisplayMenu) { - foreach (KeyValuePair> pair in m_functions) + foreach ((string groupName, List functions) in m_functions) { - m_functionsUpdate.Add(pair.Key, pair.Value); + m_functionsUpdate.Add(groupName, functions); } - foreach (KeyValuePair> pair in m_functionsUpdate) + foreach ((string groupName, List functions) in m_functionsUpdate) { Rect position = DebugUI.GetControlRect(); - if (DebugUI.Dropdown(position, pair.Key)) + if (DebugUI.Dropdown(position, groupName)) { - DebugUIMenu menu = OnCreateMenu(pair.Value); + DebugUIMenu menu = OnCreateMenu(functions); DebugUI.MenuShowDropdown(menu, position); } @@ -103,7 +103,7 @@ protected override void OnDrawGUILayout() } } - private DebugUIMenu OnCreateMenu(List functions) + private DebugUIMenu OnCreateMenu(IReadOnlyList functions) { var menu = new DebugUIMenu(); @@ -124,7 +124,7 @@ private DebugUIMenu OnCreateMenu(List functions) return menu; } - private void Sort(List functions) + private void OnSort(List functions) { functions.Sort((x, y) => string.Compare(x.Content.text, y.Content.text, StringComparison.Ordinal)); } diff --git a/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDrawerAsset.cs b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDrawerAsset.cs index 08a8000..c27d4f4 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDrawerAsset.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDrawerAsset.cs @@ -14,7 +14,7 @@ public class DebugUIFunctionDrawerAsset : DebugUIDrawerAsset public float Width { get { return m_width; } set { m_width = value; } } public List Functions { get { return m_functions; } } - protected override IDebugUIDrawer OnBuild() + protected override DebugUIDrawer OnBuild() { var drawer = new DebugUIFunctionDrawer { diff --git a/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionHandler.cs b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionHandler.cs index 9511ec7..c8802f8 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionHandler.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionHandler.cs @@ -8,7 +8,7 @@ public class DebugUIFunctionHandler : DebugUIFunction public DebugUIFunctionExecuteHandler ExecuteHandler { get; } public DebugUIFunctionValidateHandler ValidateHandler { get; } - public DebugUIFunctionHandler(GUIContent content, DebugUIFunctionExecuteHandler executeHandler) : this(content, executeHandler, function => true) + public DebugUIFunctionHandler(GUIContent content, DebugUIFunctionExecuteHandler executeHandler) : this(content, executeHandler, _ => true) { } diff --git a/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenu.cs b/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenu.cs index 19b900e..c58ed69 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenu.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenu.cs @@ -1,44 +1,16 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; +using System.Collections.Generic; namespace UGF.DebugTools.Runtime.UI.Menu { public class DebugUIMenu { - public IReadOnlyList Items { get; } - - private readonly List m_items = new List(); - - public DebugUIMenu() - { - Items = new ReadOnlyCollection(m_items); - } - - public void Add(DebugUIMenuItem item) - { - if (item == null) throw new ArgumentNullException(nameof(item)); - - m_items.Add(item); - } - - public bool Remove(DebugUIMenuItem item) - { - if (item == null) throw new ArgumentNullException(nameof(item)); - - return m_items.Remove(item); - } - - public void Clear() - { - m_items.Clear(); - } + public List Items { get; } = new List(); public void Reset() { - for (int i = 0; i < m_items.Count; i++) + for (int i = 0; i < Items.Count; i++) { - m_items[i].Reset(); + Items[i].Reset(); } } } diff --git a/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenuExtensions.cs b/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenuExtensions.cs index a7c3845..477f758 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenuExtensions.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenuExtensions.cs @@ -14,7 +14,7 @@ public static void AddDisabled(this DebugUIMenu menu, GUIContent content, bool e { if (menu == null) throw new ArgumentNullException(nameof(menu)); - menu.Add(new DebugUIMenuItemDisabled(content, enabled)); + menu.Items.Add(new DebugUIMenuItemDisabled(content, enabled)); } public static void Add(this DebugUIMenu menu, string content, bool enabled = false) @@ -24,7 +24,7 @@ public static void Add(this DebugUIMenu menu, string content, bool enabled = fal public static void Add(this DebugUIMenu menu, GUIContent content, bool enabled = false) { - Add(menu, content, enabled, item => { }); + Add(menu, content, enabled, _ => { }); } public static void Add(this DebugUIMenu menu, string content, bool enabled, DebugUIMenuItemHandler handler, object value = null) @@ -36,7 +36,7 @@ public static void Add(this DebugUIMenu menu, GUIContent content, bool enabled, { if (menu == null) throw new ArgumentNullException(nameof(menu)); - menu.Add(new DebugUIMenuItemContent(content, enabled, handler, value)); + menu.Items.Add(new DebugUIMenuItemContent(content, enabled, handler, value)); } public static void ShowDropdown(this DebugUIMenu menu, Rect dropdownPosition) diff --git a/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenuItemDisabled.cs b/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenuItemDisabled.cs index 3f6d193..23d5613 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenuItemDisabled.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenuItemDisabled.cs @@ -5,7 +5,7 @@ namespace UGF.DebugTools.Runtime.UI.Menu { public class DebugUIMenuItemDisabled : DebugUIMenuItemContent { - public DebugUIMenuItemDisabled(GUIContent content, bool enabled) : base(content, enabled, item => { }) + public DebugUIMenuItemDisabled(GUIContent content, bool enabled) : base(content, enabled, _ => { }) { } diff --git a/Packages/UGF.DebugTools/Runtime/UI.Panels/DebugUIPanelDrawer.cs b/Packages/UGF.DebugTools/Runtime/UI.Panels/DebugUIPanelDrawer.cs index 73cea00..7b7acdb 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Panels/DebugUIPanelDrawer.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Panels/DebugUIPanelDrawer.cs @@ -1,30 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; +using System.Collections.Generic; using UGF.DebugTools.Runtime.UI.Functions; namespace UGF.DebugTools.Runtime.UI.Panels { - public class DebugUIPanelDrawer : DebugUIDrawerBase + public class DebugUIPanelDrawer : DebugUIDrawer { + public List Panels { get; } = new List(); public bool Display { get; set; } - public IReadOnlyCollection Panels { get; } - private readonly List m_panels = new List(); private DebugUIFunction m_functionDisplay; - public DebugUIPanelDrawer() - { - Panels = new ReadOnlyCollection(m_panels); - } - protected override void OnInitialize() { base.OnInitialize(); - for (int i = 0; i < m_panels.Count; i++) + for (int i = 0; i < Panels.Count; i++) { - m_panels[i].Initialize(); + Panels[i].Initialize(); } m_functionDisplay = DebugUI.AddFunction(DebugUI.DebugFunctionGroupName, "Panels Display", OnFunctionDisplay); @@ -34,45 +26,31 @@ protected override void OnUninitialize() { base.OnUninitialize(); - for (int i = 0; i < m_panels.Count; i++) + for (int i = 0; i < Panels.Count; i++) { - m_panels[i].Uninitialize(); + Panels[i].Uninitialize(); } DebugUI.RemoveFunction(DebugUI.DebugFunctionGroupName, m_functionDisplay); } - public void Add(DebugUIPanel panel) - { - if (panel == null) throw new ArgumentNullException(nameof(panel)); - - m_panels.Add(panel); - } - - public bool Remove(DebugUIPanel panel) - { - if (panel == null) throw new ArgumentNullException(nameof(panel)); - - return m_panels.Remove(panel); - } - public void Clear() { - for (int i = 0; i < m_panels.Count; i++) + for (int i = 0; i < Panels.Count; i++) { - m_panels[i].Uninitialize(); + Panels[i].Uninitialize(); } - m_panels.Clear(); + Panels.Clear(); } protected override void OnDrawGUI() { if (Display) { - for (int i = 0; i < m_panels.Count; i++) + for (int i = 0; i < Panels.Count; i++) { - DebugUIPanel panel = m_panels[i]; + DebugUIPanel panel = Panels[i]; panel.DrawGUI(); } diff --git a/Packages/UGF.DebugTools/Runtime/UI.Panels/DebugUIPanelDrawerAsset.cs b/Packages/UGF.DebugTools/Runtime/UI.Panels/DebugUIPanelDrawerAsset.cs index 423389f..54da0af 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Panels/DebugUIPanelDrawerAsset.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Panels/DebugUIPanelDrawerAsset.cs @@ -9,7 +9,7 @@ public class DebugUIPanelDrawerAsset : DebugUIDrawerAsset public bool Display { get { return m_display; } set { m_display = value; } } - protected override IDebugUIDrawer OnBuild() + protected override DebugUIDrawer OnBuild() { return new DebugUIPanelDrawer { diff --git a/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUICenterScope.cs b/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUICenterScope.cs index a9135e6..784b2e3 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUICenterScope.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUICenterScope.cs @@ -3,7 +3,7 @@ namespace UGF.DebugTools.Runtime.UI.Scopes { - public struct DebugUICenterScope : IDisposable + public readonly struct DebugUICenterScope : IDisposable { public DebugUICenterScope(GUIContent content, params GUILayoutOption[] options) : this(content, GUIStyle.none, options) { diff --git a/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIGroupScope.cs b/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIGroupScope.cs index 0425080..e3dd84c 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIGroupScope.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIGroupScope.cs @@ -3,7 +3,7 @@ namespace UGF.DebugTools.Runtime.UI.Scopes { - public struct DebugUIGroupScope : IDisposable + public readonly struct DebugUIGroupScope : IDisposable { public DebugUIGroupScope(Rect position) : this(position, GUIContent.none, GUIStyle.none) { diff --git a/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIHorizontalScope.cs b/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIHorizontalScope.cs index 63b6453..39cd7e0 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIHorizontalScope.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIHorizontalScope.cs @@ -3,7 +3,7 @@ namespace UGF.DebugTools.Runtime.UI.Scopes { - public struct DebugUIHorizontalScope : IDisposable + public readonly struct DebugUIHorizontalScope : IDisposable { public DebugUIHorizontalScope(GUIContent content, params GUILayoutOption[] options) : this(content, GUIStyle.none, options) { diff --git a/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUILayoutAreaScope.cs b/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUILayoutAreaScope.cs index cc61831..12d8213 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUILayoutAreaScope.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUILayoutAreaScope.cs @@ -3,7 +3,7 @@ namespace UGF.DebugTools.Runtime.UI.Scopes { - public struct DebugUILayoutAreaScope : IDisposable + public readonly struct DebugUILayoutAreaScope : IDisposable { public DebugUILayoutAreaScope(Rect position) : this(position, GUIContent.none, GUIStyle.none) { diff --git a/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIScrollViewScope.cs b/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIScrollViewScope.cs index cc16451..afed5fa 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIScrollViewScope.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIScrollViewScope.cs @@ -3,9 +3,9 @@ namespace UGF.DebugTools.Runtime.UI.Scopes { - public struct DebugUIScrollViewScope : IDisposable + public readonly struct DebugUIScrollViewScope : IDisposable { - public Vector2 ScrollPosition { get; private set; } + public Vector2 ScrollPosition { get; } public DebugUIScrollViewScope(Vector2 scrollPosition, bool alwaysShowHorizontal = false, bool alwaysShowVertical = false, params GUILayoutOption[] options) { diff --git a/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIVerticalScope.cs b/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIVerticalScope.cs index 9920300..b2d6640 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIVerticalScope.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Scopes/DebugUIVerticalScope.cs @@ -3,7 +3,7 @@ namespace UGF.DebugTools.Runtime.UI.Scopes { - public struct DebugUIVerticalScope : IDisposable + public readonly struct DebugUIVerticalScope : IDisposable { public DebugUIVerticalScope(GUIContent content, params GUILayoutOption[] options) : this(content, GUIStyle.none, options) { diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkins.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkins.cs index 1c795cc..92dd749 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkins.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkins.cs @@ -29,7 +29,7 @@ private DebugUIMenu OnMenuSkinCreate() { GUISkin skin = Skins[i]; - menu.Add(skin.name, GUI.skin == skin, item => DebugUI.Drawer.SetSkin(item.GetValue()), skin); + menu.Add(skin.name, GUI.skin == skin, item => DebugUI.Provider.SetSkin(item.GetValue()), skin); } return menu; diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDrawer.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDrawer.cs index b37555e..59ed730 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDrawer.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDrawer.cs @@ -1,31 +1,28 @@ using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; using UGF.DebugTools.Runtime.UI.Functions; using UGF.DebugTools.Runtime.UI.Menu; using UGF.DebugTools.Runtime.UI.Scopes; +using UGF.EditorTools.Runtime.Ids; +using UGF.RuntimeTools.Runtime.Providers; using UnityEngine; namespace UGF.DebugTools.Runtime.UI.Sections { public class DebugUISectionDrawer : DebugUIWindowDrawer { - public IReadOnlyDictionary Sections { get; } + public Provider Sections { get; } = new Provider(); public Vector2 Size { get; set; } = new Vector2(200F, 200F); public DebugUISectionAlignment Alignment { get; set; } = DebugUISectionAlignment.Left; - public string Selected { get { return HasSelected ? m_selected : throw new ArgumentException("Value not specified."); } } - public bool HasSelected { get { return !string.IsNullOrEmpty(m_selected); } } + public GlobalId Selected { get { return m_selected ?? throw new ArgumentException("Value not specified."); } } + public bool HasSelected { get { return m_selected.HasValue; } } - private readonly Dictionary m_sections = new Dictionary(); private readonly Func m_onMenuCreateFunction; private readonly DebugUIMenuItemHandler m_onMenuItemHandler; private DebugUIFunction m_functionDisplay; - private string m_selected; + private GlobalId? m_selected; public DebugUISectionDrawer() { - Sections = new ReadOnlyDictionary(m_sections); - m_onMenuCreateFunction = OnMenuSectionsCreate; m_onMenuItemHandler = OnMenuSectionsSelected; } @@ -34,9 +31,9 @@ protected override void OnInitialize() { base.OnInitialize(); - foreach (KeyValuePair pair in m_sections) + foreach ((_, DebugUISection section) in Sections) { - pair.Value.Initialize(); + section.Initialize(); } m_functionDisplay = DebugUI.AddFunction(DebugUI.DebugFunctionGroupName, "Sections Display", OnFunctionDisplay); @@ -46,58 +43,37 @@ protected override void OnUninitialize() { base.OnUninitialize(); - foreach (KeyValuePair pair in m_sections) + foreach ((_, DebugUISection section) in Sections) { - pair.Value.Uninitialize(); + section.Uninitialize(); } DebugUI.RemoveFunction(DebugUI.DebugFunctionGroupName, m_functionDisplay); } - public void Add(string id, DebugUISection section) - { - if (string.IsNullOrEmpty(id)) throw new ArgumentException("Value cannot be null or empty.", nameof(id)); - if (section == null) throw new ArgumentNullException(nameof(section)); - - m_sections.Add(id, section); - } - - public bool Remove(string id) - { - if (string.IsNullOrEmpty(id)) throw new ArgumentException("Value cannot be null or empty.", nameof(id)); - - if (m_sections.TryGetValue(id, out DebugUISection section)) - { - m_sections.Remove(id); - return true; - } - - return false; - } - public void Clear() { ClearSelected(); - foreach (KeyValuePair pair in m_sections) + foreach ((_, DebugUISection section) in Sections) { - pair.Value.Uninitialize(); + section.Uninitialize(); } - m_sections.Clear(); + Sections.Clear(); } - public bool SetSelected(string id) + public bool SetSelected(GlobalId id) { - if (string.IsNullOrEmpty(id)) throw new ArgumentException("Value cannot be null or empty.", nameof(id)); + if (!id.IsValid()) throw new ArgumentException("Value should be valid.", nameof(id)); ClearSelected(); - if (m_sections.TryGetValue(id, out DebugUISection section)) + if (Sections.TryGet(id, out DebugUISection section)) { m_selected = id; - section.Select(); + section.Select(); return false; } @@ -108,12 +84,12 @@ public void ClearSelected() { if (HasSelected) { - if (m_sections.TryGetValue(m_selected, out DebugUISection section)) + if (Sections.TryGet(Selected, out DebugUISection section)) { section.Deselect(); } - m_selected = string.Empty; + m_selected = default; } } @@ -132,7 +108,7 @@ protected override void OnDrawGUILayout() if (HasSelected) { - if (m_sections.TryGetValue(Selected, out DebugUISection section)) + if (Sections.TryGet(Selected, out DebugUISection section)) { section.DrawGUILayout(); } @@ -157,7 +133,7 @@ private string OnGetSelectedDisplayName() { if (HasSelected) { - return m_sections.TryGetValue(Selected, out DebugUISection section) + return Sections.TryGet(Selected, out DebugUISection section) ? section.DisplayName : "Unknown"; } @@ -171,9 +147,9 @@ private DebugUIMenu OnMenuSectionsCreate() menu.Add("None", !HasSelected, m_onMenuItemHandler); - foreach (KeyValuePair pair in m_sections) + foreach ((GlobalId id, DebugUISection section) in Sections) { - menu.Add(pair.Value.DisplayName, m_selected == pair.Key, m_onMenuItemHandler, pair.Key); + menu.Add(section.DisplayName, HasSelected && Selected == id, m_onMenuItemHandler, id); } return menu; @@ -183,7 +159,7 @@ private void OnMenuSectionsSelected(DebugUIMenuItem item) { if (item.HasValue) { - string id = item.GetValue(); + var id = item.GetValue(); SetSelected(id); } diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDrawerAsset.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDrawerAsset.cs index 04c193c..aa8b3ee 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDrawerAsset.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDrawerAsset.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using UGF.EditorTools.Runtime.IMGUI.AssetReferences; +using UGF.EditorTools.Runtime.Assets; using UnityEngine; namespace UGF.DebugTools.Runtime.UI.Sections @@ -10,14 +10,14 @@ public class DebugUISectionDrawerAsset : DebugUIDrawerAsset [SerializeField] private float m_width = 200F; [SerializeField] private float m_height = 200F; [SerializeField] private DebugUISectionAlignment m_alignment = DebugUISectionAlignment.Right; - [SerializeField] private List> m_sections = new List>(); + [SerializeField] private List> m_sections = new List>(); public float Width { get { return m_width; } set { m_width = value; } } public float Height { get { return m_height; } set { m_height = value; } } public DebugUISectionAlignment Alignment { get { return m_alignment; } set { m_alignment = value; } } - public List> Sections { get { return m_sections; } } + public List> Sections { get { return m_sections; } } - protected override IDebugUIDrawer OnBuild() + protected override DebugUIDrawer OnBuild() { var drawer = new DebugUISectionDrawer { @@ -27,10 +27,9 @@ protected override IDebugUIDrawer OnBuild() for (int i = 0; i < m_sections.Count; i++) { - AssetReference reference = m_sections[i]; - DebugUISection section = reference.Asset.Build(); + AssetIdReference reference = m_sections[i]; - drawer.Add(reference.Guid, section); + drawer.Sections.Add(reference.Guid, reference.Asset.Build()); } return drawer; diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionOptions.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionOptions.cs index 4bb1e5e..3fad5a2 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionOptions.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionOptions.cs @@ -18,7 +18,7 @@ protected override void OnInitialize() { base.OnInitialize(); - if (DebugUI.Drawer.TryGet(out DebugUISectionDrawer drawer)) + if (DebugUI.Provider.Drawers.TryGet(out DebugUISectionDrawer drawer)) { m_drawer = drawer; } From 7d4444ef4e0a777561cc2099987638a697ed665e Mon Sep 17 00:00:00 2001 From: Vorobey Date: Tue, 13 Feb 2024 15:39:58 +0300 Subject: [PATCH 06/15] Remove editor test assembly --- Assets/UGF.DebugTools.Editor.Tests.meta | 8 -------- .../UGF.DebugTools.Editor.Tests.asmdef | 19 ------------------- .../UGF.DebugTools.Editor.Tests.asmdef.meta | 7 ------- 3 files changed, 34 deletions(-) delete mode 100644 Assets/UGF.DebugTools.Editor.Tests.meta delete mode 100644 Assets/UGF.DebugTools.Editor.Tests/UGF.DebugTools.Editor.Tests.asmdef delete mode 100644 Assets/UGF.DebugTools.Editor.Tests/UGF.DebugTools.Editor.Tests.asmdef.meta diff --git a/Assets/UGF.DebugTools.Editor.Tests.meta b/Assets/UGF.DebugTools.Editor.Tests.meta deleted file mode 100644 index fd132b7..0000000 --- a/Assets/UGF.DebugTools.Editor.Tests.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 508474870cb0c3941a610cfc0f9c42ba -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UGF.DebugTools.Editor.Tests/UGF.DebugTools.Editor.Tests.asmdef b/Assets/UGF.DebugTools.Editor.Tests/UGF.DebugTools.Editor.Tests.asmdef deleted file mode 100644 index fc556df..0000000 --- a/Assets/UGF.DebugTools.Editor.Tests/UGF.DebugTools.Editor.Tests.asmdef +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "UGF.DebugTools.Editor.Tests", - "rootNamespace": "", - "references": [ - "GUID:37dddc4e4de3de84f81310a1d1cd5e2c", - "GUID:1f4c615d41bc4894194a462406bb646e" - ], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": true, - "precompiledReferences": [ - "nunit.framework.dll" - ], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} \ No newline at end of file diff --git a/Assets/UGF.DebugTools.Editor.Tests/UGF.DebugTools.Editor.Tests.asmdef.meta b/Assets/UGF.DebugTools.Editor.Tests/UGF.DebugTools.Editor.Tests.asmdef.meta deleted file mode 100644 index ee3ed07..0000000 --- a/Assets/UGF.DebugTools.Editor.Tests/UGF.DebugTools.Editor.Tests.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 0b86493d4d3d48a4f8fecd849abd062d -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: From d813e3865e03ee6a075405e2b02948c7f9dfcf3b Mon Sep 17 00:00:00 2001 From: Vorobey Date: Tue, 13 Feb 2024 15:48:25 +0300 Subject: [PATCH 07/15] Change tests --- Assets/Scenes/Empty.unity | 16 ++------- .../New Debug UI Section Drawer Asset.asset | 26 -------------- ... Debug UI Section Options Asset.asset.meta | 8 ----- ...g UI Section Skin Samples Asset.asset.meta | 8 ----- ...ew Debug UI Section Skins Asset.asset.meta | 8 ----- .../Resources.meta | 8 +++++ .../DebugGLOptionsSection.asset} | 2 +- .../DebugGLOptionsSection.asset.meta} | 2 +- .../Resources/DebugGLProvider.asset | 18 ++++++++++ .../DebugGLProvider.asset.meta} | 2 +- .../DebugUIFunctionDrawer.asset} | 3 +- .../DebugUIFunctionDrawer.asset.meta} | 2 +- .../DebugUIPanelDrawer.asset} | 3 +- .../DebugUIPanelDrawer.asset.meta} | 2 +- .../Resources/DebugUIProvider.asset | 30 ++++++++++++++++ .../Resources/DebugUIProvider.asset.meta | 8 +++++ .../Resources/DebugUISectionDrawer.asset | 34 +++++++++++++++++++ .../Resources/DebugUISectionDrawer.asset.meta | 8 +++++ .../DebugUISectionOptions.asset} | 2 +- .../DebugUISectionOptions.asset.meta | 8 +++++ .../DebugUISectionSkinSamples.asset} | 2 +- .../DebugUISectionSkinSamples.asset.meta | 8 +++++ .../DebugUISectionSkins.asset} | 2 +- .../Resources/DebugUISectionSkins.asset.meta | 8 +++++ 24 files changed, 144 insertions(+), 74 deletions(-) delete mode 100644 Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Drawer Asset.asset delete mode 100644 Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Options Asset.asset.meta delete mode 100644 Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skin Samples Asset.asset.meta delete mode 100644 Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skins Asset.asset.meta create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/Resources.meta rename Assets/UGF.DebugTools.Runtime.Tests/{New Debug GL Options Section Asset.asset => Resources/DebugGLOptionsSection.asset} (89%) rename Assets/UGF.DebugTools.Runtime.Tests/{New Debug UI Panel Drawer Asset.asset.meta => Resources/DebugGLOptionsSection.asset.meta} (79%) create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugGLProvider.asset rename Assets/UGF.DebugTools.Runtime.Tests/{New Debug GL Options Section Asset.asset.meta => Resources/DebugGLProvider.asset.meta} (79%) rename Assets/UGF.DebugTools.Runtime.Tests/{New Debug UI Function Drawer Asset.asset => Resources/DebugUIFunctionDrawer.asset} (89%) rename Assets/UGF.DebugTools.Runtime.Tests/{New Debug UI Section Drawer Asset.asset.meta => Resources/DebugUIFunctionDrawer.asset.meta} (79%) rename Assets/UGF.DebugTools.Runtime.Tests/{New Debug UI Panel Drawer Asset.asset => Resources/DebugUIPanelDrawer.asset} (89%) rename Assets/UGF.DebugTools.Runtime.Tests/{New Debug UI Function Drawer Asset.asset.meta => Resources/DebugUIPanelDrawer.asset.meta} (79%) create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIProvider.asset create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIProvider.asset.meta create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionDrawer.asset create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionDrawer.asset.meta rename Assets/UGF.DebugTools.Runtime.Tests/{New Debug UI Section Options Asset.asset => Resources/DebugUISectionOptions.asset} (89%) create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionOptions.asset.meta rename Assets/UGF.DebugTools.Runtime.Tests/{New Debug UI Section Skin Samples Asset.asset => Resources/DebugUISectionSkinSamples.asset} (88%) create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkinSamples.asset.meta rename Assets/UGF.DebugTools.Runtime.Tests/{New Debug UI Section Skins Asset.asset => Resources/DebugUISectionSkins.asset} (92%) create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkins.asset.meta diff --git a/Assets/Scenes/Empty.unity b/Assets/Scenes/Empty.unity index 819bfdd..ed4e62a 100644 --- a/Assets/Scenes/Empty.unity +++ b/Assets/Scenes/Empty.unity @@ -246,10 +246,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f703d31518bf42139c3e84790d308364, type: 3} m_Name: m_EditorClassIdentifier: - m_enable: 1 - m_defaultShapes: 1 - m_defaultMaterial: {fileID: 0} - m_shapes: [] + m_provider: {fileID: 11400000, guid: bfa8b04d346b5ac4db074bff6c9e7f79, type: 2} --- !u!1 &770230239 GameObject: m_ObjectHideFlags: 0 @@ -294,16 +291,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: cc789d3dfe8e4c90ae18d29e6a687166, type: 3} m_Name: m_EditorClassIdentifier: - m_enable: 1 - m_scale: 2 - m_skin: {fileID: 11400000, guid: 4346a5dd01e15a745b7d3df2ba5ab6d3, type: 2} - m_drawers: - - m_guid: f856bfcfa6327534fbdcfb32e09bad6f - m_asset: {fileID: 11400000, guid: f856bfcfa6327534fbdcfb32e09bad6f, type: 2} - - m_guid: e22946bc75712b245899bc6dfb0c8498 - m_asset: {fileID: 11400000, guid: e22946bc75712b245899bc6dfb0c8498, type: 2} - - m_guid: 2c3a2510c22cba645ac071cc0c57d937 - m_asset: {fileID: 11400000, guid: 2c3a2510c22cba645ac071cc0c57d937, type: 2} + m_provider: {fileID: 11400000, guid: 86583775dadcab140bb014903c0da5e9, type: 2} --- !u!1 &1188849071 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Drawer Asset.asset b/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Drawer Asset.asset deleted file mode 100644 index 6eda3a3..0000000 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Drawer Asset.asset +++ /dev/null @@ -1,26 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e42efd3d2cfe48488c9be47c649411d2, type: 3} - m_Name: New Debug UI Section Drawer Asset - m_EditorClassIdentifier: - m_width: 200 - m_height: 200 - m_alignment: 2 - m_sections: - - m_guid: 60a9038347e38bf4b83684852fa42041 - m_asset: {fileID: 11400000, guid: 60a9038347e38bf4b83684852fa42041, type: 2} - - m_guid: abf62bc648755db4681bd9e0dee115ba - m_asset: {fileID: 11400000, guid: abf62bc648755db4681bd9e0dee115ba, type: 2} - - m_guid: b78f2462ac2317f4d822640421fd7bc9 - m_asset: {fileID: 11400000, guid: b78f2462ac2317f4d822640421fd7bc9, type: 2} - - m_guid: 464344f42daca684884fa03e4362fc2d - m_asset: {fileID: 11400000, guid: 464344f42daca684884fa03e4362fc2d, type: 2} diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Options Asset.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Options Asset.asset.meta deleted file mode 100644 index 904ae78..0000000 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Options Asset.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 60a9038347e38bf4b83684852fa42041 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skin Samples Asset.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skin Samples Asset.asset.meta deleted file mode 100644 index 13bb157..0000000 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skin Samples Asset.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b78f2462ac2317f4d822640421fd7bc9 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skins Asset.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skins Asset.asset.meta deleted file mode 100644 index b9ef243..0000000 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skins Asset.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: abf62bc648755db4681bd9e0dee115ba -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources.meta b/Assets/UGF.DebugTools.Runtime.Tests/Resources.meta new file mode 100644 index 0000000..984bc4a --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 13bdcb628b0d271478fafb993f8e5d1f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug GL Options Section Asset.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugGLOptionsSection.asset similarity index 89% rename from Assets/UGF.DebugTools.Runtime.Tests/New Debug GL Options Section Asset.asset rename to Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugGLOptionsSection.asset index 620163f..023d951 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug GL Options Section Asset.asset +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugGLOptionsSection.asset @@ -10,5 +10,5 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 2fa68432b86f4196b9ae14b28fa6c4fc, type: 3} - m_Name: New Debug GL Options Section Asset + m_Name: DebugGLOptionsSection m_EditorClassIdentifier: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Panel Drawer Asset.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugGLOptionsSection.asset.meta similarity index 79% rename from Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Panel Drawer Asset.asset.meta rename to Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugGLOptionsSection.asset.meta index 6f29bc9..5669e71 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Panel Drawer Asset.asset.meta +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugGLOptionsSection.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e22946bc75712b245899bc6dfb0c8498 +guid: 6141e530902fa7f40a11e5e66deab7e9 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugGLProvider.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugGLProvider.asset new file mode 100644 index 0000000..f8d2777 --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugGLProvider.asset @@ -0,0 +1,18 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3b5a8ccbb9da4c599c1ba7f1ba669a22, type: 3} + m_Name: DebugGLProvider + m_EditorClassIdentifier: + m_enable: 1 + m_defaultShapes: 1 + m_defaultMaterial: {fileID: 0} + m_shapes: [] diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug GL Options Section Asset.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugGLProvider.asset.meta similarity index 79% rename from Assets/UGF.DebugTools.Runtime.Tests/New Debug GL Options Section Asset.asset.meta rename to Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugGLProvider.asset.meta index 79efc7b..98c6679 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug GL Options Section Asset.asset.meta +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugGLProvider.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 464344f42daca684884fa03e4362fc2d +guid: bfa8b04d346b5ac4db074bff6c9e7f79 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Function Drawer Asset.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIFunctionDrawer.asset similarity index 89% rename from Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Function Drawer Asset.asset rename to Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIFunctionDrawer.asset index 41ea56d..2cf53ff 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Function Drawer Asset.asset +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIFunctionDrawer.asset @@ -10,7 +10,8 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d86acfc259b442718b8f5090e0b658d6, type: 3} - m_Name: New Debug UI Function Drawer Asset + m_Name: DebugUIFunctionDrawer m_EditorClassIdentifier: m_display: 1 m_width: 200 + m_functions: [] diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Drawer Asset.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIFunctionDrawer.asset.meta similarity index 79% rename from Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Drawer Asset.asset.meta rename to Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIFunctionDrawer.asset.meta index 5f575a2..b0be1e1 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Drawer Asset.asset.meta +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIFunctionDrawer.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2c3a2510c22cba645ac071cc0c57d937 +guid: d188875287b7d3a4182a0c5c4692c15d NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Panel Drawer Asset.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIPanelDrawer.asset similarity index 89% rename from Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Panel Drawer Asset.asset rename to Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIPanelDrawer.asset index 6e6289f..f6748b7 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Panel Drawer Asset.asset +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIPanelDrawer.asset @@ -10,5 +10,6 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1ae4bc8fa71d48849ee52ed74f5ca4a0, type: 3} - m_Name: New Debug UI Panel Drawer Asset + m_Name: DebugUIPanelDrawer m_EditorClassIdentifier: + m_display: 0 diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Function Drawer Asset.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIPanelDrawer.asset.meta similarity index 79% rename from Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Function Drawer Asset.asset.meta rename to Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIPanelDrawer.asset.meta index c771f51..5a33eba 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Function Drawer Asset.asset.meta +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIPanelDrawer.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f856bfcfa6327534fbdcfb32e09bad6f +guid: a63636eeeb7a3e843b317f12e3e6bb45 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIProvider.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIProvider.asset new file mode 100644 index 0000000..47e262a --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIProvider.asset @@ -0,0 +1,30 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2d0fa9b121f64e1f83b28ca10e31f731, type: 3} + m_Name: DebugUIProvider + m_EditorClassIdentifier: + m_enable: 1 + m_scale: 1 + m_skin: {fileID: 11400000, guid: 4346a5dd01e15a745b7d3df2ba5ab6d3, type: 2} + m_drawers: + - m_guid: + m_first: 15250463461747492690 + m_second: 6755841746922121752 + m_asset: {fileID: 11400000, guid: d188875287b7d3a4182a0c5c4692c15d, type: 2} + - m_guid: + m_first: 4504984439284446958 + m_second: 5024863672204210491 + m_asset: {fileID: 11400000, guid: a63636eeeb7a3e843b317f12e3e6bb45, type: 2} + - m_guid: + m_first: 18425378906131320046 + m_second: 8196283146458756153 + m_asset: {fileID: 11400000, guid: 47eeccee187effb439f4318f180cbf71, type: 2} diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIProvider.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIProvider.asset.meta new file mode 100644 index 0000000..da0d53a --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIProvider.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 86583775dadcab140bb014903c0da5e9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionDrawer.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionDrawer.asset new file mode 100644 index 0000000..e415538 --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionDrawer.asset @@ -0,0 +1,34 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e42efd3d2cfe48488c9be47c649411d2, type: 3} + m_Name: DebugUISectionDrawer + m_EditorClassIdentifier: + m_width: 200 + m_height: 200 + m_alignment: 2 + m_sections: + - m_guid: + m_first: 12102456631820936496 + m_second: 16841187089321365770 + m_asset: {fileID: 11400000, guid: 6141e530902fa7f40a11e5e66deab7e9, type: 2} + - m_guid: + m_first: 14502811578695218782 + m_second: 589058534654966456 + m_asset: {fileID: 11400000, guid: a88cf65e564ac944b87a05c69dc12c08, type: 2} + - m_guid: + m_first: 8679659793457567961 + m_second: 5883057465889210745 + m_asset: {fileID: 11400000, guid: 684758d9589878747941896f98d1a451, type: 2} + - m_guid: + m_first: 13939891763610961395 + m_second: 8918237313160289977 + m_asset: {fileID: 11400000, guid: c96cc5f371b3c174b99e8de195f1c37b, type: 2} diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionDrawer.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionDrawer.asset.meta new file mode 100644 index 0000000..82ce26a --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionDrawer.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 47eeccee187effb439f4318f180cbf71 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Options Asset.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionOptions.asset similarity index 89% rename from Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Options Asset.asset rename to Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionOptions.asset index f596d90..8a25c22 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Options Asset.asset +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionOptions.asset @@ -10,5 +10,5 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fb5e8f967784494581466902f18adcb3, type: 3} - m_Name: New Debug UI Section Options Asset + m_Name: DebugUISectionOptions m_EditorClassIdentifier: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionOptions.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionOptions.asset.meta new file mode 100644 index 0000000..53c8536 --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionOptions.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a88cf65e564ac944b87a05c69dc12c08 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skin Samples Asset.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkinSamples.asset similarity index 88% rename from Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skin Samples Asset.asset rename to Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkinSamples.asset index ff7f3f1..315b24b 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skin Samples Asset.asset +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkinSamples.asset @@ -10,5 +10,5 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1cfaf4b6045d4d05b8a7b8e2cfc0de09, type: 3} - m_Name: New Debug UI Section Skin Samples Asset + m_Name: DebugUISectionSkinSamples m_EditorClassIdentifier: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkinSamples.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkinSamples.asset.meta new file mode 100644 index 0000000..4d846db --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkinSamples.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c96cc5f371b3c174b99e8de195f1c37b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skins Asset.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkins.asset similarity index 92% rename from Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skins Asset.asset rename to Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkins.asset index 9de11c1..58f6bcd 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/New Debug UI Section Skins Asset.asset +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkins.asset @@ -10,7 +10,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 65cfcf55c37249c19cdd8a8c53be4a9f, type: 3} - m_Name: New Debug UI Section Skins Asset + m_Name: DebugUISectionSkins m_EditorClassIdentifier: m_skins: - {fileID: 11400000, guid: 4346a5dd01e15a745b7d3df2ba5ab6d3, type: 2} diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkins.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkins.asset.meta new file mode 100644 index 0000000..05987ce --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkins.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 684758d9589878747941896f98d1a451 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From 711554675622889315868139def264ba128048d2 Mon Sep 17 00:00:00 2001 From: Vorobey Date: Tue, 13 Feb 2024 15:56:01 +0300 Subject: [PATCH 08/15] Change tests --- .../Resources/DebugUIFunctionDrawer.asset | 3 ++- .../Resources/TestDebugUIFunction.asset | 15 +++++++++++++++ .../Resources/TestDebugUIFunction.asset.meta | 8 ++++++++ ...sset => TestDebugUISectionSkinSamples.asset} | 2 +- ...=> TestDebugUISectionSkinSamples.asset.meta} | 0 .../TestDebugUIFunction.cs | 17 +++++++++++++++++ .../TestDebugUIFunction.cs.meta | 3 +++ .../TestDebugUIFunctionAsset.cs | 14 ++++++++++++++ .../TestDebugUIFunctionAsset.cs.meta | 3 +++ .../TestDebugUISectionSkinSamples.cs | 7 ++++--- .../TestDebugUISectionSkinSamples.cs.meta | 0 .../TestDebugUISectionSkinSamplesAsset.cs | 14 ++++++++++++++ .../TestDebugUISectionSkinSamplesAsset.cs.meta | 0 .../DebugUISectionSkinSamplesAsset.cs | 13 ------------- 14 files changed, 81 insertions(+), 18 deletions(-) create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/Resources/TestDebugUIFunction.asset create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/Resources/TestDebugUIFunction.asset.meta rename Assets/UGF.DebugTools.Runtime.Tests/Resources/{DebugUISectionSkinSamples.asset => TestDebugUISectionSkinSamples.asset} (90%) rename Assets/UGF.DebugTools.Runtime.Tests/Resources/{DebugUISectionSkinSamples.asset.meta => TestDebugUISectionSkinSamples.asset.meta} (100%) create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunction.cs create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunction.cs.meta create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunctionAsset.cs create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunctionAsset.cs.meta rename Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamples.cs => Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamples.cs (95%) rename Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamples.cs.meta => Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamples.cs.meta (100%) create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamplesAsset.cs rename Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamplesAsset.cs.meta => Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamplesAsset.cs.meta (100%) delete mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamplesAsset.cs diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIFunctionDrawer.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIFunctionDrawer.asset index 2cf53ff..4b6b133 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIFunctionDrawer.asset +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIFunctionDrawer.asset @@ -14,4 +14,5 @@ MonoBehaviour: m_EditorClassIdentifier: m_display: 1 m_width: 200 - m_functions: [] + m_functions: + - {fileID: 11400000, guid: 40819c68b734bda4eb58f986cd9dddb1, type: 2} diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/TestDebugUIFunction.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/TestDebugUIFunction.asset new file mode 100644 index 0000000..43a096b --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/TestDebugUIFunction.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f7e98cce9a954809b83350ff23309523, type: 3} + m_Name: TestDebugUIFunction + m_EditorClassIdentifier: + m_groupName: Tests diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/TestDebugUIFunction.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/Resources/TestDebugUIFunction.asset.meta new file mode 100644 index 0000000..5f0d555 --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/TestDebugUIFunction.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 40819c68b734bda4eb58f986cd9dddb1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkinSamples.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/TestDebugUISectionSkinSamples.asset similarity index 90% rename from Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkinSamples.asset rename to Assets/UGF.DebugTools.Runtime.Tests/Resources/TestDebugUISectionSkinSamples.asset index 315b24b..36889f7 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkinSamples.asset +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/TestDebugUISectionSkinSamples.asset @@ -10,5 +10,5 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1cfaf4b6045d4d05b8a7b8e2cfc0de09, type: 3} - m_Name: DebugUISectionSkinSamples + m_Name: TestDebugUISectionSkinSamples m_EditorClassIdentifier: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkinSamples.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/Resources/TestDebugUISectionSkinSamples.asset.meta similarity index 100% rename from Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionSkinSamples.asset.meta rename to Assets/UGF.DebugTools.Runtime.Tests/Resources/TestDebugUISectionSkinSamples.asset.meta diff --git a/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunction.cs b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunction.cs new file mode 100644 index 0000000..d256340 --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunction.cs @@ -0,0 +1,17 @@ +using UGF.DebugTools.Runtime.UI.Functions; +using UnityEngine; + +namespace UGF.DebugTools.Runtime.Tests +{ + public class TestDebugUIFunction : DebugUIFunction + { + public TestDebugUIFunction() : base(new GUIContent("Test")) + { + } + + protected override void OnExecute() + { + Debug.LogWarning("Test"); + } + } +} diff --git a/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunction.cs.meta b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunction.cs.meta new file mode 100644 index 0000000..76adc99 --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunction.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2ed171e0c9cc42f7a8705d4494c749db +timeCreated: 1707828557 \ No newline at end of file diff --git a/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunctionAsset.cs b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunctionAsset.cs new file mode 100644 index 0000000..4faf5c9 --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunctionAsset.cs @@ -0,0 +1,14 @@ +using UGF.DebugTools.Runtime.UI.Functions; +using UnityEngine; + +namespace UGF.DebugTools.Runtime.Tests +{ + [CreateAssetMenu(menuName = "Tests/TestDebugUIFunctionAsset")] + public class TestDebugUIFunctionAsset : DebugUIFunctionAsset + { + protected override DebugUIFunction OnBuild() + { + return new TestDebugUIFunction(); + } + } +} diff --git a/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunctionAsset.cs.meta b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunctionAsset.cs.meta new file mode 100644 index 0000000..df72373 --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUIFunctionAsset.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f7e98cce9a954809b83350ff23309523 +timeCreated: 1707828578 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamples.cs b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamples.cs similarity index 95% rename from Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamples.cs rename to Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamples.cs index 2581979..6b827aa 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamples.cs +++ b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamples.cs @@ -1,11 +1,12 @@ using System; using UGF.DebugTools.Runtime.UI.Menu; using UGF.DebugTools.Runtime.UI.Scopes; +using UGF.DebugTools.Runtime.UI.Sections; using UnityEngine; -namespace UGF.DebugTools.Runtime.UI.Sections.Skins +namespace UGF.DebugTools.Runtime.Tests { - public class DebugUISectionSkinSamples : DebugUISection + public class TestDebugUISectionSkinSamples : DebugUISection { private readonly Func m_onMenuCreate; private readonly DebugUIMenuItemHandler m_onMenuItemHandler; @@ -22,7 +23,7 @@ public class DebugUISectionSkinSamples : DebugUISection private string m_delayedText2 = "Delayed Text 2"; private TypeCode m_enum; - public DebugUISectionSkinSamples() : base("UI Skin Samples") + public TestDebugUISectionSkinSamples() : base("UI Skin Samples") { m_onMenuCreate = OnMenuCreate; m_onMenuItemHandler = OnMenuSelect; diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamples.cs.meta b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamples.cs.meta similarity index 100% rename from Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamples.cs.meta rename to Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamples.cs.meta diff --git a/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamplesAsset.cs b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamplesAsset.cs new file mode 100644 index 0000000..c8d7fc0 --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamplesAsset.cs @@ -0,0 +1,14 @@ +using UGF.DebugTools.Runtime.UI.Sections; +using UnityEngine; + +namespace UGF.DebugTools.Runtime.Tests +{ + [CreateAssetMenu(menuName = "Tests/TestDebugUISectionSkinSamplesAsset")] + public class TestDebugUISectionSkinSamplesAsset : DebugUISectionAsset + { + protected override DebugUISection OnBuild() + { + return new TestDebugUISectionSkinSamples(); + } + } +} diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamplesAsset.cs.meta b/Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamplesAsset.cs.meta similarity index 100% rename from Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamplesAsset.cs.meta rename to Assets/UGF.DebugTools.Runtime.Tests/TestDebugUISectionSkinSamplesAsset.cs.meta diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamplesAsset.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamplesAsset.cs deleted file mode 100644 index e47a752..0000000 --- a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinSamplesAsset.cs +++ /dev/null @@ -1,13 +0,0 @@ -using UnityEngine; - -namespace UGF.DebugTools.Runtime.UI.Sections.Skins -{ - [CreateAssetMenu(menuName = "Unity Game Framework/Debug/Debug UI Skin Samples Section", order = 2000)] - public class DebugUISectionSkinSamplesAsset : DebugUISectionAsset - { - protected override DebugUISection OnBuild() - { - return new DebugUISectionSkinSamples(); - } - } -} From e2b55beabac399f746056f1541d4d80b5925f6b1 Mon Sep 17 00:00:00 2001 From: Vorobey Date: Tue, 13 Feb 2024 17:21:14 +0300 Subject: [PATCH 09/15] Add described classes --- .../Runtime/DebugUIDrawerDescribed.cs | 14 +++++++++++ .../Runtime/DebugUIDrawerDescribed.cs.meta | 3 +++ .../Runtime/DebugUIDrawerDescribedAsset.cs | 24 +++++++++++++++++++ .../DebugUIDrawerDescribedAsset.cs.meta | 3 +++ .../UI.Functions/DebugUIFunctionDescribed.cs | 15 ++++++++++++ .../DebugUIFunctionDescribed.cs.meta | 3 +++ .../DebugUIFunctionDescribedAsset.cs | 24 +++++++++++++++++++ .../DebugUIFunctionDescribedAsset.cs.meta | 3 +++ .../UI.Sections/DebugUISectionDescribed.cs | 14 +++++++++++ .../DebugUISectionDescribed.cs.meta | 3 +++ .../DebugUISectionDescribedAsset.cs | 24 +++++++++++++++++++ .../DebugUISectionDescribedAsset.cs.meta | 3 +++ 12 files changed, 133 insertions(+) create mode 100644 Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribed.cs create mode 100644 Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribed.cs.meta create mode 100644 Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribedAsset.cs create mode 100644 Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribedAsset.cs.meta create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribed.cs create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribed.cs.meta create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribedAsset.cs create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribedAsset.cs.meta create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribed.cs create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribed.cs.meta create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribedAsset.cs create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribedAsset.cs.meta diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribed.cs b/Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribed.cs new file mode 100644 index 0000000..8d240e6 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribed.cs @@ -0,0 +1,14 @@ +using System; + +namespace UGF.DebugTools.Runtime +{ + public abstract class DebugUIDrawerDescribed : DebugUIDrawer where TDescription : class + { + public TDescription Description { get; } + + protected DebugUIDrawerDescribed(TDescription description) + { + Description = description ?? throw new ArgumentNullException(nameof(description)); + } + } +} diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribed.cs.meta b/Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribed.cs.meta new file mode 100644 index 0000000..fdae97b --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribed.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 092ffc790b0a44ba822583a6278e4611 +timeCreated: 1707830833 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribedAsset.cs b/Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribedAsset.cs new file mode 100644 index 0000000..5b074c2 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribedAsset.cs @@ -0,0 +1,24 @@ +using System; + +namespace UGF.DebugTools.Runtime +{ + public abstract class DebugUIDrawerDescribedAsset : DebugUIDrawerAsset + where TDrawer : DebugUIDrawer + where TDescription : class + { + protected override DebugUIDrawer OnBuild() + { + TDescription description = OnBuildDescription(); + + if (description == null) + { + throw new ArgumentNullException(nameof(description)); + } + + return OnBuild(description); + } + + protected abstract TDescription OnBuildDescription(); + protected abstract TDrawer OnBuild(TDescription description); + } +} diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribedAsset.cs.meta b/Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribedAsset.cs.meta new file mode 100644 index 0000000..8ec939b --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/DebugUIDrawerDescribedAsset.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 10de9fdc980f46d097556d01ce5a33a8 +timeCreated: 1707830924 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribed.cs b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribed.cs new file mode 100644 index 0000000..ea0a556 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribed.cs @@ -0,0 +1,15 @@ +using System; +using UnityEngine; + +namespace UGF.DebugTools.Runtime.UI.Functions +{ + public abstract class DebugUIFunctionDescribed : DebugUIFunction where TDescription : class + { + public TDescription Description { get; } + + protected DebugUIFunctionDescribed(TDescription description, GUIContent content) : base(content) + { + Description = description ?? throw new ArgumentNullException(nameof(description)); + } + } +} diff --git a/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribed.cs.meta b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribed.cs.meta new file mode 100644 index 0000000..8bbc9a6 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribed.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: af23d9e1e700420d9b0ed25e8c958a81 +timeCreated: 1707831627 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribedAsset.cs b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribedAsset.cs new file mode 100644 index 0000000..16f9fad --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribedAsset.cs @@ -0,0 +1,24 @@ +using System; + +namespace UGF.DebugTools.Runtime.UI.Functions +{ + public abstract class DebugUIFunctionDescribedAsset : DebugUIFunctionAsset + where TFunction : DebugUIFunction + where TDescription : class + { + protected override DebugUIFunction OnBuild() + { + TDescription description = OnBuildDescription(); + + if (description == null) + { + throw new ArgumentNullException(nameof(description)); + } + + return OnBuild(description); + } + + protected abstract TDescription OnBuildDescription(); + protected abstract TFunction OnBuild(TDescription description); + } +} diff --git a/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribedAsset.cs.meta b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribedAsset.cs.meta new file mode 100644 index 0000000..8e98bec --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Functions/DebugUIFunctionDescribedAsset.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 685d6e73a98f4ec382260095eb87d6df +timeCreated: 1707831653 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribed.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribed.cs new file mode 100644 index 0000000..1cee2e1 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribed.cs @@ -0,0 +1,14 @@ +using System; + +namespace UGF.DebugTools.Runtime.UI.Sections +{ + public abstract class DebugUISectionDescribed : DebugUISection where TDescription : class + { + public TDescription Description { get; } + + protected DebugUISectionDescribed(TDescription description, string displayName) : base(displayName) + { + Description = description ?? throw new ArgumentNullException(nameof(description)); + } + } +} diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribed.cs.meta b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribed.cs.meta new file mode 100644 index 0000000..e89b2d8 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribed.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f3aabd838dbe477687a8843fc4999ebc +timeCreated: 1707831343 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribedAsset.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribedAsset.cs new file mode 100644 index 0000000..53b19de --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribedAsset.cs @@ -0,0 +1,24 @@ +using System; + +namespace UGF.DebugTools.Runtime.UI.Sections +{ + public abstract class DebugUISectionDescribedAsset : DebugUISectionAsset + where TSection : DebugUISection + where TDescription : class + { + protected override DebugUISection OnBuild() + { + TDescription description = OnBuildDescription(); + + if (description == null) + { + throw new ArgumentNullException(nameof(description)); + } + + return OnBuild(description); + } + + protected abstract TDescription OnBuildDescription(); + protected abstract TSection OnBuild(TDescription description); + } +} diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribedAsset.cs.meta b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribedAsset.cs.meta new file mode 100644 index 0000000..a1cfbee --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDescribedAsset.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d9c860e4d8144c15819e4c11299a7b25 +timeCreated: 1707831504 \ No newline at end of file From 86f687278fdcbbd1f43487c8e8f98caedc34563b Mon Sep 17 00:00:00 2001 From: Vorobey Date: Tue, 13 Feb 2024 17:21:46 +0300 Subject: [PATCH 10/15] Fix drawers --- .../Runtime/UI.Panels/DebugUIPanelDrawer.cs | 1 + .../UI.Sections/DebugUISectionDrawer.cs | 22 +++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Packages/UGF.DebugTools/Runtime/UI.Panels/DebugUIPanelDrawer.cs b/Packages/UGF.DebugTools/Runtime/UI.Panels/DebugUIPanelDrawer.cs index 7b7acdb..3be19c4 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Panels/DebugUIPanelDrawer.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Panels/DebugUIPanelDrawer.cs @@ -20,6 +20,7 @@ protected override void OnInitialize() } m_functionDisplay = DebugUI.AddFunction(DebugUI.DebugFunctionGroupName, "Panels Display", OnFunctionDisplay); + m_functionDisplay.Enabled = Display; } protected override void OnUninitialize() diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDrawer.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDrawer.cs index 59ed730..a2bd055 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDrawer.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections/DebugUISectionDrawer.cs @@ -37,6 +37,7 @@ protected override void OnInitialize() } m_functionDisplay = DebugUI.AddFunction(DebugUI.DebugFunctionGroupName, "Sections Display", OnFunctionDisplay); + m_functionDisplay.Enabled = Display; } protected override void OnUninitialize() @@ -99,7 +100,7 @@ protected override void OnUpdatePosition() Rect screen = DebugUIUtility.GetScreenRect(); - Position = GetPosition(screen, Alignment, Size); + Position = OnGetPosition(screen, Alignment, Size); } protected override void OnDrawGUILayout() @@ -176,18 +177,17 @@ private void OnFunctionDisplay(DebugUIFunction function) function.Enabled = Display; } - private Rect GetPosition(Rect screen, DebugUISectionAlignment alignment, Vector2 size) + private Rect OnGetPosition(Rect screen, DebugUISectionAlignment alignment, Vector2 size) { - switch (alignment) + return alignment switch { - case DebugUISectionAlignment.Top: return new Rect(0F, 0F, screen.width, size.y); - case DebugUISectionAlignment.Bottom: return new Rect(0F, screen.height - size.y, screen.width, size.y); - case DebugUISectionAlignment.Right: return new Rect(screen.width - size.x, 0F, size.x, screen.height); - case DebugUISectionAlignment.Left: return new Rect(0F, 0F, size.x, screen.height); - case DebugUISectionAlignment.Full: return new Rect(0F, 0F, screen.width, screen.height); - default: - throw new ArgumentOutOfRangeException(nameof(alignment), alignment, null); - } + DebugUISectionAlignment.Top => new Rect(0F, 0F, screen.width, size.y), + DebugUISectionAlignment.Bottom => new Rect(0F, screen.height - size.y, screen.width, size.y), + DebugUISectionAlignment.Right => new Rect(screen.width - size.x, 0F, size.x, screen.height), + DebugUISectionAlignment.Left => new Rect(0F, 0F, size.x, screen.height), + DebugUISectionAlignment.Full => new Rect(0F, 0F, screen.width, screen.height), + _ => throw new ArgumentOutOfRangeException(nameof(alignment), alignment, "Debug UI section alignment is unknown.") + }; } } } From 6543f869ee01c1bcdde5a7a115c0ee3cab31a329 Mon Sep 17 00:00:00 2001 From: Vorobey Date: Tue, 13 Feb 2024 17:22:21 +0300 Subject: [PATCH 11/15] Change skins section --- .../Runtime/{UI.Sections.Skins.meta => UI.Sections.Misc.meta} | 0 .../DebugUISectionSkins.cs | 2 +- .../DebugUISectionSkins.cs.meta | 0 .../DebugUISectionSkinsAsset.cs | 2 +- .../DebugUISectionSkinsAsset.cs.meta | 0 5 files changed, 2 insertions(+), 2 deletions(-) rename Packages/UGF.DebugTools/Runtime/{UI.Sections.Skins.meta => UI.Sections.Misc.meta} (100%) rename Packages/UGF.DebugTools/Runtime/{UI.Sections.Skins => UI.Sections.Misc}/DebugUISectionSkins.cs (94%) rename Packages/UGF.DebugTools/Runtime/{UI.Sections.Skins => UI.Sections.Misc}/DebugUISectionSkins.cs.meta (100%) rename Packages/UGF.DebugTools/Runtime/{UI.Sections.Skins => UI.Sections.Misc}/DebugUISectionSkinsAsset.cs (91%) rename Packages/UGF.DebugTools/Runtime/{UI.Sections.Skins => UI.Sections.Misc}/DebugUISectionSkinsAsset.cs.meta (100%) diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins.meta b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc.meta similarity index 100% rename from Packages/UGF.DebugTools/Runtime/UI.Sections.Skins.meta rename to Packages/UGF.DebugTools/Runtime/UI.Sections.Misc.meta diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkins.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUISectionSkins.cs similarity index 94% rename from Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkins.cs rename to Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUISectionSkins.cs index 92dd749..696f3c5 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkins.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUISectionSkins.cs @@ -3,7 +3,7 @@ using UGF.DebugTools.Runtime.UI.Menu; using UnityEngine; -namespace UGF.DebugTools.Runtime.UI.Sections.Skins +namespace UGF.DebugTools.Runtime.UI.Sections.Misc { public class DebugUISectionSkins : DebugUISection { diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkins.cs.meta b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUISectionSkins.cs.meta similarity index 100% rename from Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkins.cs.meta rename to Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUISectionSkins.cs.meta diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinsAsset.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUISectionSkinsAsset.cs similarity index 91% rename from Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinsAsset.cs rename to Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUISectionSkinsAsset.cs index 7c1f140..f7ecc63 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinsAsset.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUISectionSkinsAsset.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using UnityEngine; -namespace UGF.DebugTools.Runtime.UI.Sections.Skins +namespace UGF.DebugTools.Runtime.UI.Sections.Misc { [CreateAssetMenu(menuName = "Unity Game Framework/Debug/Debug UI Skin Section", order = 2000)] public class DebugUISectionSkinsAsset : DebugUISectionAsset diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinsAsset.cs.meta b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUISectionSkinsAsset.cs.meta similarity index 100% rename from Packages/UGF.DebugTools/Runtime/UI.Sections.Skins/DebugUISectionSkinsAsset.cs.meta rename to Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUISectionSkinsAsset.cs.meta From 7370fe5e73e9ef4c14a3265c7381e1939dca724e Mon Sep 17 00:00:00 2001 From: Vorobey Date: Tue, 13 Feb 2024 17:22:25 +0300 Subject: [PATCH 12/15] Update DebugUISectionSkinsAssetEditor.cs --- .../Editor/UI.Sections.Skins/DebugUISectionSkinsAssetEditor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/UGF.DebugTools/Editor/UI.Sections.Skins/DebugUISectionSkinsAssetEditor.cs b/Packages/UGF.DebugTools/Editor/UI.Sections.Skins/DebugUISectionSkinsAssetEditor.cs index 09fbb29..28bd20d 100644 --- a/Packages/UGF.DebugTools/Editor/UI.Sections.Skins/DebugUISectionSkinsAssetEditor.cs +++ b/Packages/UGF.DebugTools/Editor/UI.Sections.Skins/DebugUISectionSkinsAssetEditor.cs @@ -1,4 +1,4 @@ -using UGF.DebugTools.Runtime.UI.Sections.Skins; +using UGF.DebugTools.Runtime.UI.Sections.Misc; using UGF.EditorTools.Editor.IMGUI; using UGF.EditorTools.Editor.IMGUI.Scopes; using UnityEditor; From b2d0ab53d737cb299317d9446e0f96f5d9a4e8d0 Mon Sep 17 00:00:00 2001 From: Vorobey Date: Tue, 13 Feb 2024 18:21:20 +0300 Subject: [PATCH 13/15] Change DebugUIWindowDrawer --- .../UGF.DebugTools/Runtime/DebugUI.Panel.cs | 5 +- .../Runtime/DebugUIWindowDrawer.cs | 67 ++++++++++++++++--- .../Runtime/DebugUIWindowType.cs | 10 +++ .../Runtime/DebugUIWindowType.cs.meta | 3 + .../Runtime/UI.Menu/DebugUIMenuDrawer.cs | 2 +- 5 files changed, 76 insertions(+), 11 deletions(-) create mode 100644 Packages/UGF.DebugTools/Runtime/DebugUIWindowType.cs create mode 100644 Packages/UGF.DebugTools/Runtime/DebugUIWindowType.cs.meta diff --git a/Packages/UGF.DebugTools/Runtime/DebugUI.Panel.cs b/Packages/UGF.DebugTools/Runtime/DebugUI.Panel.cs index ce6482b..4e04d91 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugUI.Panel.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugUI.Panel.cs @@ -31,7 +31,10 @@ public static void AddPanel(DebugUIPanel panel) public static bool RemovePanel(DebugUIPanel panel) { - panel.Uninitialize(); + if (panel.IsInitialized) + { + panel.Uninitialize(); + } return Provider.Drawers.Get().Panels.Remove(panel); } diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIWindowDrawer.cs b/Packages/UGF.DebugTools/Runtime/DebugUIWindowDrawer.cs index c06a989..6cc2ec7 100644 --- a/Packages/UGF.DebugTools/Runtime/DebugUIWindowDrawer.cs +++ b/Packages/UGF.DebugTools/Runtime/DebugUIWindowDrawer.cs @@ -8,13 +8,15 @@ public abstract class DebugUIWindowDrawer : DebugUIDrawer { public bool Display { get; set; } public bool DisplayBackground { get; set; } = true; + public bool Enabled { get; set; } = true; public Rect Position { get; set; } = new Rect(0F, 0F, 200F, 200F); - public bool IsModal { get; set; } + public bool ScrollEnabled { get; set; } = true; + public Vector2 Scroll { get; set; } + public DebugUIWindowType WindowType { get; set; } = DebugUIWindowType.Default; public int WindowId { get { return m_windowId ?? throw new ArgumentException("Value not specified."); } } private readonly GUI.WindowFunction m_windowFunction; private int? m_windowId; - private Vector2 m_scroll; protected DebugUIWindowDrawer() { @@ -41,6 +43,15 @@ public void UnFocus() GUI.UnfocusWindow(); } + public void SetSize(Vector2 size) + { + Rect position = Position; + + position.size = size; + + Position = position; + } + protected override void OnDrawGUI() { if (Display) @@ -49,9 +60,40 @@ protected override void OnDrawGUI() GUIStyle style = DisplayBackground ? GUI.skin.window : GUIStyle.none; - Position = IsModal - ? GUI.ModalWindow(WindowId, Position, m_windowFunction, GUIContent.none, style) - : GUI.Window(WindowId, Position, m_windowFunction, GUIContent.none, style); + using (new DebugUIEnabledScope(Enabled)) + { + switch (WindowType) + { + case DebugUIWindowType.Default: + { + Position = GUI.Window(WindowId, Position, m_windowFunction, GUIContent.none, style); + break; + } + case DebugUIWindowType.Modal: + { + Position = GUI.ModalWindow(WindowId, Position, m_windowFunction, GUIContent.none, style); + break; + } + case DebugUIWindowType.Layout: + { + Position = GUILayout.Window(WindowId, Position, m_windowFunction, GUIContent.none, style); + break; + } + case DebugUIWindowType.Area: + { + using (new DebugUILayoutAreaScope(Position, GUIContent.none, style)) + { + OnWindow(WindowId); + } + + break; + } + default: + { + throw new ArgumentOutOfRangeException(nameof(WindowType), WindowType, "Debug UI window type is unknown."); + } + } + } } } @@ -61,13 +103,20 @@ protected virtual void OnUpdatePosition() protected abstract void OnDrawGUILayout(); - private void OnWindow(int id) + private void OnWindow(int _) { - using (var view = new DebugUIScrollViewScope(m_scroll)) + if (ScrollEnabled) { - OnDrawGUILayout(); + using (var view = new DebugUIScrollViewScope(Scroll)) + { + OnDrawGUILayout(); - m_scroll = view.ScrollPosition; + Scroll = view.ScrollPosition; + } + } + else + { + OnDrawGUILayout(); } } } diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIWindowType.cs b/Packages/UGF.DebugTools/Runtime/DebugUIWindowType.cs new file mode 100644 index 0000000..0496c62 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/DebugUIWindowType.cs @@ -0,0 +1,10 @@ +namespace UGF.DebugTools.Runtime +{ + public enum DebugUIWindowType + { + Default = 0, + Modal = 1, + Layout = 2, + Area = 3 + } +} diff --git a/Packages/UGF.DebugTools/Runtime/DebugUIWindowType.cs.meta b/Packages/UGF.DebugTools/Runtime/DebugUIWindowType.cs.meta new file mode 100644 index 0000000..ab00342 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/DebugUIWindowType.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: fd5e6594dfdc4021a1b6d42498bb47b7 +timeCreated: 1707835380 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenuDrawer.cs b/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenuDrawer.cs index 4e0e52d..794e5c4 100644 --- a/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenuDrawer.cs +++ b/Packages/UGF.DebugTools/Runtime/UI.Menu/DebugUIMenuDrawer.cs @@ -17,7 +17,7 @@ public class DebugUIMenuDrawer : DebugUIWindowDrawer public DebugUIMenuDrawer() { DisplayBackground = false; - IsModal = true; + WindowType = DebugUIWindowType.Modal; } public void SetMenu(DebugUIMenu menu) From d47776fb648c5f9107bf3be76319ae16c0e8deea Mon Sep 17 00:00:00 2001 From: Vorobey Date: Tue, 13 Feb 2024 18:23:35 +0300 Subject: [PATCH 14/15] Add DebugUIStatsSection --- .../UI.Sections.Misc/DebugUIStatsAlignment.cs | 10 ++++ .../DebugUIStatsAlignment.cs.meta | 3 + .../UI.Sections.Misc/DebugUIStatsPanel.cs | 56 ++++++++++++++++++ .../DebugUIStatsPanel.cs.meta | 3 + .../UI.Sections.Misc/DebugUIStatsSection.cs | 59 +++++++++++++++++++ .../DebugUIStatsSection.cs.meta | 3 + .../DebugUIStatsSectionAsset.cs | 36 +++++++++++ .../DebugUIStatsSectionAsset.cs.meta | 3 + .../DebugUIStatsSectionDescription.cs | 20 +++++++ .../DebugUIStatsSectionDescription.cs.meta | 3 + 10 files changed, 196 insertions(+) create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsAlignment.cs create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsAlignment.cs.meta create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsPanel.cs create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsPanel.cs.meta create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSection.cs create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSection.cs.meta create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionAsset.cs create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionAsset.cs.meta create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionDescription.cs create mode 100644 Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionDescription.cs.meta diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsAlignment.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsAlignment.cs new file mode 100644 index 0000000..c2f7e68 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsAlignment.cs @@ -0,0 +1,10 @@ +namespace UGF.DebugTools.Runtime.UI.Sections.Misc +{ + public enum DebugUIStatsAlignment + { + TopRight = 0, + BottomRight = 1, + BottomLeft = 2, + TopLeft = 3 + } +} diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsAlignment.cs.meta b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsAlignment.cs.meta new file mode 100644 index 0000000..1c1ef68 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsAlignment.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e060b249b1064caeb41156aee34a99c7 +timeCreated: 1707831723 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsPanel.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsPanel.cs new file mode 100644 index 0000000..6b536e8 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsPanel.cs @@ -0,0 +1,56 @@ +using System; +using UGF.DebugTools.Runtime.UI.Panels; +using UnityEngine; + +namespace UGF.DebugTools.Runtime.UI.Sections.Misc +{ + public class DebugUIStatsPanel : DebugUIPanel + { + public DebugUIStatsAlignment Alignment { get; set; } + public bool DisplayFps { get; set; } + + private float m_timer; + private string m_fps; + + protected override void OnUpdatePosition() + { + base.OnUpdatePosition(); + + Rect screen = DebugUIUtility.GetScreenRect(); + + Position = OnGetPosition(screen, Alignment, Position.size); + } + + protected override void OnDrawGUILayout() + { + if (DisplayFps) + { + GUILayout.Label(m_fps); + } + + m_timer += Time.unscaledDeltaTime; + + if (m_timer > 1F) + { + if (DisplayFps) + { + m_fps = (1F / Time.unscaledDeltaTime).ToString("F1"); + } + + m_timer = 0F; + } + } + + private Rect OnGetPosition(Rect screen, DebugUIStatsAlignment alignment, Vector2 size) + { + return alignment switch + { + DebugUIStatsAlignment.TopLeft => new Rect(0F, 0F, size.x, size.y), + DebugUIStatsAlignment.TopRight => new Rect(screen.width - size.x, 0F, size.x, size.y), + DebugUIStatsAlignment.BottomRight => new Rect(screen.width - size.x, screen.height - size.y, size.x, size.y), + DebugUIStatsAlignment.BottomLeft => new Rect(0F, screen.height - size.y, size.x, size.y), + _ => throw new ArgumentOutOfRangeException(nameof(alignment), alignment, "Debug UI stats alignment is unknown.") + }; + } + } +} diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsPanel.cs.meta b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsPanel.cs.meta new file mode 100644 index 0000000..e0e2aaf --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsPanel.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3c4ec9736b414460ad415013f8bd86f7 +timeCreated: 1707830342 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSection.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSection.cs new file mode 100644 index 0000000..9fe311f --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSection.cs @@ -0,0 +1,59 @@ +using System; +using UGF.DebugTools.Runtime.UI.Menu; +using UnityEngine; + +namespace UGF.DebugTools.Runtime.UI.Sections.Misc +{ + public class DebugUIStatsSection : DebugUISectionDescribed + { + public DebugUIStatsPanel Panel { get { return m_panel ?? throw new ArgumentException("Value not specified."); } } + public bool HasPanel { get { return m_panel != null; } } + + private DebugUIStatsPanel m_panel; + + public DebugUIStatsSection(DebugUIStatsSectionDescription description) : base(description, "UI Stats") + { + } + + protected override void OnInitialize() + { + base.OnInitialize(); + + m_panel = DebugUI.AddPanel(); + + m_panel.ScrollEnabled = false; + m_panel.WindowType = DebugUIWindowType.Area; + m_panel.SetSize(new Vector2(DebugUI.LineHeight * 2F, DebugUI.LineHeight)); + + m_panel.Alignment = Description.Alignment; + m_panel.Display = Description.Display; + m_panel.DisplayBackground = Description.DisplayBackground; + m_panel.Enabled = Description.DisplayEnabled; + m_panel.DisplayFps = Description.DisplayFps; + } + + protected override void OnUninitialize() + { + base.OnUninitialize(); + + DebugUI.RemovePanel(m_panel); + + m_panel = null; + } + + protected override void OnDrawGUILayout() + { + DebugUI.FieldEnum("Alignment", Panel.Alignment, OnAlignmentChanged); + + Panel.Display = DebugUI.FieldToggle("Display", Panel.Display); + Panel.DisplayBackground = DebugUI.FieldToggle("Display Background", Panel.DisplayBackground); + Panel.Enabled = DebugUI.FieldToggle("Display Enabled", Panel.Enabled); + Panel.DisplayFps = DebugUI.FieldToggle("Display FPS", Panel.DisplayFps); + } + + private void OnAlignmentChanged(DebugUIMenuItem item) + { + Panel.Alignment = item.GetValue(); + } + } +} diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSection.cs.meta b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSection.cs.meta new file mode 100644 index 0000000..2ce29d0 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSection.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c95e34a4e2ca40058393bd598c30173a +timeCreated: 1707829062 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionAsset.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionAsset.cs new file mode 100644 index 0000000..a110f2d --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionAsset.cs @@ -0,0 +1,36 @@ +using UnityEngine; + +namespace UGF.DebugTools.Runtime.UI.Sections.Misc +{ + [CreateAssetMenu(menuName = "Unity Game Framework/Debug/Debug UI Stats Section", order = 2000)] + public class DebugUIStatsSectionAsset : DebugUISectionDescribedAsset + { + [SerializeField] private DebugUIStatsAlignment m_alignment; + [SerializeField] private bool m_display; + [SerializeField] private bool m_displayBackground; + [SerializeField] private bool m_displayEnabled; + [SerializeField] private bool m_displayFps; + + public DebugUIStatsAlignment Alignment { get { return m_alignment; } set { m_alignment = value; } } + public bool Display { get { return m_display; } set { m_display = value; } } + public bool DisplayBackground { get { return m_displayBackground; } set { m_displayBackground = value; } } + public bool DisplayEnabled { get { return m_displayEnabled; } set { m_displayEnabled = value; } } + public bool DisplayFps { get { return m_displayFps; } set { m_displayFps = value; } } + + protected override DebugUIStatsSectionDescription OnBuildDescription() + { + return new DebugUIStatsSectionDescription( + m_alignment, + m_display, + m_displayBackground, + m_displayEnabled, + m_displayFps + ); + } + + protected override DebugUIStatsSection OnBuild(DebugUIStatsSectionDescription description) + { + return new DebugUIStatsSection(description); + } + } +} diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionAsset.cs.meta b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionAsset.cs.meta new file mode 100644 index 0000000..0777574 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionAsset.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6e112707cd80488488f7c4e1fc85b9d7 +timeCreated: 1707829113 \ No newline at end of file diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionDescription.cs b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionDescription.cs new file mode 100644 index 0000000..0061f2b --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionDescription.cs @@ -0,0 +1,20 @@ +namespace UGF.DebugTools.Runtime.UI.Sections.Misc +{ + public class DebugUIStatsSectionDescription + { + public DebugUIStatsAlignment Alignment { get; } + public bool Display { get; } + public bool DisplayBackground { get; } + public bool DisplayEnabled { get; } + public bool DisplayFps { get; } + + public DebugUIStatsSectionDescription(DebugUIStatsAlignment alignment, bool display, bool displayBackground, bool displayEnabled, bool displayFps) + { + Alignment = alignment; + Display = display; + DisplayBackground = displayBackground; + DisplayEnabled = displayEnabled; + DisplayFps = displayFps; + } + } +} diff --git a/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionDescription.cs.meta b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionDescription.cs.meta new file mode 100644 index 0000000..5c36227 --- /dev/null +++ b/Packages/UGF.DebugTools/Runtime/UI.Sections.Misc/DebugUIStatsSectionDescription.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7752669a0cb94e66bc6adf7ac17e0bf1 +timeCreated: 1707831706 \ No newline at end of file From b97e290c841dd0249233bde60a1e595295aa89a5 Mon Sep 17 00:00:00 2001 From: Vorobey Date: Tue, 13 Feb 2024 18:23:39 +0300 Subject: [PATCH 15/15] Add tests --- .../Resources/DebugUIPanelDrawer.asset | 2 +- .../Resources/DebugUIProvider.asset | 2 +- .../Resources/DebugUISectionDrawer.asset | 4 ++++ .../Resources/DebugUISectionStats.asset | 19 +++++++++++++++++++ .../Resources/DebugUISectionStats.asset.meta | 8 ++++++++ 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionStats.asset create mode 100644 Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionStats.asset.meta diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIPanelDrawer.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIPanelDrawer.asset index f6748b7..5495027 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIPanelDrawer.asset +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIPanelDrawer.asset @@ -12,4 +12,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1ae4bc8fa71d48849ee52ed74f5ca4a0, type: 3} m_Name: DebugUIPanelDrawer m_EditorClassIdentifier: - m_display: 0 + m_display: 1 diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIProvider.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIProvider.asset index 47e262a..7121770 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIProvider.asset +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUIProvider.asset @@ -13,7 +13,7 @@ MonoBehaviour: m_Name: DebugUIProvider m_EditorClassIdentifier: m_enable: 1 - m_scale: 1 + m_scale: 1.5 m_skin: {fileID: 11400000, guid: 4346a5dd01e15a745b7d3df2ba5ab6d3, type: 2} m_drawers: - m_guid: diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionDrawer.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionDrawer.asset index e415538..3381c28 100644 --- a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionDrawer.asset +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionDrawer.asset @@ -28,6 +28,10 @@ MonoBehaviour: m_first: 8679659793457567961 m_second: 5883057465889210745 m_asset: {fileID: 11400000, guid: 684758d9589878747941896f98d1a451, type: 2} + - m_guid: + m_first: 16876391858629407533 + m_second: 11045808329863049176 + m_asset: {fileID: 11400000, guid: ffe6732dfcfaea34d8af891e27984a99, type: 2} - m_guid: m_first: 13939891763610961395 m_second: 8918237313160289977 diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionStats.asset b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionStats.asset new file mode 100644 index 0000000..1254f21 --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionStats.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6e112707cd80488488f7c4e1fc85b9d7, type: 3} + m_Name: DebugUISectionStats + m_EditorClassIdentifier: + m_alignment: 2 + m_display: 1 + m_displayBackground: 1 + m_displayEnabled: 1 + m_displayFps: 1 diff --git a/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionStats.asset.meta b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionStats.asset.meta new file mode 100644 index 0000000..0b86fcd --- /dev/null +++ b/Assets/UGF.DebugTools.Runtime.Tests/Resources/DebugUISectionStats.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ffe6732dfcfaea34d8af891e27984a99 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: