Scene changes #451

Merged
glencelow merged 3 commits from PlayerController into main 2023-04-01 16:11:08 +08:00
21 changed files with 480 additions and 71 deletions
Showing only changes of commit f70a41a9dc - Show all commits

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 40208610
SubPass: UI
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 50770098
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: UIMat_Transistion
ID: 132131066
Type: 7

View File

@ -8811,7 +8811,7 @@
popInDuration: 0.5
popOutDuration: 0.075000003
stayDuration: 1
rotationAmt: 1800
rotationAmt: 360
scaleAmtX: 538
scaleAmtY: 377
- EID: 463
@ -8830,6 +8830,7 @@
Scripts:
- Type: SHADE_Scripting.UI.PreviewLevel
Enabled: true
levelTransistion: 619
endPoint1: [-5.5, 1.5, -2]
endPoint2: [1, 1.5, -7.5]
endPoint3: [2.5, 1.5, -3]
@ -9669,3 +9670,64 @@
Clicked: false
IsActive: true
Scripts: ~
- EID: 619
Name: LevelTransistionCanvas
IsActive: true
NumberOfChildren: 2
Components:
Canvas Component:
Canvas Width: 1920
Canvas Height: 1080
Scale by canvas width: false
IsActive: true
Scripts:
- Type: LevelTransistion
Enabled: true
logo: 618
bg: 617
duration: 0.5
bgEndPositionX: 3000
logoEndPositionX: 3000
rotAndScale: false
rotationAmt: 360
scaleAmt: 631
- EID: 618
Name: LevelTransistionLogo
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 631, y: 631, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 126117259
IsActive: true
UI Component:
Canvas ID: 619
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 617
Name: LevelTransistionBG
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0.200000003}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 4000, y: 4000, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 132131066
IsActive: true
UI Component:
Canvas ID: 619
Hovered: false
Clicked: false
IsActive: true
Scripts: ~

View File

@ -17026,7 +17026,7 @@
popInDuration: 0.5
popOutDuration: 0.075000003
stayDuration: 1
rotationAmt: 1800
rotationAmt: 360
scaleAmtX: 538
scaleAmtY: 377
- EID: 551
@ -17081,6 +17081,7 @@
Scripts:
- Type: SHADE_Scripting.UI.PreviewLevel
Enabled: true
levelTransistion: 609
endPoint1: [-3.5, 1.5, -4.5]
endPoint2: [0, 2, 4.5]
endPoint3: [1.14999998, 2.20000005, 2]
@ -17635,3 +17636,64 @@
Clicked: false
IsActive: true
Scripts: ~
- EID: 609
Name: LevelTransistionCanvas
IsActive: true
NumberOfChildren: 2
Components:
Canvas Component:
Canvas Width: 1920
Canvas Height: 1080
Scale by canvas width: false
IsActive: true
Scripts:
- Type: LevelTransistion
Enabled: true
logo: 608
bg: 607
duration: 0.5
bgEndPositionX: 3000
logoEndPositionX: 3000
rotAndScale: false
rotationAmt: 360
scaleAmt: 631
- EID: 608
Name: LevelTransistionLogo
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 631, y: 631, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 126117259
IsActive: true
UI Component:
Canvas ID: 609
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 607
Name: LevelTransistionBG
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0.200000003}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 4000, y: 4000, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 132131066
IsActive: true
UI Component:
Canvas ID: 609
Hovered: false
Clicked: false
IsActive: true
Scripts: ~

View File

