New features added #383

Merged
glencelow merged 8 commits from PlayerController into main 2023-03-02 18:31:38 +08:00
6 changed files with 99 additions and 11 deletions
Showing only changes of commit 2af19baccd - Show all commits

View File

@ -4901,7 +4901,7 @@
Components:
Transform Component:
Translate: {x: -8, y: 1.142977, z: -4}
Rotate: {x: -0, y: 0, z: -0}
Rotate: {x: -0, y: 1.57079637, z: -0}
Scale: {x: 0.999999881, y: 1, z: 0.999999881}
IsActive: true
Renderable Component:
@ -4981,7 +4981,7 @@
Components:
Transform Component:
Translate: {x: 0, y: -2.98023224e-08, z: 4.76837158e-07}
Rotate: {x: 0, y: 6.28318548, z: 2.23517329e-08}
Rotate: {x: 0, y: 4.71238899, z: 2.23517329e-08}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Camera Component:
@ -5070,7 +5070,7 @@
IsActive: true
Scripts: ~
- EID: 464
Name: Canvas
Name: StealFoodCanvas
IsActive: true
NumberOfChildren: 1
Components:
@ -5283,3 +5283,39 @@
Clicked: false
IsActive: true
Scripts: ~
- EID: 450
Name: TransitionCanvas
IsActive: true
NumberOfChildren: 1
Components:
Canvas Component:
Canvas Width: 1920
Canvas Height: 1080
Scale by canvas width: false
IsActive: true
Scripts: ~
- EID: 65982
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: 450
Hovered: false
Clicked: false
IsActive: true
Scripts:
- Type: SHADE_Scripting.UI.SceneFadeInOut
Enabled: true
alphaValue: 1
fadeInTime: 0.300000012
fadeOutTime: 0.300000012

View File

@ -3530,8 +3530,8 @@
NumberOfChildren: 5
Components:
Transform Component:
Translate: {x: 2.35245037, y: 0.38365531, z: 7.10571432}
Rotate: {x: 0, y: 0, z: 0}
Translate: {x: 2.35245037, y: 0.0613552481, z: 7.10571432}
Rotate: {x: -0, y: 3.14159274, z: -0}
Scale: {x: 0.999999881, y: 1, z: 0.999999881}
IsActive: true
Renderable Component:
@ -3611,7 +3611,7 @@
Components:
Transform Component:
Translate: {x: 0, y: -5.96046448e-08, z: 0}
Rotate: {x: 0, y: 6.28318548, z: 2.23517329e-08}
Rotate: {x: 0, y: 3.14159274, z: 2.23517329e-08}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Camera Component:
@ -14570,3 +14570,39 @@
rotationAmt: 1800
scaleAmtX: 538
scaleAmtY: 377
- EID: 548
Name: TransitionCanvas
IsActive: true
NumberOfChildren: 1
Components:
Canvas Component:
Canvas Width: 1920
Canvas Height: 1080
Scale by canvas width: false
IsActive: true
Scripts: ~
- EID: 549
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: 548
Hovered: false
Clicked: false
IsActive: true
Scripts:
- Type: SHADE_Scripting.UI.SceneFadeInOut
Enabled: true
alphaValue: 1
fadeInTime: 0.5
fadeOutTime: 0.5

View File

@ -344,6 +344,7 @@ public class PlayerController : Script
private void Rotation()
{
tranform.LocalEulerAngles = new Vector3(0.0f, tranform.LocalEulerAngles.y, 0.0f);
if (isMoveKeyPress && tranform && !isAiming)
{
Quaternion currentRotation = tranform.LocalRotation;
@ -356,6 +357,7 @@ public class PlayerController : Script
Quaternion targetRotation = Quaternion.Euler(0.0f, SHADE.Math.DegreesToRadians(camArm.Yaw + 180.0f), 0.0f);
tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.FixedDeltaTime);
}
}
private void Gravity()

View File

@ -72,6 +72,11 @@ public class GameManager : Script
goingToWin = false;
goingToLose = false;
if (scoreText)
scoreText.GetComponent<TextRenderable>().Text = $"Score: {Score}";
if (timeText)
timeText.GetComponent<TextRenderable>().Text = $"Time Left: {timer.ToString("0")}";
}
protected override void start()
@ -91,7 +96,7 @@ public class GameManager : Script
protected override void update()
{
if (GamePause)
if (GamePause || stealFoodPopUp)
{
return;
}
@ -102,7 +107,7 @@ public class GameManager : Script
if(scoreText)
scoreText.GetComponent<TextRenderable>().Text = $"Score: {Score}";
if(timeText)
timeText.GetComponent<TextRenderable>().Text = $"Time Left: {timer.ToString("0.00")}";
timeText.GetComponent<TextRenderable>().Text = $"Time Left: {timer.ToString("0")}";
if (itemScored)
{

View File

@ -0,0 +1,3 @@
Name: SC_PreviewLevel
ID: 155897609
Type: 9

View File

@ -51,6 +51,13 @@ namespace SHADE_Scripting.UI
//538x377
protected override void update()
{
if (!SceneFadeInOut.Instance.FadeOutFinished())
{
rot.Reset();
scaleX.Reset();
scaleY.Reset();
return;
}
if (!popInDone)
{
@ -84,7 +91,6 @@ namespace SHADE_Scripting.UI
}
}
}
}