parent
2bc4e754b7
commit
d5d654fa79
25 changed files with 156 additions and 20 deletions
@ -0,0 +1,3 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 06da811c70ca4fd398fc8155d2783017 |
||||||
|
timeCreated: 1682506834 |
@ -0,0 +1,27 @@ |
|||||||
|
using Game; |
||||||
|
using Global; |
||||||
|
using UnityEngine; |
||||||
|
using UnityEngine.SceneManagement; |
||||||
|
using UnityEngine.UIElements; |
||||||
|
|
||||||
|
namespace Menu { |
||||||
|
public class MainUI : MonoBehaviour { |
||||||
|
|
||||||
|
private VisualElement root; |
||||||
|
public RoomUI roomUI; |
||||||
|
public MainMenuUI mainMenuUI; |
||||||
|
|
||||||
|
public static MainUI Instance { get; private set; } |
||||||
|
|
||||||
|
private void Awake() { |
||||||
|
Instance = this; |
||||||
|
|
||||||
|
root = GetComponent<UIDocument>().rootVisualElement; |
||||||
|
mainMenuUI = new MainMenuUI{Root = root.Q<TemplateContainer>("MainMenu").contentContainer}; |
||||||
|
roomUI = new RoomUI{Root = root.Q("Room")}; |
||||||
|
|
||||||
|
mainMenuUI.ResetAndShow(); |
||||||
|
roomUI.Hide(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -1,5 +1,24 @@ |
|||||||
|
using System; |
||||||
|
using UnityEngine; |
||||||
|
using UnityEngine.Serialization; |
||||||
|
using UnityEngine.UIElements; |
||||||
|
|
||||||
namespace Menu { |
namespace Menu { |
||||||
public class RoomUI { |
public class RoomUI { |
||||||
|
public VisualElement Root { get; set; } |
||||||
|
|
||||||
|
public void Show() { |
||||||
|
|
||||||
|
Root.style.display = DisplayStyle.Flex; |
||||||
|
} |
||||||
|
|
||||||
|
public void Hide() { |
||||||
|
Root.style.display = DisplayStyle.None; |
||||||
|
} |
||||||
|
|
||||||
|
private void BackToMainMenu() { |
||||||
|
Hide(); |
||||||
|
MainUI.Instance.mainMenuUI.ResetAndShow(); |
||||||
|
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -0,0 +1,7 @@ |
|||||||
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False"> |
||||||
|
<ui:Template name="MainMenu" src="project://database/Assets/UI/MainMenu.uxml?fileID=9197481963319205126&guid=8c18fadf28797192cb95360376cdf508&type=3#MainMenu" /> |
||||||
|
<ui:Template name="Room" src="project://database/Assets/UI/Room.uxml?fileID=9197481963319205126&guid=413eb0fe30f77d6f6a3f14b36a8c5b49&type=3#Room" /> |
||||||
|
<Style src="project://database/Assets/UI/Styles/Main/main.uss?fileID=7433441132597879392&guid=bf06c821ac0da0c7ea35aebdb8b6f154&type=3#main" /> |
||||||
|
<ui:Instance template="MainMenu" name="MainMenu" class="entry" /> |
||||||
|
<ui:Instance template="Room" name="Room" class="entry" style="display: none;" /> |
||||||
|
</ui:UXML> |
@ -0,0 +1,10 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 59c75f243b2251b6aa02eec69db9c6ed |
||||||
|
ScriptedImporter: |
||||||
|
internalIDToNameTable: [] |
||||||
|
externalObjects: {} |
||||||
|
serializedVersion: 2 |
||||||
|
userData: |
||||||
|
assetBundleName: |
||||||
|
assetBundleVariant: |
||||||
|
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0} |
@ -0,0 +1,6 @@ |
|||||||
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False"> |
||||||
|
<Style src="project://database/Assets/UI/Styles/global.uss?fileID=7433441132597879392&guid=f6d2ff1ab9bcd826f88710e642615fa6&type=3#global" /> |
||||||
|
<Style src="project://database/Assets/UI/Styles/Main/room.uss?fileID=7433441132597879392&guid=c15d8498d3bc788d5b018c73af37f733&type=3#room" /> |
||||||
|
<Style src="project://database/Assets/UI/Styles/Main/menu.uss?fileID=7433441132597879392&guid=a6abab2f6d20ba823bad41d2081810e9&type=3#menu" /> |
||||||
|
<ui:Button text="Button" display-tooltip-when-elided="true" /> |
||||||
|
</ui:UXML> |
@ -0,0 +1,10 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 413eb0fe30f77d6f6a3f14b36a8c5b49 |
||||||
|
ScriptedImporter: |
||||||
|
internalIDToNameTable: [] |
||||||
|
externalObjects: {} |
||||||
|
serializedVersion: 2 |
||||||
|
userData: |
||||||
|
assetBundleName: |
||||||
|
assetBundleVariant: |
||||||
|
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0} |
@ -0,0 +1,8 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 5f387b1fd1334ee889aa311741a7e062 |
||||||
|
folderAsset: yes |
||||||
|
DefaultImporter: |
||||||
|
externalObjects: {} |
||||||
|
userData: |
||||||
|
assetBundleName: |
||||||
|
assetBundleVariant: |
@ -0,0 +1,8 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 2c2eeee4a0183fc06b7b877afcef840d |
||||||
|
folderAsset: yes |
||||||
|
DefaultImporter: |
||||||
|
externalObjects: {} |
||||||
|
userData: |
||||||
|
assetBundleName: |
||||||
|
assetBundleVariant: |
@ -0,0 +1,4 @@ |
|||||||
|
.entry { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
} |
@ -0,0 +1,11 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: bf06c821ac0da0c7ea35aebdb8b6f154 |
||||||
|
ScriptedImporter: |
||||||
|
internalIDToNameTable: [] |
||||||
|
externalObjects: {} |
||||||
|
serializedVersion: 2 |
||||||
|
userData: |
||||||
|
assetBundleName: |
||||||
|
assetBundleVariant: |
||||||
|
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} |
||||||
|
disableValidation: 0 |
@ -0,0 +1,11 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: c15d8498d3bc788d5b018c73af37f733 |
||||||
|
ScriptedImporter: |
||||||
|
internalIDToNameTable: [] |
||||||
|
externalObjects: {} |
||||||
|
serializedVersion: 2 |
||||||
|
userData: |
||||||
|
assetBundleName: |
||||||
|
assetBundleVariant: |
||||||
|
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} |
||||||
|
disableValidation: 0 |
Loading…
Reference in new issue