Gameplay UI on Level 2. #390

Merged
maverickdgg merged 3 commits from SP3-20-UI-System into main 2023-03-04 12:42:43 +08:00
4 changed files with 86 additions and 16 deletions
Showing only changes of commit 6d1e179baf - Show all commits

View File

@ -2279,18 +2279,38 @@
IsActive: true
Scripts: ~
- EID: 206
Name: Timer
Name: Timer Text
IsActive: true
NumberOfChildren: 0
NumberOfChildren: 1
Components:
Transform Component:
Translate: {x: 500, y: 400, z: 0}
Translate: {x: 700, y: 400, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 60, y: 60, z: 60}
IsActive: true
Text Renderer Component:
Text: My name is Brandon.
Font: 176667660
Font: 174412429
IsActive: true
UI Component:
Canvas ID: 199
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 526
Name: Timer BG
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.5, y: 0.300000012, z: 0.98999995}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 5, y: 2, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 126220632
IsActive: true
UI Component:
Canvas ID: 199
@ -4882,7 +4902,7 @@
Components:
Transform Component:
Translate: {x: 0, y: -300, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Rotate: {x: 724.5, y: 424.5, z: 59.9999962}
Scale: {x: 400, y: 100, z: 500}
IsActive: true
Renderable Component:

View File

@ -1100,7 +1100,11 @@
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
Scripts:
- Type: SHADE_Scripting.UI.ScrollingCredits
Enabled: true
endY: 4000
duration: 20
- EID: 48
Name: BackButton
IsActive: true
@ -1131,23 +1135,23 @@
canvasToActivate: 0
- EID: 49
Name: Credits Title Text
IsActive: true
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: true
IsActive: false
Text Renderer Component:
Text: Credits
Font: 174412429
IsActive: true
IsActive: false
UI Component:
Canvas ID: 46
Hovered: false
Clicked: false
IsActive: true
IsActive: false
Scripts: ~
- EID: 50
Name: Level Select Canvas

View File

@ -106,12 +106,10 @@ public class GameManager : Script
if(scoreText)
scoreText.GetComponent<TextRenderable>().Text = $"{Score}";
if(timeText)
timeText.GetComponent<TextRenderable>().Text = $"Time Left: {timer.ToString("0.00")}";
timeText.GetComponent<TextRenderable>().Text = $"{timer.ToString("0.00")}";
if (itemScored)
{
//multiplierText.GetComponent<TextRenderable>().Text = $"X {currMultiplierCombo}";
//multiplierText.GetComponent<Transform>().LocalScale -= fontScalar * Time.DeltaTimeF;
currMultiplierDuration += Time.DeltaTimeF;
if (currMultiplierDuration >= maxMultiplierDuration)
@ -170,7 +168,6 @@ public class GameManager : Script
totalItemCount -= 1;
itemScored = true;
currMultiplierDuration = 0;
//multiplierText.GetComponent<Transform>().LocalScale = new Vector3(multiplierFont, multiplierFont, multiplierFont);
if (currMultiplierCombo < maxMultiplierCombo)
currMultiplierCombo += 1;

View File

@ -0,0 +1,49 @@
using System;
using SHADE;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SHADE_Scripting.UI
{
public class ScrollingCredits: Script
{
public float endY = 4000.0f;
public float duration = 30.0f;
[NonSerialized]
TweenThread thread;
protected override void awake()
{
base.awake();
}
protected override void start()
{
base.start();
Transform transform = GetComponent<Transform>();
if(transform != null)
{
thread = TweenManager.CreateTweenThread(duration, transform.LocalPosition.y, endY, EASING_METHOD.EASE_IN_SINE);
}
}
protected override void update()
{
base.update();
Transform transform = GetComponent<Transform>();
if(thread != null && transform != null)
{
transform.LocalPosition = new Vector3( transform.LocalPosition.x ,thread.GetValue() , transform.LocalPosition.z);
}
}
}
}