@ -8802,7 +8802,7 @@
popInDuration: 0.5
popOutDuration: 0.075000003
stayDuration: 1
rotationAmt: 1800
rotationAmt: 360
scaleAmtX: 538
scaleAmtY: 377
- EID: 547
@ -9379,6 +9379,7 @@
Scripts:
- Type: SHADE_Scripting.UI.PreviewLevel
Enabled: true
levelTransistion: 230
endPoint1: [-1.79999995, 1.5, 0.5]
endPoint2: [5, 3.5, 0.5]
endPoint3: [-0.5, 1.5, 3.5]
@ -12823,7 +12824,7 @@
NumberOfChildren: 8
Components:
Transform Component:
Translate: {x: 5.5, y: 0.300000012, z: 10}
Translate: {x: 5.5, y: 0.0124755427, z: 10}
Rotate: {x: -0, y: -3.1415925, z: 0}
Scale: {x: 0.999999404, y: 1, z: 0.999999404}
IsActive: true
@ -15973,3 +15974,64 @@
Clicked: false
IsActive: true
Scripts: ~
- EID: 230
Name: LevelTransistionCanvas
IsActive: true
NumberOfChildren: 2
Components:
Canvas Component:
Canvas Width: 1920
Canvas Height: 1080
Scale by canvas width: false
IsActive: true
Scripts:
- Type: LevelTransistion
Enabled: true
logo: 229
bg: 228
duration: 0.5
bgEndPositionX: 3000
logoEndPositionX: 3000
rotAndScale: false
rotationAmt: 360
scaleAmt: 631
- EID: 229
Name: LevelTransistionLogo
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 631, y: 631, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 126117259
IsActive: true
UI Component:
Canvas ID: 230
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 228
Name: LevelTransistionBG
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0.200000003}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 4000, y: 4000, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 132131066
IsActive: true
UI Component:
Canvas ID: 230
Hovered: false
Clicked: false
IsActive: true
Scripts: ~

View File

@ -55,6 +55,7 @@
minScale: 1
maxScale: 1.20000005
duration: 1.5
isActive: true
- EID: 54
Name: Main Menu Button Group
IsActive: true
@ -1440,7 +1441,7 @@
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -800, y: 450, z: 0}
Translate: {x: -800, y: 450, z: 0.300000012}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 273, y: 100, z: 1}
IsActive: true
@ -1476,7 +1477,7 @@
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -250, y: 400, z: 0.100000001}
Translate: {x: -250, y: 400, z: 0.300000012}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 100, y: 100, z: 1}
IsActive: true
@ -1536,7 +1537,7 @@
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -600, y: 0, z: 0}
Translate: {x: -600, y: 0, z: 0.300000012}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 345, y: 800, z: 1}
IsActive: true
@ -1557,7 +1558,8 @@
Scripts:
- Type: ChangeSceneButton
Enabled: true
sceneID: 91947920
sceneID: 96668835
levelTransistion: 433
- Type: SHADE_Scripting.UI.ButtonFX
Enabled: true
onHoverEnterSound: event:/UI/botton_hover
@ -1572,7 +1574,7 @@
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Translate: {x: 0, y: 0, z: 0.300000012}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 345, y: 800, z: 1}
IsActive: true
@ -1594,6 +1596,7 @@
- Type: ChangeSceneButton
Enabled: true
sceneID: 86098106
levelTransistion: 433
- Type: SHADE_Scripting.UI.ButtonFX
Enabled: true
onHoverEnterSound: event:/UI/botton_hover
@ -1608,7 +1611,7 @@
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 600, y: 0, z: 0}
Translate: {x: 600, y: 0, z: 0.300000012}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 345, y: 800, z: 1}
IsActive: true
@ -1630,6 +1633,7 @@
- Type: ChangeSceneButton
Enabled: true
sceneID: 88928066
levelTransistion: 433
- Type: SHADE_Scripting.UI.ButtonFX
Enabled: true
onHoverEnterSound: event:/UI/botton_hover
@ -1640,14 +1644,14 @@
clickScale: 0.899999976
- EID: 450
Name: TransitionCanvas
IsActive: false
IsActive: true
NumberOfChildren: 1
Components:
Canvas Component:
Canvas Width: 1920
Canvas Height: 1080
Scale by canvas width: false
IsActive: false
IsActive: true
Scripts: ~
- EID: 65982
Name: Transition
@ -1674,3 +1678,64 @@
alphaValue: 0
fadeInTime: 0.5
fadeOutTime: 0.5
- EID: 433
Name: LevelTransistionCanvas
IsActive: false
NumberOfChildren: 2
Components:
Canvas Component:
Canvas Width: 1920
Canvas Height: 1080
Scale by canvas width: false
IsActive: false
Scripts:
- Type: LevelTransistion
Enabled: true
logo: 431
bg: 432
duration: 0.800000012
bgEndPositionX: 0
logoEndPositionX: 0
rotAndScale: true
rotationAmt: 360
scaleAmt: 631
- EID: 431
Name: LevelTransistionLogo
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 0, y: 0, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 126117259
IsActive: true
UI Component:
Canvas ID: 433
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 432
Name: LevelTransistionBG
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -2500, y: 0, z: 0.200000003}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 4000, y: 4000, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 132131066
IsActive: true
UI Component:
Canvas ID: 433
Hovered: false
Clicked: false
IsActive: true
Scripts: ~

