Added some buttons to lose screen

This commit is contained in:
maverickdgg 2023-02-03 22:59:49 +08:00
parent 382a2d0f6a
commit ebf1ab39cf
7 changed files with 86 additions and 17 deletions

View File

@ -1,4 +1,4 @@
Start Maximized: true Start Maximized: true
Working Scene ID: 97158628 Working Scene ID: 91685359
Window Size: {x: 1920, y: 1013} Window Size: {x: 1920, y: 1013}
Style: 0 Style: 0

View File

@ -20,8 +20,8 @@ Size=400,400
Collapsed=0 Collapsed=0
[Window][Inspector] [Window][Inspector]
Pos=2074,48 Pos=2027,48
Size=486,941 Size=533,941
Collapsed=0 Collapsed=0
DockId=0x00000006,0 DockId=0x00000006,0
@ -76,7 +76,7 @@ DockId=0x0000000B,0
[Window][ Viewport] [Window][ Viewport]
Pos=302,48 Pos=302,48
Size=1770,705 Size=1723,705
Collapsed=0 Collapsed=0
DockId=0x0000000B,0 DockId=0x0000000B,0
@ -94,13 +94,13 @@ DockId=0x0000000A,0
[Window][ Asset Browser] [Window][ Asset Browser]
Pos=302,755 Pos=302,755
Size=1770,234 Size=1723,234
Collapsed=0 Collapsed=0
DockId=0x0000000C,0 DockId=0x0000000C,0
[Window][Material Inspector] [Window][Material Inspector]
Pos=2074,48 Pos=2027,48
Size=486,941 Size=533,941
Collapsed=0 Collapsed=0
DockId=0x00000006,1 DockId=0x00000006,1
@ -116,13 +116,13 @@ Collapsed=0
[Window][Collider Tag Panel] [Window][Collider Tag Panel]
Pos=302,48 Pos=302,48
Size=1770,705 Size=1723,705
Collapsed=0 Collapsed=0
DockId=0x0000000B,1 DockId=0x0000000B,1
[Window][Input Bindings Panel] [Window][Input Bindings Panel]
Pos=2074,48 Pos=2027,48
Size=486,941 Size=533,941
Collapsed=0 Collapsed=0
DockId=0x00000006,2 DockId=0x00000006,2
@ -152,16 +152,16 @@ Column 16 Weight=1.0132
[Docking][Data] [Docking][Data]
DockSpace ID=0xC5C9B8AB Window=0xBE4044E9 Pos=0,71 Size=2560,941 Split=X DockSpace ID=0xC5C9B8AB Window=0xBE4044E9 Pos=0,71 Size=2560,941 Split=X
DockNode ID=0x00000005 Parent=0xC5C9B8AB SizeRef=1432,1036 Split=X DockNode ID=0x00000005 Parent=0xC5C9B8AB SizeRef=2025,1036 Split=X
DockNode ID=0x00000001 Parent=0x00000005 SizeRef=300,1036 Split=Y Selected=0x1E6EB881 DockNode ID=0x00000001 Parent=0x00000005 SizeRef=300,1036 Split=Y Selected=0x1E6EB881
DockNode ID=0x00000003 Parent=0x00000001 SizeRef=225,147 Selected=0x1E6EB881 DockNode ID=0x00000003 Parent=0x00000001 SizeRef=225,147 Selected=0x1E6EB881
DockNode ID=0x00000004 Parent=0x00000001 SizeRef=225,863 Selected=0xE096E5AE DockNode ID=0x00000004 Parent=0x00000001 SizeRef=225,863 Selected=0xE096E5AE
DockNode ID=0x00000002 Parent=0x00000005 SizeRef=1130,1036 Split=Y Selected=0xB41284E7 DockNode ID=0x00000002 Parent=0x00000005 SizeRef=1723,1036 Split=Y Selected=0xB41284E7
DockNode ID=0x00000007 Parent=0x00000002 SizeRef=1501,672 Split=Y Selected=0xB41284E7 DockNode ID=0x00000007 Parent=0x00000002 SizeRef=1501,672 Split=Y Selected=0xB41284E7
DockNode ID=0x00000009 Parent=0x00000007 SizeRef=1501,700 Split=Y Selected=0xB41284E7 DockNode ID=0x00000009 Parent=0x00000007 SizeRef=1501,700 Split=Y Selected=0xB41284E7
DockNode ID=0x0000000B Parent=0x00000009 SizeRef=1501,705 CentralNode=1 Selected=0xB41284E7 DockNode ID=0x0000000B Parent=0x00000009 SizeRef=1501,705 CentralNode=1 Selected=0xB41284E7
DockNode ID=0x0000000C Parent=0x00000009 SizeRef=1501,234 Selected=0xB128252A DockNode ID=0x0000000C Parent=0x00000009 SizeRef=1501,234 Selected=0xB128252A
DockNode ID=0x0000000A Parent=0x00000007 SizeRef=1501,310 Selected=0xD446F7B6 DockNode ID=0x0000000A Parent=0x00000007 SizeRef=1501,310 Selected=0xD446F7B6
DockNode ID=0x00000008 Parent=0x00000002 SizeRef=1501,338 Selected=0xD9F31532 DockNode ID=0x00000008 Parent=0x00000002 SizeRef=1501,338 Selected=0xD9F31532
DockNode ID=0x00000006 Parent=0xC5C9B8AB SizeRef=486,1036 Selected=0xE7039252 DockNode ID=0x00000006 Parent=0xC5C9B8AB SizeRef=533,1036 Selected=0xE7039252

