diff --git a/Assets/Materials/UI/GameIcon.shmat b/Assets/Materials/UI/GameIcon.shmat new file mode 100644 index 00000000..7eb1a6e3 --- /dev/null +++ b/Assets/Materials/UI/GameIcon.shmat @@ -0,0 +1,8 @@ +- VertexShader: 46580970 + FragmentShader: 35983630 + SubPass: UI + Properties: + data.color: {x: 1, y: 1, z: 1, w: 1} + data.textureIndex: 51158984 + data.alpha: 1 + data.beta: {x: 1, y: 1, z: 1} \ No newline at end of file diff --git a/Assets/Materials/UI/GameIcon.shmat.shmeta b/Assets/Materials/UI/GameIcon.shmat.shmeta new file mode 100644 index 00000000..905012d7 --- /dev/null +++ b/Assets/Materials/UI/GameIcon.shmat.shmeta @@ -0,0 +1,3 @@ +Name: GameIcon +ID: 126117259 +Type: 7 diff --git a/Assets/Materials/UI/Instruction_01.shmat b/Assets/Materials/UI/Instruction_01.shmat new file mode 100644 index 00000000..bbcb6352 --- /dev/null +++ b/Assets/Materials/UI/Instruction_01.shmat @@ -0,0 +1,8 @@ +- VertexShader: 46580970 + FragmentShader: 35983630 + SubPass: UI + Properties: + data.color: {x: 1, y: 1, z: 1, w: 1} + data.textureIndex: 62200943 + data.alpha: 1 + data.beta: {x: 1, y: 1, z: 1} \ No newline at end of file diff --git a/Assets/Materials/UI/Instruction_01.shmat.shmeta b/Assets/Materials/UI/Instruction_01.shmat.shmeta new file mode 100644 index 00000000..a7a5e4d8 --- /dev/null +++ b/Assets/Materials/UI/Instruction_01.shmat.shmeta @@ -0,0 +1,3 @@ +Name: Instruction_01 +ID: 124926341 +Type: 7 diff --git a/Assets/Materials/UI/Instruction_02.shmat b/Assets/Materials/UI/Instruction_02.shmat new file mode 100644 index 00000000..3084049a --- /dev/null +++ b/Assets/Materials/UI/Instruction_02.shmat @@ -0,0 +1,8 @@ +- VertexShader: 46580970 + FragmentShader: 35983630 + SubPass: UI + Properties: + data.color: {x: 1, y: 1, z: 1, w: 1} + data.textureIndex: 53303669 + data.alpha: 1 + data.beta: {x: 1, y: 1, z: 1} \ No newline at end of file diff --git a/Assets/Materials/UI/Instruction_02.shmat.shmeta b/Assets/Materials/UI/Instruction_02.shmat.shmeta new file mode 100644 index 00000000..dfc296f8 --- /dev/null +++ b/Assets/Materials/UI/Instruction_02.shmat.shmeta @@ -0,0 +1,3 @@ +Name: Instruction_02 +ID: 128721520 +Type: 7 diff --git a/Assets/Materials/UI/Instruction_03.shmat b/Assets/Materials/UI/Instruction_03.shmat new file mode 100644 index 00000000..b548319f --- /dev/null +++ b/Assets/Materials/UI/Instruction_03.shmat @@ -0,0 +1,8 @@ +- VertexShader: 46580970 + FragmentShader: 35983630 + SubPass: UI + Properties: + data.color: {x: 1, y: 1, z: 1, w: 1} + data.textureIndex: 61780097 + data.alpha: 1 + data.beta: {x: 1, y: 1, z: 1} \ No newline at end of file diff --git a/Assets/Materials/UI/Instruction_03.shmat.shmeta b/Assets/Materials/UI/Instruction_03.shmat.shmeta new file mode 100644 index 00000000..46aa5270 --- /dev/null +++ b/Assets/Materials/UI/Instruction_03.shmat.shmeta @@ -0,0 +1,3 @@ +Name: Instruction_03 +ID: 124482180 +Type: 7 diff --git a/Assets/Materials/UI/Instruction_04.shmat b/Assets/Materials/UI/Instruction_04.shmat new file mode 100644 index 00000000..dba0a45d --- /dev/null +++ b/Assets/Materials/UI/Instruction_04.shmat @@ -0,0 +1,8 @@ +- VertexShader: 46580970 + FragmentShader: 35983630 + SubPass: UI + Properties: + data.color: {x: 1, y: 1, z: 1, w: 1} + data.textureIndex: 59178524 + data.alpha: 1 + data.beta: {x: 1, y: 1, z: 1} \ No newline at end of file diff --git a/Assets/Materials/UI/Instruction_04.shmat.shmeta b/Assets/Materials/UI/Instruction_04.shmat.shmeta new file mode 100644 index 00000000..728abc0a --- /dev/null +++ b/Assets/Materials/UI/Instruction_04.shmat.shmeta @@ -0,0 +1,3 @@ +Name: Instruction_04 +ID: 129768803 +Type: 7 diff --git a/Assets/Materials/UIMat.shmat b/Assets/Materials/UI/UIMat.shmat similarity index 100% rename from Assets/Materials/UIMat.shmat rename to Assets/Materials/UI/UIMat.shmat diff --git a/Assets/Materials/UIMat.shmat.shmeta b/Assets/Materials/UI/UIMat.shmat.shmeta similarity index 100% rename from Assets/Materials/UIMat.shmat.shmeta rename to Assets/Materials/UI/UIMat.shmat.shmeta diff --git a/Assets/Materials/UIMat_LoseScene.shmat b/Assets/Materials/UI/UIMat_LoseScene.shmat similarity index 100% rename from Assets/Materials/UIMat_LoseScene.shmat rename to Assets/Materials/UI/UIMat_LoseScene.shmat diff --git a/Assets/Materials/UIMat_LoseScene.shmat.shmeta b/Assets/Materials/UI/UIMat_LoseScene.shmat.shmeta similarity index 100% rename from Assets/Materials/UIMat_LoseScene.shmat.shmeta rename to Assets/Materials/UI/UIMat_LoseScene.shmat.shmeta diff --git a/Assets/Materials/UIMat_MainMenu.shmat b/Assets/Materials/UI/UIMat_MainMenu.shmat similarity index 100% rename from Assets/Materials/UIMat_MainMenu.shmat rename to Assets/Materials/UI/UIMat_MainMenu.shmat diff --git a/Assets/Materials/UIMat_MainMenu.shmat.shmeta b/Assets/Materials/UI/UIMat_MainMenu.shmat.shmeta similarity index 100% rename from Assets/Materials/UIMat_MainMenu.shmat.shmeta rename to Assets/Materials/UI/UIMat_MainMenu.shmat.shmeta diff --git a/Assets/Materials/UI/UIMat_Slider.shmat b/Assets/Materials/UI/UIMat_Slider.shmat new file mode 100644 index 00000000..fc28932a --- /dev/null +++ b/Assets/Materials/UI/UIMat_Slider.shmat @@ -0,0 +1,12 @@ +- VertexShader: 46580970 + FragmentShader: 48832081 + SubPass: UI + Properties: + data.color: {x: 1, y: 1, z: 1, w: 1} + data.textureIndex: 64651793 + data.alpha: 1 + data.beta: {x: 1, y: 1, z: 1} + data.sliderThreshold: 1 + data.sliderStartColor: {x: 0, y: 1, z: 0, w: 1} + data.sliderEndColor: {x: 1, y: 0, z: 0, w: 1} + data.sliderBarColor: {x: 1, y: 1, z: 1, w: 1} \ No newline at end of file diff --git a/Assets/Materials/UI/UIMat_Slider.shmat.shmeta b/Assets/Materials/UI/UIMat_Slider.shmat.shmeta new file mode 100644 index 00000000..6cd24549 --- /dev/null +++ b/Assets/Materials/UI/UIMat_Slider.shmat.shmeta @@ -0,0 +1,3 @@ +Name: UIMat_Slider +ID: 128676209 +Type: 7 diff --git a/Assets/Materials/UIMat_WinScene.shmat b/Assets/Materials/UI/UIMat_WinScene.shmat similarity index 100% rename from Assets/Materials/UIMat_WinScene.shmat rename to Assets/Materials/UI/UIMat_WinScene.shmat diff --git a/Assets/Materials/UIMat_WinScene.shmat.shmeta b/Assets/Materials/UI/UIMat_WinScene.shmat.shmeta similarity index 100% rename from Assets/Materials/UIMat_WinScene.shmat.shmeta rename to Assets/Materials/UI/UIMat_WinScene.shmat.shmeta diff --git a/Assets/Materials/UIMat_Slider_Textured.shmat b/Assets/Materials/UIMat_Slider_Textured.shmat new file mode 100644 index 00000000..cb09a99e --- /dev/null +++ b/Assets/Materials/UIMat_Slider_Textured.shmat @@ -0,0 +1,9 @@ +- VertexShader: 46580970 + FragmentShader: 43211183 + SubPass: UI + Properties: + data.color: {x: 1, y: 1, z: 1, w: 1} + data.textureIndex: 51995224 + data.alpha: 1 + data.beta: {x: 1, y: 1, z: 1} + data.sliderThreshold: 1 \ No newline at end of file diff --git a/Assets/Materials/UIMat_Slider_Textured.shmat.shmeta b/Assets/Materials/UIMat_Slider_Textured.shmat.shmeta new file mode 100644 index 00000000..99aec372 --- /dev/null +++ b/Assets/Materials/UIMat_Slider_Textured.shmat.shmeta @@ -0,0 +1,3 @@ +Name: UIMat_Slider_Textured +ID: 127128823 +Type: 7 diff --git a/Assets/Scenes/MainMenu.shade b/Assets/Scenes/MainMenu.shade index 8d1bbcf3..e667c8e8 100644 --- a/Assets/Scenes/MainMenu.shade +++ b/Assets/Scenes/MainMenu.shade @@ -1,7 +1,7 @@ - EID: 0 - Name: Canvas + Name: Main Menu Canvas IsActive: true - NumberOfChildren: 3 + NumberOfChildren: 8 Components: Canvas Component: Canvas Width: 1920 @@ -10,7 +10,7 @@ IsActive: true Scripts: ~ - EID: 1 - Name: Background + Name: BackGround IsActive: true NumberOfChildren: 0 Components: @@ -35,9 +35,9 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 0, y: 75, z: 0.400000006} + Translate: {x: -700, y: 100, z: 0.400000006} Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 400, y: 200, z: 1} + Scale: {x: 450, y: 100, z: 1} IsActive: true Renderable Component: Mesh: 141771688 @@ -57,15 +57,23 @@ - Type: ChangeSceneButton Enabled: true sceneID: 96668835 + - Type: SHADE_Scripting.UI.ButtonFX + Enabled: true + onHoverEnterSound: event:/Music/player_undetected + onHoverExitSound: "event:/Music/player_undetected\x00���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������" + onClickSound: event:/Music/player_undetected + onReleaseSound: event:/Music/player_undetected + hoverScale: 1.10000002 + clickScale: 0.899999976 - EID: 6 Name: Quit Game Button IsActive: true NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 0, y: -200, z: 0.400000006} + Translate: {x: -700, y: -400, z: 0.400000006} Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 400, y: 200, z: 1} + Scale: {x: 450, y: 100, z: 1} IsActive: true Renderable Component: Mesh: 141771688 @@ -84,6 +92,183 @@ Scripts: - Type: QuitButton Enabled: true + - Type: SHADE_Scripting.UI.ButtonFX + Enabled: true + onHoverEnterSound: event:/Music/player_undetected + onHoverExitSound: event:/Music/player_undetected + onClickSound: event:/Music/player_undetected + onReleaseSound: event:/Music/player_undetected + hoverScale: 1.10000002 + clickScale: 0.899999976 +- EID: 7 + Name: Level Select Button + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -700, y: 0, z: 0.400000006} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 450, y: 100, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 129340704 + IsActive: true + Button Component: + Default Texture: 52901020 + Hovered Texture: 62235279 + Clicked Texture: 64722619 + IsActive: true + UI Component: + Canvas ID: 0 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.ButtonFX + Enabled: true + onHoverEnterSound: event:/Music/player_undetected + onHoverExitSound: event:/Music/player_undetected + onClickSound: event:/Music/player_undetected + onReleaseSound: event:/Music/player_undetected + hoverScale: 1.10000002 + clickScale: 0.899999976 + - Type: SHADE_Scripting.UI.ChangeCanvasButton + Enabled: true + canvasToActivate: 50 +- EID: 9 + Name: How To Play Button + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -700, y: -100, z: 0.400000006} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 450, y: 100, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 129340704 + IsActive: true + Button Component: + Default Texture: 65084899 + Hovered Texture: 58647112 + Clicked Texture: 55758383 + IsActive: true + UI Component: + Canvas ID: 0 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.ButtonFX + Enabled: true + onHoverEnterSound: event:/Music/player_undetected + onHoverExitSound: event:/Music/player_undetected + onClickSound: event:/Music/player_undetected + onReleaseSound: event:/Music/player_undetected + hoverScale: 1.10000002 + clickScale: 0.899999976 + - Type: SHADE_Scripting.UI.ChangeCanvasButton + Enabled: true + canvasToActivate: 13 +- EID: 10 + Name: Credits Button + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -700, y: -200, z: 0.400000006} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 450, y: 100, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 129340704 + IsActive: true + Button Component: + Default Texture: 52901020 + Hovered Texture: 62235279 + Clicked Texture: 64722619 + IsActive: true + UI Component: + Canvas ID: 0 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.ButtonFX + Enabled: true + onHoverEnterSound: event:/Music/player_undetected + onHoverExitSound: event:/Music/player_undetected + onClickSound: event:/Music/player_undetected + onReleaseSound: event:/Music/player_undetected + hoverScale: 1.10000002 + clickScale: 0.899999976 + - Type: SHADE_Scripting.UI.ChangeCanvasButton + Enabled: true + canvasToActivate: 46 +- EID: 11 + Name: Options Button + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -700, y: -300, z: 0.400000006} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 450, y: 100, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 129340704 + IsActive: true + Button Component: + Default Texture: 52901020 + Hovered Texture: 62235279 + Clicked Texture: 64722619 + IsActive: true + UI Component: + Canvas ID: 0 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.ButtonFX + Enabled: true + onHoverEnterSound: event:/Music/player_undetected + onHoverExitSound: event:/Music/player_undetected + onClickSound: event:/Music/player_undetected + onReleaseSound: event:/Music/player_undetected + hoverScale: 1.10000002 + clickScale: 0.899999976 + - Type: SHADE_Scripting.UI.ChangeCanvasButton + Enabled: true + canvasToActivate: 19 +- EID: 12 + Name: Game Icon + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -700, y: 350, z: 0.300000012} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 355.756439, y: 355.756439, z: 1.18585491} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 126117259 + IsActive: true + UI Component: + Canvas ID: 0 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.ScaleBounce + Enabled: true + minScale: 1 + maxScale: 1.20000005 + duration: 1.5 - EID: 2 Name: Light IsActive: true @@ -129,4 +314,869 @@ - Type: MainMenu Enabled: true sceneID: 96668835 - obj: 1 \ No newline at end of file + obj: 1 +- EID: 8 + Name: TweenManager + IsActive: true + NumberOfChildren: 0 + Components: ~ + Scripts: + - Type: SHADE_Scripting.UI.TweenManager + Enabled: true +- EID: 13 + Name: How To Play Canvas + IsActive: false + NumberOfChildren: 5 + Components: + Canvas Component: + Canvas Width: 1920 + Canvas Height: 1080 + Scale by canvas width: false + IsActive: false + Scripts: ~ +- EID: 14 + Name: BackGround + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1920, y: 1080, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 121834459 + IsActive: true + UI Component: + Canvas ID: 13 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 15 + Name: Instruction Image + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0.400000006} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1344, y: 756, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 124926341 + IsActive: true + UI Component: + Canvas ID: 13 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.MultiImageList + Enabled: true + imageAssetList: + - 124926341 + - 128721520 + - 124482180 + - 129768803 +- EID: 16 + Name: NextButton + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 800, y: 0, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 100, y: 100, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 129340704 + IsActive: true + Button Component: + Default Texture: 0 + Hovered Texture: 0 + Clicked Texture: 0 + IsActive: true + UI Component: + Canvas ID: 13 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.MultiImageListControlButton + Enabled: true + isNext: true + multiImageList: 15 +- EID: 17 + Name: PrevButton + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -800, y: 0, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 100, y: 100, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 129340704 + IsActive: true + Button Component: + Default Texture: 0 + Hovered Texture: 0 + Clicked Texture: 0 + IsActive: true + UI Component: + Canvas ID: 13 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.MultiImageListControlButton + Enabled: true + isNext: false + multiImageList: 15 +- EID: 18 + Name: BackButton + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -800, y: 450, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 100, y: 100, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 129340704 + IsActive: true + Button Component: + Default Texture: 0 + Hovered Texture: 0 + Clicked Texture: 0 + IsActive: true + UI Component: + Canvas ID: 13 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.ChangeCanvasButton + Enabled: true + canvasToActivate: 0 +- EID: 19 + Name: Options Canvas + IsActive: false + NumberOfChildren: 11 + Components: + Canvas Component: + Canvas Width: 1920 + Canvas Height: 1080 + Scale by canvas width: false + IsActive: false + Scripts: ~ +- EID: 20 + Name: BackGround + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 1} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1920, y: 1080, z: 1} + IsActive: false + Renderable Component: + Mesh: 141771688 + Material: 121834459 + IsActive: false + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: false + Scripts: ~ +- EID: 21 + Name: BackButton + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -800, y: 450, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 100, y: 100, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 129340704 + IsActive: true + Button Component: + Default Texture: 0 + Hovered Texture: 0 + Clicked Texture: 0 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.ChangeCanvasButton + Enabled: true + canvasToActivate: 0 +- EID: 22 + Name: Options Title Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -150, y: 400, z: -0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 100, y: 100, z: 1} + IsActive: true + Text Renderer Component: + Text: Options + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 23 + Name: Audio Title Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -900, y: 300, z: -0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 100, y: 100, z: 1} + IsActive: true + Text Renderer Component: + Text: Audio + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 25 + Name: Audio Text Group + IsActive: true + NumberOfChildren: 3 + Components: + Transform Component: + Translate: {x: -900, y: 200, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 24 + Name: Master Volume Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: -0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 75, y: 75, z: 1} + IsActive: true + Text Renderer Component: + Text: Master + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 26 + Name: SFX Volume Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: -100, z: -0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 75, y: 75, z: 1} + IsActive: true + Text Renderer Component: + Text: SFX + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 27 + Name: BGM Volume Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: -200, z: -0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 75, y: 75, z: 1} + IsActive: true + Text Renderer Component: + Text: BGM + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 28 + Name: Audio Slider Group + IsActive: true + NumberOfChildren: 3 + Components: + Transform Component: + Translate: {x: 100, y: 225, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 29 + Name: Master Volume Slider + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1000, y: 75, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 128676209 + IsActive: true + Slider Component: + Slider Value: 0 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 30 + Name: SFX Volume Slider + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: -100, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1000, y: 75, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 128676209 + IsActive: true + Slider Component: + Slider Value: 0 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 31 + Name: BGM Volume Slider + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: -200, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1000, y: 75, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 128676209 + IsActive: true + Slider Component: + Slider Value: 0 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 32 + Name: Camera Title Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -900, y: -120, z: -0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 100, y: 100, z: 1} + IsActive: true + Text Renderer Component: + Text: Camera + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 33 + Name: Camera Text Group + IsActive: true + NumberOfChildren: 2 + Components: + Transform Component: + Translate: {x: -900, y: -220, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 34 + Name: FOV Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: -0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 75, y: 75, z: 1} + IsActive: true + Text Renderer Component: + Text: FOV + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 35 + Name: Sensitivity Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: -100, z: -0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 75, y: 75, z: 1} + IsActive: true + Text Renderer Component: + Text: Sensitivity + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 36 + Name: Camera Slider Group + IsActive: true + NumberOfChildren: 2 + Components: + Transform Component: + Translate: {x: 100, y: -200, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 37 + Name: FOV Slider + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1000, y: 75, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 128676209 + IsActive: true + Slider Component: + Slider Value: 0 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 38 + Name: Sensitivity Slider + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: -100, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1000, y: 75, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 128676209 + IsActive: true + Slider Component: + Slider Value: 0 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 39 + Name: Audio Slider Text Group + IsActive: true + NumberOfChildren: 3 + Components: + Transform Component: + Translate: {x: 700, y: 200, z: -0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 40 + Name: Master Volume Slider Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 75, y: 75, z: 1} + IsActive: true + Text Renderer Component: + Text: 100 + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.SliderText + Enabled: true + sliderObj: 29 + minValue: 0 + maxValue: 100 +- EID: 41 + Name: SFX Volume Slider Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: -100, z: 0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 75, y: 75, z: 1} + IsActive: true + Text Renderer Component: + Text: 100 + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.SliderText + Enabled: true + sliderObj: 30 + minValue: 0 + maxValue: 100 +- EID: 42 + Name: BGM Volume Slider Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: -200, z: 0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 75, y: 75, z: 1} + IsActive: true + Text Renderer Component: + Text: 100 + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.SliderText + Enabled: true + sliderObj: 31 + minValue: 0 + maxValue: 100 +- EID: 43 + Name: Camera Slider Text Group + IsActive: true + NumberOfChildren: 2 + Components: + Transform Component: + Translate: {x: 700, y: -225, z: -0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 44 + Name: FOV Slider Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 75, y: 75, z: 1} + IsActive: true + Text Renderer Component: + Text: 100 + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.SliderText + Enabled: true + sliderObj: 37 + minValue: 0 + maxValue: 100 +- EID: 45 + Name: Sensitivity Slider Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: -100, z: 0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 75, y: 75, z: 1} + IsActive: true + Text Renderer Component: + Text: 100 + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 19 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.SliderText + Enabled: true + sliderObj: 38 + minValue: 0 + maxValue: 100 +- EID: 46 + Name: Credits Canvas + IsActive: true + NumberOfChildren: 3 + Components: + Canvas Component: + Canvas Width: 1920 + Canvas Height: 1080 + Scale by canvas width: false + IsActive: true + Scripts: ~ +- EID: 47 + Name: BackGround + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 1} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1920, y: 1080, z: 1} + IsActive: false + Renderable Component: + Mesh: 141771688 + Material: 121834459 + IsActive: false + UI Component: + Canvas ID: 46 + Hovered: false + Clicked: false + IsActive: false + Scripts: ~ +- EID: 48 + Name: BackButton + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -800, y: 450, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 100, y: 100, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 129340704 + IsActive: true + Button Component: + Default Texture: 0 + Hovered Texture: 0 + Clicked Texture: 0 + IsActive: true + UI Component: + Canvas ID: 46 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.ChangeCanvasButton + Enabled: true + canvasToActivate: 0 +- EID: 49 + Name: Credits Title Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -150, y: 400, z: -0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 100, y: 100, z: 1} + IsActive: true + Text Renderer Component: + Text: Credits + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 46 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 50 + Name: Level Select Canvas + IsActive: true + NumberOfChildren: 3 + Components: + Canvas Component: + Canvas Width: 1920 + Canvas Height: 1080 + Scale by canvas width: false + IsActive: true + Scripts: ~ +- EID: 51 + Name: BackGround + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 1} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1920, y: 1080, z: 1} + IsActive: false + Renderable Component: + Mesh: 141771688 + Material: 121834459 + IsActive: false + UI Component: + Canvas ID: 50 + Hovered: false + Clicked: false + IsActive: false + Scripts: ~ +- EID: 52 + Name: BackButton + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -800, y: 450, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 100, y: 100, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 129340704 + IsActive: true + Button Component: + Default Texture: 0 + Hovered Texture: 0 + Clicked Texture: 0 + IsActive: true + UI Component: + Canvas ID: 50 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.ChangeCanvasButton + Enabled: true + canvasToActivate: 0 +- EID: 53 + Name: Level Select Title Text + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -150, y: 400, z: -0.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 100, y: 100, z: 1} + IsActive: true + Text Renderer Component: + Text: Level Select + Font: 176667660 + IsActive: true + UI Component: + Canvas ID: 50 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ \ No newline at end of file diff --git a/Assets/Scripts/UI/EasingHelper.cs b/Assets/Scripts/UI/EasingHelper.cs new file mode 100644 index 00000000..b1301d4e --- /dev/null +++ b/Assets/Scripts/UI/EasingHelper.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SHADE_Scripting.UI +{ + + public enum EASING_METHOD + { + EASE_IN_SINE, + EASE_OUT_SINE, + } + + public static class EasingHelper + { + + public static float EaseHelp(float value, EASING_METHOD method) + { + switch (method) + { + case EASING_METHOD.EASE_IN_SINE: + { + return EaseInSine(value); + }break; + case EASING_METHOD.EASE_OUT_SINE: + { + return EaseOutSine(value); + }break; + + default: + return 0.0f; + } + } + + private static float EaseInSine(float value) + { + return (float)(1.0f - Math.Cos((value * Math.PI) / 2.0f)); + } + + private static float EaseOutSine(float value) + { + return (float)(1.0f - Math.Sin(value * Math.PI) / 2.0f); + } + + } +} diff --git a/Assets/Scripts/UI/EasingHelper.cs.shmeta b/Assets/Scripts/UI/EasingHelper.cs.shmeta new file mode 100644 index 00000000..cd4c2aa3 --- /dev/null +++ b/Assets/Scripts/UI/EasingHelper.cs.shmeta @@ -0,0 +1,3 @@ +Name: EasingHelper +ID: 161000975 +Type: 9 diff --git a/Assets/Scripts/UI/SC_ButtonFX.cs b/Assets/Scripts/UI/SC_ButtonFX.cs new file mode 100644 index 00000000..bf248724 --- /dev/null +++ b/Assets/Scripts/UI/SC_ButtonFX.cs @@ -0,0 +1,91 @@ +using SHADE; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SHADE_Scripting.UI +{ + public class ButtonFX:Script + { + public string onHoverEnterSound = "event:/Music/player_undetected"; + public string onHoverExitSound = "event:/Music/player_undetected"; + public string onClickSound = "event:/Music/player_undetected"; + public string onReleaseSound = "event:/Music/player_undetected"; + + [NonSerialized] + private AudioClipHandler onHoverEnterACHandler; + [NonSerialized] + private AudioClipHandler onHoverExitACHandler; + [NonSerialized] + private AudioClipHandler onClickACHandler; + [NonSerialized] + private AudioClipHandler onReleaseACHandler; + + [NonSerialized] + private Vector3 defaultScale; + + public float hoverScale = 1.1f; + public float clickScale = 0.9f; + + + protected override void awake() + { + onHoverEnterACHandler = SHADE.Audio.CreateAudioClip(onHoverEnterSound); + onHoverExitACHandler = SHADE.Audio.CreateAudioClip(onHoverExitSound); + onClickACHandler = SHADE.Audio.CreateAudioClip(onClickSound); + onReleaseACHandler = SHADE.Audio.CreateAudioClip(onReleaseSound); + } + + protected override void start() + { + Transform transform = GetComponent(); + if (transform == null) + return; + defaultScale = transform.LocalScale; + + + UIElement ui = GetComponent(); + if (ui == null) + return; + + + ui.OnClick.RegisterAction(() => + { + if (onClickSound != "") + onClickACHandler.Play(); + transform.LocalScale = defaultScale * clickScale; + }); + + ui.OnRelease.RegisterAction(() => + { + if (onReleaseSound != "") + onReleaseACHandler.Play(); + transform.LocalScale = defaultScale; + }); + + ui.OnHoverEnter.RegisterAction(() => + { + if(onHoverEnterSound != "") + onHoverEnterACHandler.Play(); + transform.LocalScale = defaultScale * hoverScale; + }); + + ui.OnHoverExit.RegisterAction(() => + { + if (onHoverExitSound != "") + onHoverExitACHandler.Play(); + transform.LocalScale = defaultScale; + }); + + } + + protected override void update() + { + + } + + + } +} diff --git a/Assets/Scripts/UI/SC_ButtonFX.cs.shmeta b/Assets/Scripts/UI/SC_ButtonFX.cs.shmeta new file mode 100644 index 00000000..73e3c1c2 --- /dev/null +++ b/Assets/Scripts/UI/SC_ButtonFX.cs.shmeta @@ -0,0 +1,3 @@ +Name: SC_ButtonFX +ID: 163796084 +Type: 9 diff --git a/Assets/Scripts/UI/SC_ChangeCanvasButton.cs b/Assets/Scripts/UI/SC_ChangeCanvasButton.cs new file mode 100644 index 00000000..2c8a5df4 --- /dev/null +++ b/Assets/Scripts/UI/SC_ChangeCanvasButton.cs @@ -0,0 +1,42 @@ +using SHADE; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SHADE_Scripting.UI +{ + public class ChangeCanvasButton:Script + { + + public GameObject canvasToActivate; + + protected override void awake() + { + //if (canvasToActivate.GetComponent() == null) + // return; + UIElement ui = GetComponent(); + ui.OnRelease.RegisterAction(() => + { + Canvas.DeactivateAllCanvas(); + + canvasToActivate.SetActive(true); + + }); + } + + protected override void start() + { + + + } + + protected override void update() + { + + } + + + } +} diff --git a/Assets/Scripts/UI/SC_ChangeCanvasButton.cs.shmeta b/Assets/Scripts/UI/SC_ChangeCanvasButton.cs.shmeta new file mode 100644 index 00000000..e817ba9d --- /dev/null +++ b/Assets/Scripts/UI/SC_ChangeCanvasButton.cs.shmeta @@ -0,0 +1,3 @@ +Name: SC_ChangeCanvasButton +ID: 154633292 +Type: 9 diff --git a/Assets/Scripts/UI/SC_ChangeSceneButton.cs b/Assets/Scripts/UI/SC_ChangeSceneButton.cs index b41a421a..c0629d0a 100644 --- a/Assets/Scripts/UI/SC_ChangeSceneButton.cs +++ b/Assets/Scripts/UI/SC_ChangeSceneButton.cs @@ -25,6 +25,7 @@ public class ChangeSceneButton : Script else { Debug.LogError("Failed to register button action for ChangeSceneButton."); + } } protected override void update() diff --git a/Assets/Scripts/UI/SC_MultiImageList.cs b/Assets/Scripts/UI/SC_MultiImageList.cs new file mode 100644 index 00000000..d6f2379c --- /dev/null +++ b/Assets/Scripts/UI/SC_MultiImageList.cs @@ -0,0 +1,51 @@ +using SHADE; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SHADE_Scripting.UI +{ + public class MultiImageList:Script + { + public List imageAssetList = new List(); + [NonSerialized] + private int index = 0; + + + protected override void awake() + { + } + + protected override void start() + { + + } + + public void NextImage() + { + ++index; + if(index >= imageAssetList.Count()) + { + index = 0; + } + + Renderable rend = GetComponent(); + rend.SetMaterial(imageAssetList[index]); + + } + + public void PrevImage() + { + if (index == 0) + index = imageAssetList.Count(); + --index; + + Renderable rend = GetComponent(); + rend.SetMaterial(imageAssetList[index]); + } + + + } +} diff --git a/Assets/Scripts/UI/SC_MultiImageList.cs.shmeta b/Assets/Scripts/UI/SC_MultiImageList.cs.shmeta new file mode 100644 index 00000000..ec795cba --- /dev/null +++ b/Assets/Scripts/UI/SC_MultiImageList.cs.shmeta @@ -0,0 +1,3 @@ +Name: SC_MultiImageList +ID: 166320642 +Type: 9 diff --git a/Assets/Scripts/UI/SC_MultiImageListControlButton.cs b/Assets/Scripts/UI/SC_MultiImageListControlButton.cs new file mode 100644 index 00000000..4ec50dd4 --- /dev/null +++ b/Assets/Scripts/UI/SC_MultiImageListControlButton.cs @@ -0,0 +1,40 @@ +using SHADE; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SHADE_Scripting.UI +{ + public class MultiImageListControlButton: Script + { + public bool isNext = true; + public GameObject multiImageList; + + protected override void awake() + { + + UIElement ui = GetComponent(); + if (ui != null) + { + ui.OnRelease.RegisterAction(() => + { + + MultiImageList imageList = multiImageList.GetScript(); + if(imageList != null) + { + + if (isNext) + imageList.NextImage(); + else + imageList.PrevImage(); + + } + + }); + } + } + + } +} diff --git a/Assets/Scripts/UI/SC_MultiImageListControlButton.cs.shmeta b/Assets/Scripts/UI/SC_MultiImageListControlButton.cs.shmeta new file mode 100644 index 00000000..5096e110 --- /dev/null +++ b/Assets/Scripts/UI/SC_MultiImageListControlButton.cs.shmeta @@ -0,0 +1,3 @@ +Name: SC_MultiImageListControlButton +ID: 164209885 +Type: 9 diff --git a/Assets/Scripts/UI/SC_ScaleBounce.cs b/Assets/Scripts/UI/SC_ScaleBounce.cs new file mode 100644 index 00000000..0d5ca381 --- /dev/null +++ b/Assets/Scripts/UI/SC_ScaleBounce.cs @@ -0,0 +1,47 @@ +using SHADE; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SHADE_Scripting.UI +{ + public class ScaleBounce:Script + { + [NonSerialized] + private TweenThread thread; + + public float minScale = 1.0f; + public float maxScale = 1.2f; + public float duration = 1.0f; + + private Vector3 defaultScale; + + + protected override void start() + { + thread = TweenManager.CreateTweenThread(duration, minScale, maxScale, EASING_METHOD.EASE_IN_SINE); + Transform trans = GetComponent(); + if(trans != null) + { + defaultScale = trans.LocalScale; + } + } + + protected override void update() + { + Transform trans = GetComponent(); + if(trans != null) + { + trans.LocalScale = defaultScale * thread.GetValue(); + } + if(thread.IsCompleted()) + { + thread.ResetInvert(); + } + } + + + } +} diff --git a/Assets/Scripts/UI/SC_ScaleBounce.cs.shmeta b/Assets/Scripts/UI/SC_ScaleBounce.cs.shmeta new file mode 100644 index 00000000..04ea3afb --- /dev/null +++ b/Assets/Scripts/UI/SC_ScaleBounce.cs.shmeta @@ -0,0 +1,3 @@ +Name: SC_ScaleBounce +ID: 152015842 +Type: 9 diff --git a/Assets/Scripts/UI/SC_SliderText.cs b/Assets/Scripts/UI/SC_SliderText.cs new file mode 100644 index 00000000..54d59f28 --- /dev/null +++ b/Assets/Scripts/UI/SC_SliderText.cs @@ -0,0 +1,31 @@ +using SHADE; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SHADE_Scripting.UI +{ + public class SliderText:Script + { + public GameObject sliderObj; + + public int minValue = 0; + public int maxValue = 0; + + + protected override void update() + { + Slider slider = sliderObj.GetComponent(); + TextRenderable text = GetComponent(); + if(slider != null && text != null) + { + + text.Text = ((int)(slider.GetValue() * (maxValue - minValue) + minValue)).ToString(); + } + } + + + } +} diff --git a/Assets/Scripts/UI/SC_SliderText.cs.shmeta b/Assets/Scripts/UI/SC_SliderText.cs.shmeta new file mode 100644 index 00000000..298bd246 --- /dev/null +++ b/Assets/Scripts/UI/SC_SliderText.cs.shmeta @@ -0,0 +1,3 @@ +Name: SC_SliderText +ID: 158412308 +Type: 9 diff --git a/Assets/Scripts/UI/SC_TweenManager.cs b/Assets/Scripts/UI/SC_TweenManager.cs new file mode 100644 index 00000000..bbcc8c8f --- /dev/null +++ b/Assets/Scripts/UI/SC_TweenManager.cs @@ -0,0 +1,120 @@ +using SHADE; +using SHADE_Scripting.Audio; +using System; +using System.Collections.Generic; +using System.Threading; + + +namespace SHADE_Scripting.UI +{ + + public class TweenThread + { + private float timer = 0.0f; + public float duration = 1.0f; + public EASING_METHOD method; + private float value = 0.0f; + public float startValue = 0.0f; + public float endValue = 1.0f; + + + public TweenThread(float duration, float startValue, float endValue, EASING_METHOD method) + { + this.duration = duration; + this.method = method; + this.startValue = startValue; + this.endValue = endValue; + } + + public void Update(float deltaTime) + { + if (timer > duration) + return; + timer += deltaTime; + if (timer > duration) + timer = duration; + + value = EasingHelper.EaseHelp(timer/duration, method) * (endValue - startValue) + startValue ; + } + + public bool IsCompleted() + { + return timer >= duration; + } + + public void Reset() + { + timer = 0.0f; + value = startValue; + } + public void Reset(float startValue, float endValue) + { + Reset(); + this.startValue = startValue; + this.endValue = endValue; + } + public void ResetInvert() + { + Reset(); + float temp = startValue; + startValue = endValue; + endValue = temp; + } + + + public float GetValue() + { + return value; + } + + } + + public class TweenManager : Script + { + public static TweenManager Instance { get; private set; } + + [NonSerialized] + private List threadList; + + protected override void awake() + { + if (Instance != null && Instance != this) + RemoveScript(); + else + Instance = this; + + threadList = new List(); + + } + + protected override void onDestroy() + { + if (Instance == this) + Instance = null; + + } + + protected override void update() + { + + foreach (TweenThread thread in threadList) + { + thread.Update(Time.DeltaTimeF); + } + } + + + public static TweenThread CreateTweenThread(float duration, float startValue, float endValue, EASING_METHOD method) + { + if (Instance == null) + return null; + + + TweenThread thread = new TweenThread(duration, startValue, endValue, method); + Instance.threadList.Add(thread); + thread.Reset(); + return thread; + } + + } +} diff --git a/Assets/Scripts/UI/SC_TweenManager.cs.shmeta b/Assets/Scripts/UI/SC_TweenManager.cs.shmeta new file mode 100644 index 00000000..286387c3 --- /dev/null +++ b/Assets/Scripts/UI/SC_TweenManager.cs.shmeta @@ -0,0 +1,3 @@ +Name: SC_TweenManager +ID: 164072799 +Type: 9 diff --git a/Assets/Shaders/UI_Slider_FS.glsl b/Assets/Shaders/UI_Slider_FS.glsl new file mode 100644 index 00000000..b39f18dd --- /dev/null +++ b/Assets/Shaders/UI_Slider_FS.glsl @@ -0,0 +1,60 @@ +#version 450 +#extension GL_ARB_separate_shader_objects : enable +#extension GL_ARB_shading_language_420pack : enable +#extension GL_EXT_nonuniform_qualifier : require + +struct MatPropData +{ + int textureIndex; + float alpha; + float sliderThreshold; + vec4 sliderStartColor; + vec4 sliderEndColor; + vec4 sliderBarColor; +}; + +layout(location = 0) in struct +{ + vec4 vertPos; // location 0 + vec2 uv; // location = 1 + vec4 normal; // location = 2 + +} In; + +// material stuff +layout(location = 3) flat in struct +{ + int materialIndex; + uint eid; + uint lightLayerIndex; + +} In2; + +layout (set = 0, binding = 1) uniform sampler2D textures[]; // for textures (global) +layout (std430, set = 2, binding = 0) buffer MaterialProperties // For materials +{ + MatPropData data[]; +} MatProp; + +layout(location = 0) out vec4 fragColor; +layout(location = 1) out uint outEntityID; + +void main() +{ + //fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv); + + if (In.uv.x > MatProp.data[In2.materialIndex].sliderThreshold) + fragColor = MatProp.data[In2.materialIndex].sliderBarColor; + else + fragColor = (1.0f - In.uv.x) * MatProp.data[In2.materialIndex].sliderStartColor + In.uv.x * MatProp.data[In2.materialIndex].sliderEndColor; + //fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv); + if (fragColor.a < 0.01f) + { + discard; + } + + fragColor.a = MatProp.data[In2.materialIndex].alpha; + + // fragColor.a = 1.0f; + outEntityID = In2.eid; +} \ No newline at end of file diff --git a/Assets/Shaders/UI_Slider_FS.shshaderb b/Assets/Shaders/UI_Slider_FS.shshaderb new file mode 100644 index 00000000..0dcfb62d Binary files /dev/null and b/Assets/Shaders/UI_Slider_FS.shshaderb differ diff --git a/Assets/Shaders/UI_Slider_FS.shshaderb.shmeta b/Assets/Shaders/UI_Slider_FS.shshaderb.shmeta new file mode 100644 index 00000000..51d3222f --- /dev/null +++ b/Assets/Shaders/UI_Slider_FS.shshaderb.shmeta @@ -0,0 +1,3 @@ +Name: UI_Slider_FS +ID: 48832081 +Type: 2 diff --git a/Assets/Shaders/UI_Slider_Textured_FS.glsl b/Assets/Shaders/UI_Slider_Textured_FS.glsl new file mode 100644 index 00000000..9f7945ce --- /dev/null +++ b/Assets/Shaders/UI_Slider_Textured_FS.glsl @@ -0,0 +1,62 @@ +#version 450 +#extension GL_ARB_separate_shader_objects : enable +#extension GL_ARB_shading_language_420pack : enable +#extension GL_EXT_nonuniform_qualifier : require + +struct MatPropData +{ + int textureIndex; + float alpha; + float sliderThreshold; + vec4 sliderStartColor; + vec4 sliderEndColor; + vec4 sliderBarColor; +}; + +layout(location = 0) in struct +{ + vec4 vertPos; // location 0 + vec2 uv; // location = 1 + vec4 normal; // location = 2 + +} In; + +// material stuff +layout(location = 3) flat in struct +{ + int materialIndex; + uint eid; + uint lightLayerIndex; + +} In2; + +layout (set = 0, binding = 1) uniform sampler2D textures[]; // for textures (global) +layout (std430, set = 2, binding = 0) buffer MaterialProperties // For materials +{ + MatPropData data[]; +} MatProp; + +layout(location = 0) out vec4 fragColor; +layout(location = 1) out uint outEntityID; + +void main() +{ + //fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv); + + if (In.uv.x > MatProp.data[In2.materialIndex].sliderThreshold) + fragColor = MatProp.data[In2.materialIndex].sliderBarColor; + else + //fragColor = (1.0f - In.uv.x) * MatProp.data[In2.materialIndex].sliderStartColor + In.uv.x * MatProp.data[In2.materialIndex].sliderEndColor; + fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv); + + + if (fragColor.a < 0.01f) + { + discard; + } + + fragColor.a = MatProp.data[In2.materialIndex].alpha; + + // fragColor.a = 1.0f; + outEntityID = In2.eid; +} \ No newline at end of file diff --git a/Assets/Shaders/UI_Slider_Textured_FS.shshaderb b/Assets/Shaders/UI_Slider_Textured_FS.shshaderb new file mode 100644 index 00000000..db7f7c70 Binary files /dev/null and b/Assets/Shaders/UI_Slider_Textured_FS.shshaderb differ diff --git a/Assets/Shaders/UI_Slider_Textured_FS.shshaderb.shmeta b/Assets/Shaders/UI_Slider_Textured_FS.shshaderb.shmeta new file mode 100644 index 00000000..57e0093e --- /dev/null +++ b/Assets/Shaders/UI_Slider_Textured_FS.shshaderb.shmeta @@ -0,0 +1,3 @@ +Name: UI_Slider_Textured_FS +ID: 43211183 +Type: 2 diff --git a/Assets/Texture/UI/RaccoonTransparent.dds b/Assets/Texture/UI/RaccoonTransparent.dds new file mode 100644 index 00000000..f974aaec Binary files /dev/null and b/Assets/Texture/UI/RaccoonTransparent.dds differ diff --git a/Assets/Texture/UI/RaccoonTransparent.shtex b/Assets/Texture/UI/RaccoonTransparent.shtex new file mode 100644 index 00000000..77483a50 Binary files /dev/null and b/Assets/Texture/UI/RaccoonTransparent.shtex differ diff --git a/Assets/Texture/UI/RaccoonTransparent.shtex.shmeta b/Assets/Texture/UI/RaccoonTransparent.shtex.shmeta new file mode 100644 index 00000000..3e28bfd3 --- /dev/null +++ b/Assets/Texture/UI/RaccoonTransparent.shtex.shmeta @@ -0,0 +1,3 @@ +Name: RaccoonTransparent +ID: 51158984 +Type: 3 diff --git a/Assets/Texture/UI/TX_WK10_HowToPlay_01.dds b/Assets/Texture/UI/TX_WK10_HowToPlay_01.dds new file mode 100644 index 00000000..cc1d68b6 Binary files /dev/null and b/Assets/Texture/UI/TX_WK10_HowToPlay_01.dds differ diff --git a/Assets/Texture/UI/TX_WK10_HowToPlay_01.shtex b/Assets/Texture/UI/TX_WK10_HowToPlay_01.shtex new file mode 100644 index 00000000..061d84c8 Binary files /dev/null and b/Assets/Texture/UI/TX_WK10_HowToPlay_01.shtex differ diff --git a/Assets/Texture/UI/TX_WK10_HowToPlay_01.shtex.shmeta b/Assets/Texture/UI/TX_WK10_HowToPlay_01.shtex.shmeta new file mode 100644 index 00000000..fcd72302 --- /dev/null +++ b/Assets/Texture/UI/TX_WK10_HowToPlay_01.shtex.shmeta @@ -0,0 +1,3 @@ +Name: TX_WK10_HowToPlay_01 +ID: 62200943 +Type: 3 diff --git a/Assets/Texture/UI/TX_WK10_HowToPlay_02.dds b/Assets/Texture/UI/TX_WK10_HowToPlay_02.dds new file mode 100644 index 00000000..38ea5b30 Binary files /dev/null and b/Assets/Texture/UI/TX_WK10_HowToPlay_02.dds differ diff --git a/Assets/Texture/UI/TX_WK10_HowToPlay_02.shtex b/Assets/Texture/UI/TX_WK10_HowToPlay_02.shtex new file mode 100644 index 00000000..3fa62e86 Binary files /dev/null and b/Assets/Texture/UI/TX_WK10_HowToPlay_02.shtex differ diff --git a/Assets/Texture/UI/TX_WK10_HowToPlay_02.shtex.shmeta b/Assets/Texture/UI/TX_WK10_HowToPlay_02.shtex.shmeta new file mode 100644 index 00000000..56e9b58a --- /dev/null +++ b/Assets/Texture/UI/TX_WK10_HowToPlay_02.shtex.shmeta @@ -0,0 +1,3 @@ +Name: TX_WK10_HowToPlay_02 +ID: 53303669 +Type: 3 diff --git a/Assets/Texture/UI/TX_WK10_HowToPlay_03.dds b/Assets/Texture/UI/TX_WK10_HowToPlay_03.dds new file mode 100644 index 00000000..ac8adee9 Binary files /dev/null and b/Assets/Texture/UI/TX_WK10_HowToPlay_03.dds differ diff --git a/Assets/Texture/UI/TX_WK10_HowToPlay_03.shtex b/Assets/Texture/UI/TX_WK10_HowToPlay_03.shtex new file mode 100644 index 00000000..826d87b2 Binary files /dev/null and b/Assets/Texture/UI/TX_WK10_HowToPlay_03.shtex differ diff --git a/Assets/Texture/UI/TX_WK10_HowToPlay_03.shtex.shmeta b/Assets/Texture/UI/TX_WK10_HowToPlay_03.shtex.shmeta new file mode 100644 index 00000000..c190e6d8 --- /dev/null +++ b/Assets/Texture/UI/TX_WK10_HowToPlay_03.shtex.shmeta @@ -0,0 +1,3 @@ +Name: TX_WK10_HowToPlay_03 +ID: 61780097 +Type: 3 diff --git a/Assets/Texture/UI/TX_WK10_HowToPlay_04.dds b/Assets/Texture/UI/TX_WK10_HowToPlay_04.dds new file mode 100644 index 00000000..66298f3a Binary files /dev/null and b/Assets/Texture/UI/TX_WK10_HowToPlay_04.dds differ diff --git a/Assets/Texture/UI/TX_WK10_HowToPlay_04.shtex b/Assets/Texture/UI/TX_WK10_HowToPlay_04.shtex new file mode 100644 index 00000000..3d6504b1 Binary files /dev/null and b/Assets/Texture/UI/TX_WK10_HowToPlay_04.shtex differ diff --git a/Assets/Texture/UI/TX_WK10_HowToPlay_04.shtex.shmeta b/Assets/Texture/UI/TX_WK10_HowToPlay_04.shtex.shmeta new file mode 100644 index 00000000..df21f174 --- /dev/null +++ b/Assets/Texture/UI/TX_WK10_HowToPlay_04.shtex.shmeta @@ -0,0 +1,3 @@ +Name: TX_WK10_HowToPlay_04 +ID: 59178524 +Type: 3 diff --git a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorInspector.cpp b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorInspector.cpp index 81882742..391e0be2 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorInspector.cpp +++ b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorInspector.cpp @@ -22,6 +22,7 @@ #include "UI/SHCanvasComponent.h" #include "UI/SHButtonComponent.h" #include "UI/SHToggleButtonComponent.h" +#include "UI/SHSliderComponent.h" #include "SHEditorComponentView.h" #include "AudioSystem/SHAudioListenerComponent.h" #include "Graphics/MiddleEnd/TextRendering/SHTextRenderableComponent.h" @@ -170,6 +171,9 @@ namespace SHADE if (auto toggleButton = SHComponentManager::GetComponent_s(eid)) { DrawComponent(toggleButton); + }if (auto slider = SHComponentManager::GetComponent_s(eid)) + { + DrawComponent(slider); } ImGui::Separator(); // Render Scripts @@ -185,6 +189,7 @@ namespace SHADE DrawAddComponentButton(eid); DrawAddComponentButton(eid); DrawAddComponentButton(eid); + DrawAddComponentButton(eid); // Components that require Transforms diff --git a/SHADE_Engine/src/Serialization/SHSerialization.cpp b/SHADE_Engine/src/Serialization/SHSerialization.cpp index 464b1d9d..29fb8cd7 100644 --- a/SHADE_Engine/src/Serialization/SHSerialization.cpp +++ b/SHADE_Engine/src/Serialization/SHSerialization.cpp @@ -241,6 +241,7 @@ namespace SHADE AddComponentToComponentNode(components, eid); AddComponentToComponentNode(components, eid); AddComponentToComponentNode(components, eid); + AddComponentToComponentNode(components, eid); AddComponentToComponentNode(components, eid); AddComponentToComponentNode(components, eid); @@ -301,6 +302,7 @@ namespace SHADE AddComponentID(componentIDList, componentsNode); AddComponentID(componentIDList, componentsNode); AddComponentID(componentIDList, componentsNode); + AddComponentID(componentIDList, componentsNode); AddComponentID(componentIDList, componentsNode); AddComponentID(componentIDList, componentsNode); AddComponentID(componentIDList, componentsNode); @@ -385,6 +387,7 @@ namespace SHADE SHSerializationHelper::InitializeComponentFromNode(componentsNode, eid); SHSerializationHelper::InitializeComponentFromNode(componentsNode, eid); SHSerializationHelper::InitializeComponentFromNode(componentsNode, eid); + SHSerializationHelper::InitializeComponentFromNode(componentsNode, eid); SHSerializationHelper::InitializeComponentFromNode(componentsNode, eid); SHSerializationHelper::InitializeComponentFromNode(componentsNode, eid); SHSerializationHelper::InitializeComponentFromNode(componentsNode, eid); diff --git a/SHADE_Engine/src/UI/SHSliderComponent.cpp b/SHADE_Engine/src/UI/SHSliderComponent.cpp index 56d1d89b..d25fbb6f 100644 --- a/SHADE_Engine/src/UI/SHSliderComponent.cpp +++ b/SHADE_Engine/src/UI/SHSliderComponent.cpp @@ -4,7 +4,7 @@ namespace SHADE { SHSliderComponent::SHSliderComponent() - :size(1.0f), isHovered(false), isClicked(false), value(0.0f) + :value(0.0f) { } diff --git a/SHADE_Engine/src/UI/SHSliderComponent.h b/SHADE_Engine/src/UI/SHSliderComponent.h index bdc57c7e..1eb64205 100644 --- a/SHADE_Engine/src/UI/SHSliderComponent.h +++ b/SHADE_Engine/src/UI/SHSliderComponent.h @@ -17,8 +17,6 @@ namespace SHADE SHSliderComponent(); virtual ~SHSliderComponent() = default; - SHVec2 size; - float GetValue() const noexcept; @@ -29,8 +27,7 @@ namespace SHADE friend class SHUISystem; private: - bool isHovered; - bool isClicked; + float value; diff --git a/SHADE_Engine/src/UI/SHUISystem.cpp b/SHADE_Engine/src/UI/SHUISystem.cpp index e27c00a2..05bd9ab5 100644 --- a/SHADE_Engine/src/UI/SHUISystem.cpp +++ b/SHADE_Engine/src/UI/SHUISystem.cpp @@ -377,6 +377,77 @@ namespace SHADE } + void SHUISystem::UpdateSliderComponent(SHSliderComponent& comp) noexcept + { + + + if (!SHComponentManager::HasComponent(comp.GetEID())) + { + return; + } + auto cameraSystem = SHSystemManager::GetSystem(); + auto uiComp = SHComponentManager::GetComponent(comp.GetEID()); + //auto canvasComp = SHComponentManager::GetComponent_s(uiComp->canvasID); + + float tempValue = comp.GetValue(); + + CheckButtonHoveredOrClicked(*uiComp); + + if (uiComp->GetIsClicked() == true) + { + SHVec4 topExtent4 = SHMatrix::Translate(-uiComp->size.x * 0.5f, uiComp->size.y * 0.5f, 0.0f) * uiComp->GetMatrix() * SHVec4(0.0f, 0.0f, 0.0f, 1.0f); + SHVec4 btmExtent4 = SHMatrix::Translate(uiComp->size.x * 0.5f, -uiComp->size.y * 0.5f, 0.0f) * uiComp->GetMatrix() * SHVec4(0.0f, 0.0f, 0.0f, 1.0f); + + + SHVec2 topExtent{ topExtent4.x,topExtent4.y }; + SHVec2 btmExtent{ btmExtent4.x,btmExtent4.y }; + auto cameraSystem = SHSystemManager::GetSystem(); + SHVec2 mousePos; + SHVec2 windowSize; +#ifdef SHEDITOR + windowSize = SHEditorWindowManager::GetEditorWindow()->beginContentRegionAvailable; + mousePos = SHEditorWindowManager::GetEditorWindow()->viewportMousePos; + mousePos /= windowSize; +#else + int x, y; + SHInputManager::GetMouseScreenPosition(&x, &y); + mousePos.x = x; + mousePos.y = y; + auto ws = SHSystemManager::GetSystem()->GetWindow()->GetWindowSize(); + windowSize = { static_cast(ws.first), static_cast(ws.second) }; + mousePos /= windowSize; +#endif + + SHVec2 camSize{ cameraSystem->GetCameraWidthHeight(0) }; + //SHLOG_INFO("TopExtent: {}, {}", topExtent.x, topExtent.y) + + topExtent = CanvasToScreenPoint(topExtent, true); + btmExtent = CanvasToScreenPoint(btmExtent, true); + + + comp.value = (mousePos.x - topExtent.x) / (btmExtent.x - topExtent.x); + + if (comp.GetValue() > 1.0f) + comp.value = 1.0f; + if (comp.GetValue() < 0.0f) + comp.value = 0.0f; + } + + if (comp.GetValue() != tempValue) + { + //Set shader value. + + auto renderable = SHComponentManager::GetComponent_s(comp.GetEID()); + //auto texture = SHResourceManager::Get(comp.GetDefaultTexture()); + auto material = renderable->GetModifiableMaterial(); + + material->SetProperty("data.sliderThreshold", comp.GetValue()); + + } + + } + + void SHUISystem::UpdateButtonsRoutine::Execute(double dt) noexcept { SHUISystem* system = (SHUISystem*)GetSystem(); @@ -395,6 +466,13 @@ namespace SHADE if (SHSceneManager::CheckNodeAndComponentsActive(comp.GetEID())) system->UpdateToggleButtonComponent(comp); } + + auto& sliderDense = SHComponentManager::GetDense(); + for (auto& comp : sliderDense) + { + if (SHSceneManager::CheckNodeAndComponentsActive(comp.GetEID())) + system->UpdateSliderComponent(comp); + } } SHVec2 SHUISystem::CanvasToScreenPoint(SHVec2& const canvasPoint, bool normalized) noexcept @@ -415,6 +493,17 @@ namespace SHADE return result; } + void SHUISystem::HideActiveCanvas() noexcept + { + auto& dense = SHComponentManager::GetDense(); + for (auto& canvas : dense) + { + if (SHSceneManager::CheckNodeAndComponentsActive(canvas.GetEID())) + { + SHSceneManager::GetCurrentSceneGraph().SetActive(canvas.GetEID(), false); + } + } + } diff --git a/SHADE_Engine/src/UI/SHUISystem.h b/SHADE_Engine/src/UI/SHUISystem.h index f3f7847e..70308f3d 100644 --- a/SHADE_Engine/src/UI/SHUISystem.h +++ b/SHADE_Engine/src/UI/SHUISystem.h @@ -66,6 +66,8 @@ namespace SHADE void Init(); void Exit(); + void HideActiveCanvas() noexcept; + private: bool loadTexture{false}; @@ -74,7 +76,7 @@ namespace SHADE void UpdateButtonComponent(SHButtonComponent& comp) noexcept; void UpdateToggleButtonComponent(SHToggleButtonComponent& comp) noexcept; void UpdateCanvasComponent(SHCanvasComponent& comp) noexcept; - + void UpdateSliderComponent(SHSliderComponent& comp) noexcept; //returns true on button release. bool CheckButtonHoveredOrClicked(SHUIComponent& comp) noexcept; diff --git a/SHADE_Managed/src/Components/Canvas.cxx b/SHADE_Managed/src/Components/Canvas.cxx new file mode 100644 index 00000000..146b58f7 --- /dev/null +++ b/SHADE_Managed/src/Components/Canvas.cxx @@ -0,0 +1,27 @@ +// Precompiled Headers +#include "SHpch.h" +// Primary Header +#include "Canvas.hxx" +#include "Assets/NativeAsset.hxx" +#include "Utility/Convert.hxx" +#include "Utility/Debug.hxx" + + +#include "ECS_Base/Managers/SHSystemManager.h" +#include "UI/SHUISystem.h" + + +namespace SHADE +{ + Canvas::Canvas(Entity entity) + : Component(entity) + {} + + void Canvas::DeactivateAllCanvas() + { + auto system = SHSystemManager::GetSystem(); + system->HideActiveCanvas(); + } + + +} diff --git a/SHADE_Managed/src/Components/Canvas.hxx b/SHADE_Managed/src/Components/Canvas.hxx new file mode 100644 index 00000000..a17d4bb2 --- /dev/null +++ b/SHADE_Managed/src/Components/Canvas.hxx @@ -0,0 +1,49 @@ +/************************************************************************************//*! +\file Canvas.hxx +\author Daniel Chua, 2001877 +\par email: yeechendaniel/@digipen.edu +\date Feb 26, 2023 +\brief Contains the definition of the managed Canvas class with the + declaration of functions for working with it. + + Note: This file is written in C++17/CLI. + +Copyright (C) 2023 DigiPen Institute of Technology. +Reproduction or disclosure of this file or its contents without the prior written consent +of DigiPen Institute of Technology is prohibited. +*//*************************************************************************************/ +#pragma once + +// Project Includes +#include "Components/Component.hxx" +#include "Math/Vector3.hxx" +#include "Math/Quaternion.hxx" +// External Dependencies +#include "UI/SHCanvasComponent.h" + +namespace SHADE +{ + /// + /// CLR version of the SHADE Engine's SHCanvasComponent. + /// + public ref class Canvas : public Component + { + internal: + /*-----------------------------------------------------------------------------*/ + /* Constructors */ + /*-----------------------------------------------------------------------------*/ + /// + /// Constructs a Canvas Component that represents a native SHCanvasComponent + /// tied to the specified Entity. + /// + /// Entity that this Component will be tied to. + Canvas(Entity entity); + + public: + + static void DeactivateAllCanvas(); + + + }; +} + diff --git a/SHADE_Managed/src/Components/Slider.cxx b/SHADE_Managed/src/Components/Slider.cxx new file mode 100644 index 00000000..163a33a3 --- /dev/null +++ b/SHADE_Managed/src/Components/Slider.cxx @@ -0,0 +1,26 @@ +// Precompiled Headers +#include "SHpch.h" +// Primary Header +#include "Slider.hxx" +#include "Assets/NativeAsset.hxx" +#include "Utility/Convert.hxx" +#include "Utility/Debug.hxx" + + +#include "ECS_Base/Managers/SHSystemManager.h" +#include "UI/SHUISystem.h" + + +namespace SHADE +{ + Slider::Slider(Entity entity) + : Component(entity) + {} + + float Slider::GetValue() + { + return GetNativeComponent()->GetValue(); + } + + +} diff --git a/SHADE_Managed/src/Components/Slider.hxx b/SHADE_Managed/src/Components/Slider.hxx new file mode 100644 index 00000000..7f0efa1e --- /dev/null +++ b/SHADE_Managed/src/Components/Slider.hxx @@ -0,0 +1,49 @@ +/************************************************************************************//*! +\file Slider.hxx +\author Daniel Chua, 2001877 +\par email: yeechendaniel/@digipen.edu +\date Feb 26, 2023 +\brief Contains the definition of the managed Slider class with the + declaration of functions for working with it. + + Note: This file is written in C++17/CLI. + +Copyright (C) 2023 DigiPen Institute of Technology. +Reproduction or disclosure of this file or its contents without the prior written consent +of DigiPen Institute of Technology is prohibited. +*//*************************************************************************************/ +#pragma once + +// Project Includes +#include "Components/Component.hxx" +#include "Math/Vector3.hxx" +#include "Math/Quaternion.hxx" +// External Dependencies +#include "UI/SHSliderComponent.h" + +namespace SHADE +{ + /// + /// CLR version of the SHADE Engine's SHSliderComponent. + /// + public ref class Slider : public Component + { + internal: + /*-----------------------------------------------------------------------------*/ + /* Constructors */ + /*-----------------------------------------------------------------------------*/ + /// + /// Constructs a Slider Component that represents a native SHSliderComponent + /// tied to the specified Entity. + /// + /// Entity that this Component will be tied to. + Slider(Entity entity); + + public: + + float GetValue(); + + + }; +} + diff --git a/SHADE_Managed/src/Components/UIElement.hxx b/SHADE_Managed/src/Components/UIElement.hxx index c93e1e55..d8f741d2 100644 --- a/SHADE_Managed/src/Components/UIElement.hxx +++ b/SHADE_Managed/src/Components/UIElement.hxx @@ -73,6 +73,8 @@ namespace SHADE CallbackEvent^ get(); } + + internal: /*-----------------------------------------------------------------------------*/ /* Static Clear Functions */ diff --git a/SHADE_Managed/src/Engine/ECS.cxx b/SHADE_Managed/src/Engine/ECS.cxx index ecd3784d..38596010 100644 --- a/SHADE_Managed/src/Engine/ECS.cxx +++ b/SHADE_Managed/src/Engine/ECS.cxx @@ -30,18 +30,24 @@ of DigiPen Institute of Technology is prohibited. #include "Graphics\MiddleEnd\Interface\SHRenderable.h" #include "Graphics\MiddleEnd\TextRendering\SHTextRenderableComponent.h" #include "UI\SHUIComponent.h" +#include "UI\SHSliderComponent.h" +#include "UI\SHCanvasComponent.h" // Project Headers #include "Utility/Convert.hxx" #include "Utility/Debug.hxx" -#include "Components/Transform.hxx" -#include "Components/RigidBody.hxx" -#include "Components/Collider.hxx" -#include "Components/Camera.hxx" -#include "Components/CameraArm.hxx" -#include "Components/Light.hxx" +#include "Components\Transform.hxx" +#include "Components\RigidBody.hxx" +#include "Components\Collider.hxx" +#include "Components\Camera.hxx" +#include "Components\CameraArm.hxx" +#include "Components\Light.hxx" #include "Components\Renderable.hxx" #include "Components\TextRenderable.hxx" #include "Components\UIElement.hxx" +#include "Components\Canvas.hxx" +#include "Components\Slider.hxx" + + namespace SHADE { @@ -327,6 +333,8 @@ namespace SHADE componentMap.Add(createComponentSet()); componentMap.Add(createComponentSet()); componentMap.Add(createComponentSet()); + componentMap.Add(createComponentSet()); + componentMap.Add(createComponentSet()); } /*---------------------------------------------------------------------------------*/