View File

@ -108,9 +108,6 @@ public class GameManager : Script
AudioHandler.audioClipHandlers["KitchenAmbience"] = Audio.CreateAudioClip("event:/Ambience/roomtone_kitchen");
AudioHandler.audioClipHandlers["KitchenAmbience"].Play();
if (SceneFadeInOut.Instance != null)
SceneFadeInOut.Instance.CallFadeOut();
GamePause = false;
}

View File

@ -9,6 +9,7 @@ namespace SHADE_Scripting.UI
public class PreviewLevel : Script
{
private List<Camera> listOfCamera;
public GameObject levelTransistion;
public Vector3 endPoint1;
public Vector3 endPoint2;
@ -56,7 +57,7 @@ namespace SHADE_Scripting.UI
protected override void update()
{
if (SceneFadeInOut.Instance && !SceneFadeInOut.Instance.FadeOutFinished() && !point1Done)
if (SceneFadeInOut.Instance && !levelTransistion.GetScript<LevelTransistion>().complete && !point1Done)
{
moveToEndPoint1.Reset();
return;

View File

@ -4,15 +4,17 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
public enum EASING_METHOD
{
public enum EASING_METHOD
{
EASE_IN_SINE,
EASE_OUT_SINE,
EASE_OUT_BOUNCE,
EASE_IN_BOUNCE,
EASE_INOUT_BOUNCE,
EASE_OUT_CIRCLE,
EASE_OUT_BACK,
LINEAR
}
}
public static class EasingHelper
{
@ -50,6 +52,14 @@ public static class EasingHelper
{
return value;
}
case EASING_METHOD.EASE_OUT_CIRCLE:
{
return EaseOutCircle(value);
}
case EASING_METHOD.EASE_OUT_BACK:
{
return EaseOutBack(value);
}
default:
return 0.0f;
@ -102,5 +112,18 @@ public static class EasingHelper
: (1.0f + EaseOutBounce(2.0f * value - 1.0f)) / 2.0f;
}
private static float EaseOutCircle(float value)
{
return (float)Math.Sqrt(1.0f - (float)Math.Pow(value - 1.0f, 2.0f));
}
private static float EaseOutBack(float value)
{
const float c1 = 1.70158f;
const float c3 = c1 + 1.0f;
return 1.0f + c3 * (float)Math.Pow(value - 1.0f, 3.0f) + c1 * (float)Math.Pow(value - 1.0f, 2.0f);
}
}

View File

@ -7,7 +7,8 @@ public class ChangeSceneButton : Script
{
public uint sceneID = 0;
//Whether the scene changing button has been clicked
public GameObject levelTransistion;
private bool clickedFlag;
protected override void awake()
@ -26,9 +27,8 @@ public class ChangeSceneButton : Script
{
Audio.PlaySFXOnce2D("event:/UI/success");
Audio.StopAllSounds();
if (SceneFadeInOut.Instance != null)
SceneFadeInOut.Instance.CallFadeIn();
clickedFlag = true;
levelTransistion.SetActive(true);
}
});
}
@ -39,7 +39,7 @@ public class ChangeSceneButton : Script
}
protected override void update()
{
if (clickedFlag && sceneID != 0 && SceneFadeInOut.Instance.FadeInFinished())
if (levelTransistion.GetScript<LevelTransistion>().complete && clickedFlag)
{
SceneManager.ChangeScene(sceneID);
}

View File

@ -0,0 +1,75 @@
using SHADE;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public class LevelTransistion : Script
{
public GameObject logo;
public GameObject bg;
public float duration = 2.0f;
public float bgEndPositionX = 2500;
public float logoEndPositionX = 2500;
public bool rotAndScale = true;
public float rotationAmt = 360;
public float scaleAmt = 631;
public bool complete { get; set; }
private Transform logoTran;
private Transform bgTran;
private TweenThread bgTween;
private TweenThread logoTween;
private TweenThread rot;
private TweenThread scale;
protected override void awake()
{
logoTran = logo.GetComponent<Transform>();
if (!logoTran)
Debug.LogError("MISSING LOGO TRAN");
bgTran = bg.GetComponent<Transform>();
if (!bgTran)
Debug.LogError("MISSING BG TRAN");
complete = false;
}
protected override void start()
{
bgTween = TweenManager.CreateTweenThread(duration, bgTran.LocalPosition.x, bgEndPositionX, EASING_METHOD.EASE_OUT_CIRCLE);
logoTween = TweenManager.CreateTweenThread(duration , logoTran.LocalPosition.x, logoEndPositionX, EASING_METHOD.EASE_OUT_CIRCLE);
rot = TweenManager.CreateTweenThread(duration , 0, rotationAmt, EASING_METHOD.EASE_OUT_BACK);
scale = TweenManager.CreateTweenThread(duration, 0, scaleAmt, EASING_METHOD.EASE_OUT_BACK);
}
protected override void update()
{
if (bgTween != null)
bgTran.LocalPosition = new Vector3(bgTween.GetValue(), 0, bgTran.LocalPosition.z);
if (rotAndScale)
{
logoTran.LocalScale = new Vector3(scale.GetValue(), scale.GetValue(), 1);
logoTran.LocalEulerAngles = new Vector3(0, 0, SHADE.Math.DegreesToRadians(rot.GetValue()));
}
else
{
logoTran.LocalPosition = new Vector3(logoTween.GetValue(), 0, logoTran.LocalPosition.z);
}
if (bgTween.IsCompleted() && logoTween.IsCompleted())
complete = true;
}
}

View File

@ -0,0 +1,3 @@
Name: SC_LevelTransistion
ID: 158044875
Type: 9

View File

@ -26,6 +26,7 @@ public class MainMenu : Script
{
Input.SetMouseCentering(false);
Application.IsCursorVisible = true;
if(SceneFadeInOut.Instance)
SceneFadeInOut.Instance.CallFadeOut();
}
protected override void update()

View File

@ -35,9 +35,9 @@ public class StealFoodPopUp : Script
protected override void start()
{
rot = TweenManager.CreateTweenThread(popInDuration, 0, rotationAmt, EASING_METHOD.EASE_IN_SINE);
scaleX = TweenManager.CreateTweenThread(popInDuration, 0, scaleAmtX, EASING_METHOD.EASE_IN_SINE);
scaleY = TweenManager.CreateTweenThread(popInDuration, 0, scaleAmtY, EASING_METHOD.EASE_IN_SINE);
rot = TweenManager.CreateTweenThread(popInDuration * 0.4f, 0, rotationAmt, EASING_METHOD.LINEAR);
scaleX = TweenManager.CreateTweenThread(popInDuration, 0, scaleAmtX, EASING_METHOD.EASE_OUT_BACK);
scaleY = TweenManager.CreateTweenThread(popInDuration, 0, scaleAmtY, EASING_METHOD.EASE_OUT_BACK);
tran = GetComponent<Transform>();
if (!tran)

View File

@ -0,0 +1,41 @@
#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;
};
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);
outEntityID = In2.eid;
}

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: UI_TRANSISTION_FS
ID: 40208610
Type: 2

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_TransistionBG
ID: 50770098
Type: 3

View File

@ -47,7 +47,7 @@ namespace SHADE
/// <summary>
/// Maximum number of descriptor sets allowed
/// </summary>
uint32_t MaxSets = 100;
uint32_t MaxSets = 300;
/// <summary>
/// Flags used to create the DescriptorPool
/// </summary>