New features added #383
|
@ -0,0 +1,8 @@
|
|||
- VertexShader: 46580970
|
||||
FragmentShader: 50110174
|
||||
SubPass: UI
|
||||
Properties:
|
||||
data.color: {x: 0, y: 0, z: 0, w: 1}
|
||||
data.textureIndex: 0
|
||||
data.alpha: 0
|
||||
data.beta: {x: 1, y: 1, z: 1}
|
|
@ -0,0 +1,3 @@
|
|||
Name: UIMat_Black
|
||||
ID: 120016136
|
||||
Type: 7
|
|
@ -20,6 +20,7 @@
|
|||
Canvas Component:
|
||||
Canvas Width: 1920
|
||||
Canvas Height: 1080
|
||||
Scale by canvas width: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 2
|
||||
|
@ -28,7 +29,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0}
|
||||
Translate: {x: 0, y: 0, z: 0.5}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1920, y: 1080, z: 1}
|
||||
IsActive: true
|
||||
|
@ -38,6 +39,8 @@
|
|||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 1
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 5
|
||||
|
@ -46,7 +49,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 75, z: 0}
|
||||
Translate: {x: 0, y: 75, z: 0.400000006}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 400, y: 200, z: 1}
|
||||
IsActive: true
|
||||
|
@ -61,6 +64,8 @@
|
|||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 1
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: ChangeSceneButton
|
||||
|
@ -72,7 +77,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: -200, z: 0}
|
||||
Translate: {x: 0, y: -200, z: 0.400000006}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 400, y: 200, z: 1}
|
||||
IsActive: true
|
||||
|
@ -87,6 +92,8 @@
|
|||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 1
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: QuitButton
|
||||
|
@ -107,10 +114,10 @@
|
|||
Yaw: 0
|
||||
Roll: 0
|
||||
Width: 1920
|
||||
Height: 1080
|
||||
Near: 0.00999999978
|
||||
Far: 10000
|
||||
Perspective: true
|
||||
FOV: 90
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 4
|
||||
|
@ -123,3 +130,39 @@
|
|||
Enabled: true
|
||||
mainGameScene: 86098106
|
||||
mainMainScene: 97158628
|
||||
- EID: 7
|
||||
Name: TransitionCanvas
|
||||
IsActive: true
|
||||
NumberOfChildren: 1
|
||||
Components:
|
||||
Canvas Component:
|
||||
Canvas Width: 1920
|
||||
Canvas Height: 1080
|
||||
Scale by canvas width: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 8
|
||||
Name: Transition
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1920, y: 1080, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 120016136
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 7
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: SHADE_Scripting.UI.SceneFadeInOut
|
||||
Enabled: true
|
||||
alphaValue: 1
|
||||
fadeInTime: 0.5
|
||||
fadeOutTime: 0.5
|
|
@ -216,12 +216,12 @@
|
|||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0}
|
||||
Rotate: {x: 0, y: 0, z: 3.14159274}
|
||||
Scale: {x: 1920, y: 500, z: 1}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1, y: 1, z: 1}
|
||||
IsActive: false
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 129138332
|
||||
Mesh: 0
|
||||
Material: 0
|
||||
IsActive: false
|
||||
UI Component:
|
||||
Canvas ID: 0
|
||||
|
@ -1088,3 +1088,39 @@
|
|||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 55
|
||||
Name: Transition Canvas
|
||||
IsActive: true
|
||||
NumberOfChildren: 1
|
||||
Components:
|
||||
Canvas Component:
|
||||
Canvas Width: 1920
|
||||
Canvas Height: 1080
|
||||
Scale by canvas width: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 56
|
||||
Name: Transition
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1920, y: 1080, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 120016136
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 55
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: SHADE_Scripting.UI.SceneFadeInOut
|
||||
Enabled: true
|
||||
alphaValue: 1
|
||||
fadeInTime: 0.5
|
||||
fadeOutTime: 0.5
|
|
@ -20,6 +20,7 @@
|
|||
Canvas Component:
|
||||
Canvas Width: 1920
|
||||
Canvas Height: 1080
|
||||
Scale by canvas width: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 2
|
||||
|
@ -28,7 +29,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0}
|
||||
Translate: {x: 0, y: 0, z: 0.5}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1920, y: 1080, z: 1}
|
||||
IsActive: true
|
||||
|
@ -38,6 +39,8 @@
|
|||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 1
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 5
|
||||
|
@ -46,7 +49,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 75, z: 0}
|
||||
Translate: {x: 0, y: 75, z: 0.400000006}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 400, y: 200, z: 1}
|
||||
IsActive: true
|
||||
|
@ -61,6 +64,8 @@
|
|||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 1
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: ChangeSceneButton
|
||||
|
@ -72,7 +77,7 @@
|
|||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: -200, z: 0}
|
||||
Translate: {x: 0, y: -200, z: 0.400000006}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 400, y: 200, z: 1}
|
||||
IsActive: true
|
||||
|
@ -87,6 +92,8 @@
|
|||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 1
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: QuitButton
|
||||
|
@ -107,7 +114,6 @@
|
|||
Yaw: 0
|
||||
Roll: 0
|
||||
Width: 1920
|
||||
Height: 1080
|
||||
Near: 0.00999999978
|
||||
Far: 10000
|
||||
Perspective: true
|
||||
|
@ -124,3 +130,39 @@
|
|||
Enabled: true
|
||||
mainGameScene: 86098106
|
||||
mainMainScene: 97158628
|
||||
- EID: 7
|
||||
Name: TransitionCanvas
|
||||
IsActive: true
|
||||
NumberOfChildren: 1
|
||||
Components:
|
||||
Canvas Component:
|
||||
Canvas Width: 1920
|
||||
Canvas Height: 1080
|
||||
Scale by canvas width: false
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
- EID: 8
|
||||
Name: Transition
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 0, z: 0.100000001}
|
||||
Rotate: {x: 0, y: 0, z: 0}
|
||||
Scale: {x: 1920, y: 1080, z: 1}
|
||||
IsActive: true
|
||||
Renderable Component:
|
||||
Mesh: 141771688
|
||||
Material: 120016136
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 7
|
||||
Hovered: false
|
||||
Clicked: false
|
||||
IsActive: true
|
||||
Scripts:
|
||||
- Type: SHADE_Scripting.UI.SceneFadeInOut
|
||||
Enabled: true
|
||||
alphaValue: 1
|
||||
fadeInTime: 0.5
|
||||
fadeOutTime: 0.5
|
|
@ -12,7 +12,7 @@ namespace SHADE_Scripting.Audio
|
|||
public static Dictionary<string, AudioClipHandler> audioClipHandlers = new Dictionary<string, AudioClipHandler>();
|
||||
|
||||
//Functions here, maybe
|
||||
public static void stopAllSounds(bool fadeOut)
|
||||
public static void StopAllSounds(bool fadeOut)
|
||||
{
|
||||
foreach (KeyValuePair<string, AudioClipHandler> h in audioClipHandlers)
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ namespace SHADE_Scripting.Audio
|
|||
}
|
||||
}
|
||||
|
||||
public static void pauseAllSounds(bool pause)
|
||||
public static void PauseAllSounds(bool pause)
|
||||
{
|
||||
foreach (KeyValuePair<string, AudioClipHandler> h in audioClipHandlers)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using SHADE;
|
||||
using SHADE_Scripting.Audio;
|
||||
using SHADE_Scripting.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
@ -44,6 +45,10 @@ public class GameManager : Script
|
|||
|
||||
public bool itemShatter { get; set; }
|
||||
|
||||
//For scene transitions
|
||||
private bool goingToWin;
|
||||
private bool goingToLose;
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
if (Instance != null && Instance != this)
|
||||
|
@ -64,11 +69,13 @@ public class GameManager : Script
|
|||
|
||||
AudioHandler.audioClipHandlers["BGMWin"] = Audio.CreateAudioClip("event:/Music/stingers/game_win");
|
||||
AudioHandler.audioClipHandlers["BGMLose"] = Audio.CreateAudioClip("event:/Music/stingers/game_lose");
|
||||
|
||||
goingToWin = false;
|
||||
goingToLose = false;
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
|
||||
AudioHandler.audioClipHandlers["BGMAdaptive"] = Audio.CreateAudioClip("event:/Music/bgm_adaptive");
|
||||
AudioHandler.audioClipHandlers["BGMAdaptive"].Play();
|
||||
|
||||
|
@ -116,21 +123,34 @@ public class GameManager : Script
|
|||
//multiplierText.GetComponent<Transform>().LocalScale = Vector3.Zero;
|
||||
}
|
||||
|
||||
if ((timer > 0 && totalItemCount <= 0 && !itemShatter) || Input.GetKeyDown(Input.KeyCode.F1))
|
||||
if (!goingToLose && ((timer > 0 && totalItemCount <= 0 && !itemShatter) || Input.GetKeyDown(Input.KeyCode.F1)))
|
||||
{
|
||||
currGameState = GameState.WIN;
|
||||
AudioHandler.stopAllSounds(false);
|
||||
AudioHandler.StopAllSounds(false);
|
||||
AudioHandler.audioClipHandlers["BGMWin"].Play();
|
||||
SceneManager.ChangeScene(winScene);
|
||||
|
||||
goingToWin = true;
|
||||
SceneFadeInOut.Instance.CallFadeIn();
|
||||
}
|
||||
else if(timer < 0 || Input.GetKeyDown(Input.KeyCode.F2))
|
||||
else if(!goingToWin && (timer < 0 || Input.GetKeyDown(Input.KeyCode.F2)))
|
||||
{
|
||||
currGameState = GameState.LOSE;
|
||||
AudioHandler.stopAllSounds(false);
|
||||
AudioHandler.StopAllSounds(false);
|
||||
AudioHandler.audioClipHandlers["BGMLose"].Play();
|
||||
SceneManager.ChangeScene(loseScene);
|
||||
goingToLose = true;
|
||||
SceneFadeInOut.Instance.CallFadeIn();
|
||||
}
|
||||
}
|
||||
|
||||
//Handling transitions
|
||||
if (SceneFadeInOut.Instance.FadeInFinished())
|
||||
{
|
||||
if (goingToWin)
|
||||
{
|
||||
SceneManager.ChangeScene(winScene);
|
||||
}
|
||||
if (goingToLose)
|
||||
{
|
||||
SceneManager.ChangeScene(loseScene);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,19 @@
|
|||
using System;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using SHADE;
|
||||
using SHADE_Scripting.UI;
|
||||
|
||||
public class ChangeSceneButton : Script
|
||||
{
|
||||
public uint sceneID = 0;
|
||||
|
||||
//Whether the scene changing button has been clicked
|
||||
private bool clickedFlag;
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
clickedFlag = false;
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
|
@ -17,8 +26,11 @@ public class ChangeSceneButton : Script
|
|||
if (sceneID != 0)
|
||||
{
|
||||
Audio.PlaySFXOnce2D("event:/UI/success");
|
||||
SceneManager.ChangeScene(sceneID);
|
||||
|
||||
Audio.StopAllSounds();
|
||||
|
||||
SceneFadeInOut.Instance.CallFadeIn();
|
||||
clickedFlag = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -30,6 +42,9 @@ public class ChangeSceneButton : Script
|
|||
}
|
||||
protected override void update()
|
||||
{
|
||||
|
||||
if (clickedFlag && sceneID != 0 && SceneFadeInOut.Instance.FadeInFinished())
|
||||
{
|
||||
SceneManager.ChangeScene(sceneID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public class EndScene : Script
|
|||
{
|
||||
//Audio.PlaySFXOnce2D("event:/UI/success");
|
||||
//Audio.StopAllSounds();
|
||||
AudioHandler.stopAllSounds(false);
|
||||
AudioHandler.StopAllSounds(false);
|
||||
AudioHandler.audioClipHandlers["SFXUISuccess"].Play();
|
||||
SceneManager.ChangeScene(mainGameScene);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class EndScene : Script
|
|||
{
|
||||
//Audio.PlaySFXOnce2D("event:/UI/success");
|
||||
//Audio.StopAllSounds();
|
||||
AudioHandler.stopAllSounds(false);
|
||||
AudioHandler.StopAllSounds(false);
|
||||
AudioHandler.audioClipHandlers["SFXUISuccess"].Play();
|
||||
SceneManager.ChangeScene(mainMainScene);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public class PauseMenu : Script
|
|||
if (GameManager.Instance.GamePause)
|
||||
{
|
||||
GameManager.Instance.GamePause = false;
|
||||
AudioHandler.pauseAllSounds(false);
|
||||
AudioHandler.PauseAllSounds(false);
|
||||
if (gamePauseText)
|
||||
gamePauseText.Enabled = false;
|
||||
if (canvas)
|
||||
|
@ -91,7 +91,7 @@ public class PauseMenu : Script
|
|||
if (Input.GetKeyDown(Input.KeyCode.Escape) && !GameManager.Instance.GamePause && !GameManager.Instance.stealFoodPopUp)
|
||||
{
|
||||
GameManager.Instance.GamePause = true;
|
||||
AudioHandler.pauseAllSounds(true);
|
||||
AudioHandler.PauseAllSounds(true);
|
||||
if (gamePauseText)
|
||||
gamePauseText.Enabled = true;
|
||||
if (canvas)
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
using SHADE;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SHADE_Scripting.UI
|
||||
{
|
||||
public class SceneFadeInOut : Script
|
||||
{
|
||||
//[Tooltip("If true, the panel fadeUI fades in (increasing alpha). If false, no fading. Mutually exclusive with fadeIn")]
|
||||
private bool fadeIn;
|
||||
|
||||
//[Tooltip("If true, the panel fadeUI fades out (decreasing alpha). If false, no fading. Mutually exclusive with fadeIn")]
|
||||
private bool fadeOut;
|
||||
|
||||
[Tooltip("The initial alpha value of the UI that is faded. Between 0 and 1 inclusive.")]
|
||||
public float alphaValue;
|
||||
|
||||
[SerializeField]
|
||||
private float fadeInTime;
|
||||
|
||||
[SerializeField]
|
||||
private float fadeOutTime;
|
||||
|
||||
private Renderable fadeR;
|
||||
|
||||
public static SceneFadeInOut Instance { get; private set; }
|
||||
|
||||
protected override void awake()
|
||||
{
|
||||
if (Instance != null && Instance != this)
|
||||
RemoveScript<SceneFadeInOut>();
|
||||
else
|
||||
Instance = this;
|
||||
|
||||
fadeR = GameObject.GetComponent<Renderable>();
|
||||
fadeR.Material.SetProperty<float>("data.alpha", alphaValue);
|
||||
//alphaValue = fadeR.Material.GetProperty<float>("data.alpha");
|
||||
}
|
||||
|
||||
protected override void start()
|
||||
{
|
||||
CallFadeOut();
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
{
|
||||
if (fadeR != null)
|
||||
{
|
||||
if (fadeIn) //fading in
|
||||
{
|
||||
fadeOut = false;
|
||||
if (fadeInTime == 0.0f)
|
||||
{
|
||||
alphaValue = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
alphaValue += (1.0f / fadeInTime) * Time.DeltaTimeF;
|
||||
}
|
||||
if (alphaValue >= 1.0f) alphaValue = 1.0f;
|
||||
}
|
||||
|
||||
if (fadeOut) //fading out
|
||||
{
|
||||
fadeIn = false;
|
||||
if (fadeOutTime == 0.0f)
|
||||
{
|
||||
alphaValue = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
alphaValue -= (1.0f / fadeOutTime) * Time.DeltaTimeF;
|
||||
}
|
||||
if (alphaValue <= 0.0f) alphaValue = 0.0f;
|
||||
}
|
||||
|
||||
fadeR.Material.SetProperty<float>("data.alpha", alphaValue);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void onDestroy()
|
||||
{
|
||||
if (Instance == this)
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
public void CallFadeIn()
|
||||
{
|
||||
fadeIn = true;
|
||||
fadeOut = false;
|
||||
}
|
||||
|
||||
public void CallFadeOut()
|
||||
{
|
||||
fadeOut = true;
|
||||
fadeIn = false;
|
||||
}
|
||||
|
||||
public void CallFadeStop()
|
||||
{
|
||||
fadeOut = false;
|
||||
fadeIn = false;
|
||||
}
|
||||
|
||||
public bool FadeOutFinished()
|
||||
{
|
||||
return (alphaValue <= 0.0f);
|
||||
}
|
||||
|
||||
public bool FadeInFinished()
|
||||
{
|
||||
return (alphaValue >= 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
Name: SC_SceneFadeInOut
|
||||
ID: 153328192
|
||||
Type: 9
|
|
@ -0,0 +1,49 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
#extension GL_ARB_shading_language_420pack : enable
|
||||
#extension GL_EXT_nonuniform_qualifier : require
|
||||
|
||||
struct MatPropData
|
||||
{
|
||||
vec4 color;
|
||||
int textureIndex;
|
||||
float alpha;
|
||||
};
|
||||
|
||||
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 = MatProp.data[In2.materialIndex].color;
|
||||
if (fragColor.a < 0.01f)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
fragColor.a = MatProp.data[In2.materialIndex].alpha;
|
||||
|
||||
// fragColor.a = 1.0f;
|
||||
outEntityID = In2.eid;
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
Name: UI_Black_FS
|
||||
ID: 50110174
|
||||
Type: 2
|
|
@ -174,7 +174,6 @@ namespace Sandbox
|
|||
SHSceneManager::InitSceneManager<SBMainScene>(editorConfig.workingSceneID);
|
||||
#else
|
||||
SHSceneManager::InitSceneManager<SBMainScene>(appConfig.startingSceneID);
|
||||
window.SetMouseVisible(false);
|
||||
#endif
|
||||
SHFrameRateController::UpdateFRC();
|
||||
|
||||
|
@ -183,7 +182,6 @@ namespace Sandbox
|
|||
|
||||
auto clip = SHResourceManager::LoadOrGet<SHAnimationClip>(77816045);
|
||||
auto rig = SHResourceManager::LoadOrGet<SHRig>(77816045);
|
||||
int i = 0;
|
||||
}
|
||||
|
||||
void SBApplication::Update(void)
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
#include "../AssetBrowser/SHAssetBrowser.h"
|
||||
#include "Assets/SHAssetManager.h"
|
||||
#include "Assets/Asset Types/SHPrefabAsset.h"
|
||||
#include "Camera/SHCameraSystem.h"
|
||||
#include "FRC/SHFramerateController.h"
|
||||
|
||||
|
||||
namespace SHADE
|
||||
|
@ -442,7 +444,24 @@ namespace SHADE
|
|||
//Handle node selection
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
if (ImGui::IsMouseReleased(ImGuiMouseButton_Left))
|
||||
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left))
|
||||
{
|
||||
editor->selectedEntities.clear();
|
||||
editor->selectedEntities.push_back(eid);
|
||||
if(auto camSystem = SHSystemManager::GetSystem<SHCameraSystem>())
|
||||
{
|
||||
if(auto editorCam = camSystem->GetEditorCamera())
|
||||
{
|
||||
if(auto entityTransform = SHComponentManager::GetComponent_s<SHTransformComponent>(eid))
|
||||
{
|
||||
editorCam->SetPosition(entityTransform->GetWorldPosition() + SHVec3(0.5f));
|
||||
camSystem->CameraLookAt(*editorCam, entityTransform->GetWorldPosition());
|
||||
camSystem->UpdateEditorCamera(SHFrameRateController::GetRawDeltaTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ImGui::IsMouseReleased(ImGuiMouseButton_Left))
|
||||
{
|
||||
if (!isSelected)
|
||||
{
|
||||
|
|
|
@ -387,14 +387,14 @@ namespace SHADE
|
|||
}
|
||||
|
||||
SHEditorWidgets::BeginPanel("Offsets",{ ImGui::GetContentRegionAvail().x, 30.0f });
|
||||
SHEditorWidgets::DragVec3("Position", { "X", "Y", "Z" }, [&collisionShape] {return collisionShape->GetPositionOffset(); }, [&collisionShape](SHVec3 const& vec) {collisionShape->SetPositionOffset(vec); });
|
||||
SHEditorWidgets::DragVec3("Position", { "X", "Y", "Z" }, [collisionShape] {return collisionShape->GetPositionOffset(); }, [collisionShape](SHVec3 const& vec) {collisionShape->SetPositionOffset(vec); });
|
||||
SHEditorWidgets::DragVec3("Rotation", { "X", "Y", "Z" },
|
||||
[&collisionShape]
|
||||
[collisionShape]
|
||||
{
|
||||
auto offset = collisionShape->GetRotationOffset();
|
||||
return offset;
|
||||
},
|
||||
[&collisionShape](SHVec3 const& vec)
|
||||
[collisionShape](SHVec3 const& vec)
|
||||
{
|
||||
collisionShape->SetRotationOffset(vec);
|
||||
}, true);
|
||||
|
|
|
@ -157,16 +157,16 @@ namespace SHADE
|
|||
if (ImGui::BeginViewportSideBar("MainStatusBar", ImGui::GetMainViewport(), ImGuiDir_Down, menuBarHeight, editorMenuBarFlags))
|
||||
{
|
||||
auto camSystem = SHSystemManager::GetSystem<SHCameraSystem>();
|
||||
std::string editorCamPosText{};
|
||||
std::string editorCamPosText{}, editorRotText{};
|
||||
auto editorCam = camSystem->GetEditorCamera();
|
||||
if(editorCam)
|
||||
{
|
||||
auto editorCamPos = editorCam->GetPosition();
|
||||
editorCamPosText = std::format("Editor Cam [X: {:.3f}, Y: {:.3f}, Z: {:.3f}]", editorCamPos.x, editorCamPos.y, editorCamPos.z);
|
||||
|
||||
editorRotText = std::format("[Pitch: {:.3f}, Yaw: {:.3f}, Roll: {:.3f}]", editorCam->GetPitch(), editorCam->GetYaw(), editorCam->GetRoll());
|
||||
//ImGui::Text(editorCamPosText.data());
|
||||
}
|
||||
ImGui::Text("Entity count: %zu %s", SHEntityManager::GetEntityCount(), editorCamPosText.data());
|
||||
ImGui::Text("Entity count: %zu | %s | %s", SHEntityManager::GetEntityCount(), editorCamPosText.data(), editorRotText.data());
|
||||
if(ImGui::BeginPopupContextItem("EditorCamPosContext"))
|
||||
{
|
||||
if(editorCam)
|
||||
|
@ -186,6 +186,20 @@ namespace SHADE
|
|||
auto editorCamPos = editorCam->GetPosition();
|
||||
SHClipboardUtilities::WriteToClipboard(std::format("{:.3f}", editorCamPos.z));
|
||||
}
|
||||
if (ImGui::Selectable("Copy Editor Cam Pitch"))
|
||||
{
|
||||
SHClipboardUtilities::WriteToClipboard(std::format("{:.3f}", editorCam->GetPitch()));
|
||||
}
|
||||
if (ImGui::Selectable("Copy Editor Cam Yaw"))
|
||||
{
|
||||
auto editorCamPos = editorCam->GetPosition();
|
||||
SHClipboardUtilities::WriteToClipboard(std::format("{:.3f}",editorCam->GetYaw()));
|
||||
}
|
||||
if (ImGui::Selectable("Copy Editor Cam Roll"))
|
||||
{
|
||||
auto editorCamPos = editorCam->GetPosition();
|
||||
SHClipboardUtilities::WriteToClipboard(std::format("{:.3f}",editorCam->GetRoll()));
|
||||
}
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
|
|
@ -183,10 +183,22 @@ namespace SHADE
|
|||
return WindowSize(screenWidth, screenHeight);
|
||||
}
|
||||
|
||||
bool SHWindow::GetMouseVisible()
|
||||
{
|
||||
CURSORINFO cursorInfo{};
|
||||
cursorInfo.cbSize = sizeof(cursorInfo);
|
||||
BOOL result = GetCursorInfo(&cursorInfo);
|
||||
if(!result)
|
||||
{
|
||||
auto error = GetLastError();
|
||||
SHLOG_ERROR("SHWindow: Failed to get cursor info")
|
||||
}
|
||||
return cursorInfo.flags != 0;
|
||||
}
|
||||
|
||||
void SHWindow::SetMouseVisible(bool show)
|
||||
{
|
||||
if (GetActiveWindow() == wndHWND)
|
||||
ShowCursor(show);
|
||||
ShowCursor(show);
|
||||
}
|
||||
|
||||
void SHWindow::SetMousePosition(int x, int y)
|
||||
|
|
|
@ -104,7 +104,8 @@ namespace SHADE
|
|||
//Get size of display the window is in (whichever window contains the window origin)
|
||||
WindowSize GetCurrentDisplaySize() const;
|
||||
|
||||
void SetMouseVisible(bool show);
|
||||
static bool GetMouseVisible();
|
||||
static void SetMouseVisible(bool show);
|
||||
|
||||
void SetMousePosition(int x = -1, int y = -1);
|
||||
|
||||
|
|
|
@ -71,7 +71,14 @@ namespace SHADE
|
|||
{
|
||||
return SHGraphicsSystemInterface::SetFullscreen(value);
|
||||
}*/
|
||||
|
||||
bool Application::IsCursorVisible::get()
|
||||
{
|
||||
return SHWindow::GetMouseVisible();
|
||||
}
|
||||
void Application::IsCursorVisible::set(bool value)
|
||||
{
|
||||
SHWindow::SetMouseVisible(value);
|
||||
}
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* Usage Functions */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
|
|
@ -73,6 +73,12 @@ namespace SHADE
|
|||
//void set(bool value);
|
||||
}
|
||||
|
||||
static property bool IsCursorVisible
|
||||
{
|
||||
bool get();
|
||||
void set(bool value);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
/* Usage Functions */
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
|
|
Loading…
Reference in New Issue