Credits scene

This commit is contained in:
maverickdgg 2023-04-01 16:31:23 +08:00
parent e9d0b01972
commit d5240b420d
6 changed files with 181 additions and 1 deletions

View File

@ -0,0 +1,112 @@
- NavData: 0
- EID: 0
Name: Camera
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Camera Component:
Position: {x: 0, y: 0, z: 0}
Pitch: 0
Yaw: 0
Roll: 0
Width: 1920
Near: 0.00999999978
Far: 10000
Perspective: true
FOV: 90
IsActive: true
Scripts: ~
- 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: Scrolling Credits
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: -3800, z: 1.5}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1920, y: 8026, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 120332672
IsActive: true
UI Component:
Canvas ID: 46
Hovered: false
Clicked: false
IsActive: true
Scripts:
- Type: SHADE_Scripting.UI.ScrollingCredits
Enabled: true
endY: 4300
duration: 27
- Type: SHADE_Scripting.UI.TransitToMainMenu
Enabled: true
timeToTransit: 27
sceneToChange: 97158628
- EID: 49
Name: Credits Title Text
IsActive: false
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -150, y: 400, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 100, y: 100, z: 1}
IsActive: false
Text Renderer Component:
Text: Credits
Font: 174412429
Color: {x: 0, y: 0, z: 0, w: 1}
Text Size: {x: 1, y: 1, z: 1}
IsActive: false
UI Component:
Canvas ID: 46
Hovered: false
Clicked: false
IsActive: false
Scripts: ~
- EID: 55
Name: BackGround
IsActive: false
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 1.5}
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: 54
Name: TweenManager
IsActive: true
NumberOfChildren: 0
Components: ~
Scripts:
- Type: TweenManager
Enabled: true

View File

@ -0,0 +1,3 @@
Name: CreditsScene
ID: 97376761
Type: 5

View File

@ -11,6 +11,8 @@ using System.Threading.Tasks;
EASE_OUT_BOUNCE,
EASE_IN_BOUNCE,
EASE_INOUT_BOUNCE,
EASE_OUT_CIRCLE,
EASE_OUT_BACK,
LINEAR
}
@ -49,6 +51,14 @@ public static class EasingHelper
case EASING_METHOD.LINEAR:
{
return value;
}
case EASING_METHOD.EASE_OUT_CIRCLE:
{
return EaseOutCircle(value);
}
case EASING_METHOD.EASE_OUT_BACK:
{
return EaseOutBack(value);
}
default:
@ -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

@ -35,7 +35,8 @@ namespace SHADE_Scripting.UI
protected override void update()
{
if (thread == null)
return;
if(isActive != lastActive && isActive == true)
{
thread.Reset();

View File

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SHADE;
namespace SHADE_Scripting.UI
{
public class TransitToMainMenu: Script
{
public float timeToTransit = 0.0f;
public uint sceneToChange = 0;
private float timer = 0.0f;
private bool sceneChanged = false;
protected override void start()
{
timer = timeToTransit;
sceneChanged = false;
}
protected override void update()
{
timer -= Time.DeltaTimeF;
if(timer <= 0.0f && sceneChanged == false)
{
SceneManager.ChangeScene(sceneToChange);
sceneChanged = true;
}
}
}
}

View File

@ -0,0 +1,3 @@
Name: TransitToMainMenu
ID: 159865134
Type: 9