room ui veery basic done

main
Benjamin Kraft 2 years ago
parent 78e4ef4899
commit e14d8da83f
  1. 19
      Assets/RenderAssets/URP Asset Renderer.asset
  2. 7
      Assets/Scripts/Global/RoomSettings.cs
  3. 21
      Assets/Scripts/Menu/RoomUI.cs
  4. 2
      Assets/UI/GamePanel.asset
  5. 1
      Assets/UI/Room.uxml
  6. 5
      Assets/UI/Styles/Main/room.uss

@ -14,6 +14,15 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
debugShaders: debugShaders:
debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, type: 3} 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_RendererFeatures: []
m_RendererFeatureMap: m_RendererFeatureMap:
m_UseNativeRenderPass: 0 m_UseNativeRenderPass: 0
@ -40,15 +49,15 @@ MonoBehaviour:
m_CameraSortingLayerDownsamplingMethod: 0 m_CameraSortingLayerDownsamplingMethod: 0
m_MaxLightRenderTextureCount: 16 m_MaxLightRenderTextureCount: 16
m_MaxShadowRenderTextureCount: 1 m_MaxShadowRenderTextureCount: 1
m_ShapeLightShader: {fileID: 4800000, guid: d79e1c784eaf80c4585c0be7391f757a, type: 3} m_LightShader: {fileID: 4800000, guid: 3f6c848ca3d7bca4bbe846546ac701a1, type: 3}
m_ShapeLightVolumeShader: {fileID: 4800000, guid: 7e60080c8cd24a2468cb08b4bfee5606, type: 3} m_CoreBlitShader: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3}
m_PointLightShader: {fileID: 4800000, guid: e35a31e1679aeff489e202f5cc4853d5, type: 3} m_CoreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, type: 3}
m_PointLightVolumeShader: {fileID: 4800000, guid: c7d04ca57e5449d49ad9cee1c604bc26, type: 3} m_BlitHDROverlay: {fileID: 4800000, guid: a89bee29cffa951418fc1e2da94d1959, type: 3}
m_BlitShader: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3}
m_SamplingShader: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} m_SamplingShader: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3}
m_ProjectedShadowShader: {fileID: 4800000, guid: ce09d4a80b88c5a4eb9768fab4f1ee00, type: 3} m_ProjectedShadowShader: {fileID: 4800000, guid: ce09d4a80b88c5a4eb9768fab4f1ee00, type: 3}
m_SpriteShadowShader: {fileID: 4800000, guid: 44fc62292b65ab04eabcf310e799ccf6, type: 3} m_SpriteShadowShader: {fileID: 4800000, guid: 44fc62292b65ab04eabcf310e799ccf6, type: 3}
m_SpriteUnshadowShader: {fileID: 4800000, guid: de02b375720b5c445afe83cd483bedf3, 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_GeometryUnshadowShader: {fileID: 4800000, guid: 77774d9009bb81447b048c907d4c6273, type: 3}
m_FallbackErrorShader: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} m_FallbackErrorShader: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3}
m_PostProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} m_PostProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2}