View File

@ -15,7 +15,7 @@
- EID: 1 - EID: 1
Name: Canvas Name: Canvas
IsActive: true IsActive: true
NumberOfChildren: 1 NumberOfChildren: 2
Components: Components:
Canvas Component: Canvas Component:
Canvas Width: 1920 Canvas Width: 1920
@ -23,7 +23,7 @@
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 2 - EID: 2
Name: Default Name: Back Ground
IsActive: true IsActive: true
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
@ -37,6 +37,29 @@
Material: 123313564 Material: 123313564
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 5
Name: Main Menu Button
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 400, y: 200, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 129340704
IsActive: true
Button Component:
Default Texture: 65788519
Hovered Texture: 55999018
Clicked Texture: 66382894
IsActive: true
Scripts:
- Type: ChangeSceneButton
Enabled: true
sceneID: 97158628
- EID: 3 - EID: 3
Name: Camera Name: Camera
IsActive: true IsActive: true

View File

@ -1,7 +1,7 @@
- EID: 0 - EID: 0
Name: Canvas Name: Canvas
IsActive: true IsActive: true
NumberOfChildren: 2 NumberOfChildren: 3
Components: Components:
Canvas Component: Canvas Component:
Canvas Width: 1920 Canvas Width: 1920
@ -46,6 +46,28 @@
- Type: ChangeSceneButton - Type: ChangeSceneButton
Enabled: true Enabled: true
sceneID: 86098106 sceneID: 86098106
- EID: 6
Name: Quit Game Button
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: -200, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 400, y: 200, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 129340704
IsActive: true
Button Component:
Default Texture: 66477839
Hovered Texture: 65045286
Clicked Texture: 58607560
IsActive: true
Scripts:
- Type: QuitButton
Enabled: true
- EID: 2 - EID: 2
Name: Light Name: Light
IsActive: true IsActive: true

View File

@ -14,7 +14,7 @@ public class ChangeSceneButton : Script
if(sceneID != 0) if(sceneID != 0)
{ {
Audio.PlaySFXOnce2D("event:/UI/success"); Audio.PlaySFXOnce2D("event:/UI/success");
SceneManager.ChangeScene(86098106); SceneManager.ChangeScene(sceneID);
Audio.StopAllSounds(); Audio.StopAllSounds();
} }
}); });

View File

@ -0,0 +1,21 @@
using System;
using SHADE;
public class QuitButton : Script
{
protected override void awake()
{
UIElement ui = GetComponent<UIElement>();
ui.OnClick.RegisterAction(() =>
{
Audio.StopAllSounds();
Application.Quit();
});
}
protected override void update()
{
}
}

View File

@ -0,0 +1,3 @@
Name: SC_QuitButton
ID: 163136401
Type: 9