From e14d8da83f1eca2c160e264a627b62c4550babaa Mon Sep 17 00:00:00 2001 From: Benjamin Kraft Date: Thu, 4 May 2023 23:21:03 +0200 Subject: [PATCH] room ui veery basic done --- Assets/RenderAssets/URP Asset Renderer.asset | 19 +++++++++++++----- Assets/Scripts/Global/RoomSettings.cs | 7 ++++++- Assets/Scripts/Menu/RoomUI.cs | 21 ++++++++++++-------- Assets/UI/GamePanel.asset | 2 ++ Assets/UI/Room.uxml | 1 + Assets/UI/Styles/Main/room.uss | 5 +++++ 6 files changed, 41 insertions(+), 14 deletions(-) diff --git a/Assets/RenderAssets/URP Asset Renderer.asset b/Assets/RenderAssets/URP Asset Renderer.asset index 46f5669..172eb2d 100644 --- a/Assets/RenderAssets/URP Asset Renderer.asset +++ b/Assets/RenderAssets/URP Asset Renderer.asset @@ -14,6 +14,15 @@ MonoBehaviour: m_EditorClassIdentifier: debugShaders: debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, type: 3} + hdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3} + probeVolumeSamplingDebugComputeShader: {fileID: 7200000, guid: 53626a513ea68ce47b59dc1299fe3959, type: 3} + probeVolumeResources: + probeVolumeDebugShader: {fileID: 4800000, guid: e5c6678ed2aaa91408dd3df699057aae, type: 3} + probeVolumeFragmentationDebugShader: {fileID: 4800000, guid: 03cfc4915c15d504a9ed85ecc404e607, type: 3} + probeVolumeOffsetDebugShader: {fileID: 4800000, guid: 53a11f4ebaebf4049b3638ef78dc9664, type: 3} + probeVolumeSamplingDebugShader: {fileID: 4800000, guid: 8f96cd657dc40064aa21efcc7e50a2e7, type: 3} + probeSamplingDebugMesh: {fileID: -3555484719484374845, guid: 57d7c4c16e2765b47a4d2069b311bffe, type: 3} + probeSamplingDebugTexture: {fileID: 2800000, guid: 24ec0e140fb444a44ab96ee80844e18e, type: 3} m_RendererFeatures: [] m_RendererFeatureMap: m_UseNativeRenderPass: 0 @@ -40,15 +49,15 @@ MonoBehaviour: m_CameraSortingLayerDownsamplingMethod: 0 m_MaxLightRenderTextureCount: 16 m_MaxShadowRenderTextureCount: 1 - m_ShapeLightShader: {fileID: 4800000, guid: d79e1c784eaf80c4585c0be7391f757a, type: 3} - m_ShapeLightVolumeShader: {fileID: 4800000, guid: 7e60080c8cd24a2468cb08b4bfee5606, type: 3} - m_PointLightShader: {fileID: 4800000, guid: e35a31e1679aeff489e202f5cc4853d5, type: 3} - m_PointLightVolumeShader: {fileID: 4800000, guid: c7d04ca57e5449d49ad9cee1c604bc26, type: 3} - m_BlitShader: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} + m_LightShader: {fileID: 4800000, guid: 3f6c848ca3d7bca4bbe846546ac701a1, type: 3} + m_CoreBlitShader: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3} + m_CoreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, type: 3} + m_BlitHDROverlay: {fileID: 4800000, guid: a89bee29cffa951418fc1e2da94d1959, type: 3} m_SamplingShader: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} m_ProjectedShadowShader: {fileID: 4800000, guid: ce09d4a80b88c5a4eb9768fab4f1ee00, type: 3} m_SpriteShadowShader: {fileID: 4800000, guid: 44fc62292b65ab04eabcf310e799ccf6, type: 3} m_SpriteUnshadowShader: {fileID: 4800000, guid: de02b375720b5c445afe83cd483bedf3, type: 3} + m_GeometryShadowShader: {fileID: 4800000, guid: 19349a0f9a7ed4c48a27445bcf92e5e1, type: 3} m_GeometryUnshadowShader: {fileID: 4800000, guid: 77774d9009bb81447b048c907d4c6273, type: 3} m_FallbackErrorShader: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} m_PostProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} diff --git a/Assets/Scripts/Global/RoomSettings.cs b/Assets/Scripts/Global/RoomSettings.cs index 8c3408f..7326690 100644 --- a/Assets/Scripts/Global/RoomSettings.cs +++ b/Assets/Scripts/Global/RoomSettings.cs @@ -13,7 +13,12 @@ namespace Global { public struct RoomSettings { public static Type Type; public static Difficulty AIDifficulty; - public static readonly Dictionary SpawnRates = new(); + public static readonly Dictionary SpawnRates = new() { + {Spawnable.NewBallTemporary, SpawnRate.Normal}, + {Spawnable.NewBallPermanent, SpawnRate.Normal}, + {Spawnable.Modification, SpawnRate.Normal}, + {Spawnable.Wormhole, SpawnRate.Normal} + }; public static WinScore WinScore; public static int CustomWinScore; } diff --git a/Assets/Scripts/Menu/RoomUI.cs b/Assets/Scripts/Menu/RoomUI.cs index 87dd9b0..aab3b4b 100644 --- a/Assets/Scripts/Menu/RoomUI.cs +++ b/Assets/Scripts/Menu/RoomUI.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using Global; using UnityEngine; +using UnityEngine.SceneManagement; using UnityEngine.Serialization; using UnityEngine.UIElements; @@ -16,22 +17,26 @@ namespace Menu { difficultyField = Root.Q("Difficulty"); difficultyField.choices = Enum.GetNames(typeof(Difficulty)).ToList(); - difficultyField.index = 0; + difficultyField.RegisterValueChangedCallback(evt => RoomSettings.AIDifficulty = Enum.Parse(evt.newValue)); + difficultyField.index = 2; SliderInt slider = Root.Q("CustomWinScore"); - slider.value = 20; slider.style.visibility = Visibility.Hidden; + slider.RegisterValueChangedCallback(evt => RoomSettings.CustomWinScore = evt.newValue); + slider.value = 20; Toggle toggle = Root.Q("WinScore"); + toggle.RegisterValueChangedCallback(evt => { + slider.style.visibility = evt.newValue ? Visibility.Visible : Visibility.Hidden; + RoomSettings.WinScore = evt.newValue ? WinScore.Custom : WinScore.Default; + }); toggle.value = false; - void UpdateCustomWinScore() { - slider.style.visibility = toggle.value ? Visibility.Visible : Visibility.Hidden; - } + Button startButton = Root.Q