@ -13,7 +13,12 @@ namespace Global {
public struct RoomSettings { public struct RoomSettings {
public static Type Type; public static Type Type;
public static Difficulty AIDifficulty; public static Difficulty AIDifficulty;
public static readonly Dictionary<Spawnable, SpawnRate> SpawnRates = new(); public static readonly Dictionary<Spawnable, SpawnRate> SpawnRates = new() {
{Spawnable.NewBallTemporary, SpawnRate.Normal},
{Spawnable.NewBallPermanent, SpawnRate.Normal},
{Spawnable.Modification, SpawnRate.Normal},
{Spawnable.Wormhole, SpawnRate.Normal}
};
public static WinScore WinScore; public static WinScore WinScore;
public static int CustomWinScore; public static int CustomWinScore;
} }

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using Global; using Global;
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization; using UnityEngine.Serialization;
using UnityEngine.UIElements; using UnityEngine.UIElements;
@ -16,21 +17,25 @@ namespace Menu {
difficultyField = Root.Q<DropdownField>("Difficulty"); difficultyField = Root.Q<DropdownField>("Difficulty");
difficultyField.choices = Enum.GetNames(typeof(Difficulty)).ToList(); difficultyField.choices = Enum.GetNames(typeof(Difficulty)).ToList();
difficultyField.index = 0; difficultyField.RegisterValueChangedCallback(evt => RoomSettings.AIDifficulty = Enum.Parse<Difficulty>(evt.newValue));
difficultyField.index = 2;
SliderInt slider = Root.Q<SliderInt>("CustomWinScore"); SliderInt slider = Root.Q<SliderInt>("CustomWinScore");
slider.value = 20;
slider.style.visibility = Visibility.Hidden; slider.style.visibility = Visibility.Hidden;
slider.RegisterValueChangedCallback(evt => RoomSettings.CustomWinScore = evt.newValue);
slider.value = 20;
Toggle toggle = Root.Q<Toggle>("WinScore"); Toggle toggle = Root.Q<Toggle>("WinScore");
toggle.RegisterValueChangedCallback(evt => {
slider.style.visibility = evt.newValue ? Visibility.Visible : Visibility.Hidden;
RoomSettings.WinScore = evt.newValue ? WinScore.Custom : WinScore.Default;
});
toggle.value = false; toggle.value = false;
void UpdateCustomWinScore() { Button startButton = Root.Q<Button>("Start");
slider.style.visibility = toggle.value ? Visibility.Visible : Visibility.Hidden; startButton.clicked += () => {
} SceneManager.LoadScene("Game");
};
toggle.RegisterCallback((ClickEvent _) => { UpdateCustomWinScore(); });
UpdateCustomWinScore();
Root.style.display = DisplayStyle.Flex; Root.style.display = DisplayStyle.Flex;
} }

@ -15,6 +15,7 @@ MonoBehaviour:
themeUss: {fileID: -4733365628477956816, guid: 87c5f501dc6f5fb448eef0f9f3bffa1c, type: 3} themeUss: {fileID: -4733365628477956816, guid: 87c5f501dc6f5fb448eef0f9f3bffa1c, type: 3}
m_TargetTexture: {fileID: 0} m_TargetTexture: {fileID: 0}
m_ScaleMode: 0 m_ScaleMode: 0
m_ReferenceSpritePixelsPerUnit: 100
m_Scale: 1 m_Scale: 1
m_ReferenceDpi: 96 m_ReferenceDpi: 96
m_FallbackDpi: 96 m_FallbackDpi: 96
@ -26,6 +27,7 @@ MonoBehaviour:
m_ClearDepthStencil: 1 m_ClearDepthStencil: 1
m_ClearColor: 0 m_ClearColor: 0
m_ColorClearValue: {r: 0, g: 0, b: 0, a: 0} m_ColorClearValue: {r: 0, g: 0, b: 0, a: 0}
m_VertexBudget: 0
m_DynamicAtlasSettings: m_DynamicAtlasSettings:
m_MinAtlasSize: 64 m_MinAtlasSize: 64
m_MaxAtlasSize: 4096 m_MaxAtlasSize: 4096

@ -5,4 +5,5 @@
<ui:DropdownField label="AI Difficulty" index="0" name="Difficulty" /> <ui:DropdownField label="AI Difficulty" index="0" name="Difficulty" />
<ui:Toggle label="Custom Win Score?" name="WinScore" /> <ui:Toggle label="Custom Win Score?" name="WinScore" />
<ui:SliderInt picking-mode="Ignore" label="Win Score" value="1" high-value="100" name="CustomWinScore" low-value="1" show-input-field="true" direction="Horizontal" /> <ui:SliderInt picking-mode="Ignore" label="Win Score" value="1" high-value="100" name="CustomWinScore" low-value="1" show-input-field="true" direction="Horizontal" />
<ui:Button text="Start" display-tooltip-when-elided="true" name="Start" style="-unity-text-align: upper-center;" />
</ui:UXML> </ui:UXML>

@ -4,4 +4,9 @@
* { * {
font-size: 16px; font-size: 16px;
color: rgb(255, 255, 255);
}
#CustomWinScore #unity-text-field * {
color: rgb(0, 0, 0);
} }

Loading…
Cancel
Save