Fixed Button texture swapping. Fixed Button scripts on scene change. Added buttons to scenes. Added SHEDITOR define for Managed #341
|
@ -36,6 +36,9 @@
|
|||
Mesh: 141771688
|
||||
Material: 123313564
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 1
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 5
|
||||
Name: Main Menu Button
|
||||
|
@ -56,6 +59,9 @@
|
|||
Hovered Texture: 55999018
|
||||
Clicked Texture: 66382894
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 1
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: ChangeSceneButton
|
||||
Enabled: true
|
||||
|
@ -79,6 +85,9 @@
|
|||
Hovered Texture: 65045286
|
||||
Clicked Texture: 58607560
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 1
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: QuitButton
|
||||
Enabled: true
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
Mesh: 141771688
|
||||
Material: 121834459
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 0
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 5
|
||||
Name: Start Game Button
|
||||
|
@ -42,6 +45,9 @@
|
|||
Hovered Texture: 62235279
|
||||
Clicked Texture: 64722619
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 0
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: ChangeSceneButton
|
||||
Enabled: true
|
||||
|
@ -65,6 +71,9 @@
|
|||
Hovered Texture: 65045286
|
||||
Clicked Texture: 58607560
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 0
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: QuitButton
|
||||
Enabled: true
|
||||
|
|
|
@ -9,17 +9,22 @@ public class ChangeSceneButton : Script
|
|||
protected override void start()
|
||||
{
|
||||
UIElement ui = GetComponent<UIElement>();
|
||||
ui.OnClick.RegisterAction(() =>
|
||||
if (ui != null)
|
||||
{
|
||||
if(sceneID != 0)
|
||||
ui.OnClick.RegisterAction(() =>
|
||||
{
|
||||
Audio.PlaySFXOnce2D("event:/UI/success");
|
||||
SceneManager.ChangeScene(sceneID);
|
||||
Audio.StopAllSounds();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (sceneID != 0)
|
||||
{
|
||||
Audio.PlaySFXOnce2D("event:/UI/success");
|
||||
SceneManager.ChangeScene(sceneID);
|
||||
Audio.StopAllSounds();
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Failed to register button action for ChangeSceneButton.");
|
||||
}
|
||||
}
|
||||
protected override void update()
|
||||
{
|
||||
|
|
|
@ -6,12 +6,22 @@ public class QuitButton : Script
|
|||
protected override void start()
|
||||
{
|
||||
UIElement ui = GetComponent<UIElement>();
|
||||
ui.OnClick.RegisterAction(() =>
|
||||
if (ui != null)
|
||||
{
|
||||
Audio.StopAllSounds();
|
||||
Application.Quit();
|
||||
});
|
||||
ui.OnClick.RegisterAction(() =>
|
||||
{
|
||||
ui.OnClick.RegisterAction(() =>
|
||||
{
|
||||
Audio.StopAllSounds();
|
||||
Application.Quit();
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Failed to register button action for QuitButton.");
|
||||
}
|
||||
|
||||
}
|
||||
protected override void update()
|
||||
|
|
|
@ -205,6 +205,7 @@ namespace SHADE
|
|||
|
||||
AddComponentToComponentNode<SHTextRenderableComponent>(components, eid);
|
||||
AddComponentToComponentNode<SHAnimatorComponent>(components, eid);
|
||||
AddComponentToComponentNode<SHUIComponent>(components, eid);
|
||||
|
||||
node[ComponentsNode] = components;
|
||||
|
||||
|
@ -263,6 +264,7 @@ namespace SHADE
|
|||
AddComponentID<SHToggleButtonComponent>(componentIDList, componentsNode);
|
||||
AddComponentID<SHTextRenderableComponent>(componentIDList, componentsNode);
|
||||
AddComponentID<SHAnimatorComponent>(componentIDList, componentsNode);
|
||||
AddComponentID<SHUIComponent>(componentIDList, componentsNode);
|
||||
|
||||
return componentIDList;
|
||||
}
|
||||
|
@ -347,5 +349,6 @@ namespace SHADE
|
|||
SHSerializationHelper::InitializeComponentFromNode<SHTextRenderableComponent>(componentsNode, eid);
|
||||
SHSerializationHelper::InitializeComponentFromNode<SHLightComponent>(componentsNode, eid);
|
||||
SHSerializationHelper::InitializeComponentFromNode<SHAnimatorComponent>(componentsNode, eid);
|
||||
SHSerializationHelper::InitializeComponentFromNode<SHUIComponent>(componentsNode, eid);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue