added text to maingame
This commit is contained in:
parent
ee4e31f45f
commit
af93e59d0e
|
@ -8198,125 +8198,6 @@
|
||||||
Strength: 0.699999988
|
Strength: 0.699999988
|
||||||
IsActive: true
|
IsActive: true
|
||||||
Scripts: ~
|
Scripts: ~
|
||||||
- EID: 2
|
|
||||||
Name: Player
|
|
||||||
IsActive: true
|
|
||||||
NumberOfChildren: 3
|
|
||||||
Components:
|
|
||||||
Transform Component:
|
|
||||||
Translate: {x: 2.12735963, y: 0.362327814, z: 6.98932981}
|
|
||||||
Rotate: {x: -0, y: 0, z: -0}
|
|
||||||
Scale: {x: 0.999999881, y: 1, z: 0.999999881}
|
|
||||||
IsActive: true
|
|
||||||
Renderable Component:
|
|
||||||
Mesh: 149697411
|
|
||||||
Material: 126974645
|
|
||||||
IsActive: true
|
|
||||||
RigidBody Component:
|
|
||||||
Type: Dynamic
|
|
||||||
Drag: 1
|
|
||||||
Angular Drag: 0.100000001
|
|
||||||
Use Gravity: false
|
|
||||||
Interpolate: true
|
|
||||||
Sleeping Enabled: true
|
|
||||||
Freeze Position X: false
|
|
||||||
Freeze Position Y: true
|
|
||||||
Freeze Position Z: false
|
|
||||||
Freeze Rotation X: true
|
|
||||||
Freeze Rotation Y: true
|
|
||||||
Freeze Rotation Z: true
|
|
||||||
IsActive: true
|
|
||||||
Collider Component:
|
|
||||||
Colliders:
|
|
||||||
- Is Trigger: false
|
|
||||||
Type: Box
|
|
||||||
Half Extents: {x: 0.400000006, y: 0.5, z: 0.300000012}
|
|
||||||
Friction: 0.400000006
|
|
||||||
Bounciness: 0
|
|
||||||
Density: 1
|
|
||||||
Position Offset: {x: 0, y: 0.25, z: 0}
|
|
||||||
Rotation Offset: {x: 0, y: 0, z: 0}
|
|
||||||
IsActive: true
|
|
||||||
Scripts:
|
|
||||||
- Type: PlayerController
|
|
||||||
Enabled: true
|
|
||||||
respawnPoint: 239
|
|
||||||
currentState: 0
|
|
||||||
maxMoveVel: 3
|
|
||||||
moveForce: 50
|
|
||||||
sprintMultiplier: 1.5
|
|
||||||
rotationFactorPerFrame: 5
|
|
||||||
maxJumpHeight: 1
|
|
||||||
maxJumpTime: 0.5
|
|
||||||
fallMultipler: 3
|
|
||||||
lightMultiper: 0.75
|
|
||||||
mediumMultiper: 0.5
|
|
||||||
heavyMultiper: 0.25
|
|
||||||
- Type: PickAndThrow
|
|
||||||
Enabled: true
|
|
||||||
throwForce: [300, 300, 300]
|
|
||||||
delayTimer: 1
|
|
||||||
aimingLength: 0.5
|
|
||||||
- EID: 3
|
|
||||||
Name: HoldingPoint
|
|
||||||
IsActive: true
|
|
||||||
NumberOfChildren: 0
|
|
||||||
Components:
|
|
||||||
Transform Component:
|
|
||||||
Translate: {x: 0, y: 0.699999988, z: 0.200000003}
|
|
||||||
Rotate: {x: 0, y: 0, z: -0}
|
|
||||||
Scale: {x: 1, y: 1, z: 1}
|
|
||||||
IsActive: true
|
|
||||||
Scripts: ~
|
|
||||||
- EID: 4
|
|
||||||
Name: PlayerCamera
|
|
||||||
IsActive: true
|
|
||||||
NumberOfChildren: 0
|
|
||||||
Components:
|
|
||||||
Transform Component:
|
|
||||||
Translate: {x: 0, y: 0, z: 0}
|
|
||||||
Rotate: {x: 0, y: 6.28318548, z: 2.23517329e-08}
|
|
||||||
Scale: {x: 1, y: 1, z: 1}
|
|
||||||
IsActive: true
|
|
||||||
Camera Component:
|
|
||||||
Position: {x: 2.12735963, y: 0.362327814, z: 7.98932981}
|
|
||||||
Pitch: 0
|
|
||||||
Yaw: 360
|
|
||||||
Roll: 1.28065994e-06
|
|
||||||
Width: 1920
|
|
||||||
Height: 1080
|
|
||||||
Near: 0.00999999978
|
|
||||||
Far: 10000
|
|
||||||
Perspective: true
|
|
||||||
IsActive: true
|
|
||||||
Camera Arm Component:
|
|
||||||
Arm Pitch: 0
|
|
||||||
Arm Yaw: 0
|
|
||||||
Arm Length: 1
|
|
||||||
Look At Camera Origin: true
|
|
||||||
IsActive: true
|
|
||||||
Scripts:
|
|
||||||
- Type: SHADE_Scripting.ThirdPersonCamera
|
|
||||||
Enabled: true
|
|
||||||
armLength: 1
|
|
||||||
turnSpeedPitch: 0.300000012
|
|
||||||
turnSpeedYaw: 0.5
|
|
||||||
pitchClamp: 45
|
|
||||||
- EID: 9
|
|
||||||
Name: PlayerBag
|
|
||||||
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
|
|
||||||
Renderable Component:
|
|
||||||
Mesh: 144838771
|
|
||||||
Material: 123745521
|
|
||||||
IsActive: true
|
|
||||||
Scripts: ~
|
|
||||||
- EID: 240
|
- EID: 240
|
||||||
Name: ====ItemPool====
|
Name: ====ItemPool====
|
||||||
IsActive: true
|
IsActive: true
|
||||||
|
@ -8355,7 +8236,7 @@
|
||||||
Colliders:
|
Colliders:
|
||||||
- Is Trigger: false
|
- Is Trigger: false
|
||||||
Type: Box
|
Type: Box
|
||||||
Half Extents: {x: 0.100000001, y: 0.100000001, z: 0.100000001}
|
Half Extents: {x: 0.200000003, y: 0.200000003, z: 0.200000003}
|
||||||
Friction: 0.400000006
|
Friction: 0.400000006
|
||||||
Bounciness: 0
|
Bounciness: 0
|
||||||
Density: 1
|
Density: 1
|
||||||
|
@ -8363,7 +8244,7 @@
|
||||||
Rotation Offset: {x: 0, y: 0, z: 0}
|
Rotation Offset: {x: 0, y: 0, z: 0}
|
||||||
- Is Trigger: true
|
- Is Trigger: true
|
||||||
Type: Box
|
Type: Box
|
||||||
Half Extents: {x: 0.300000012, y: 0.300000012, z: 0.300000012}
|
Half Extents: {x: 0.400000006, y: 0.400000006, z: 0.400000006}
|
||||||
Friction: 0.400000006
|
Friction: 0.400000006
|
||||||
Bounciness: 0
|
Bounciness: 0
|
||||||
Density: 1
|
Density: 1
|
||||||
|
@ -8425,8 +8306,8 @@
|
||||||
Scripts:
|
Scripts:
|
||||||
- Type: Item
|
- Type: Item
|
||||||
Enabled: true
|
Enabled: true
|
||||||
Score: 10
|
Score: 100
|
||||||
currCategory: 0
|
currCategory: 2
|
||||||
- EID: 241
|
- EID: 241
|
||||||
Name: Mesh_Meat
|
Name: Mesh_Meat
|
||||||
IsActive: true
|
IsActive: true
|
||||||
|
@ -8477,8 +8358,8 @@
|
||||||
Scripts:
|
Scripts:
|
||||||
- Type: Item
|
- Type: Item
|
||||||
Enabled: true
|
Enabled: true
|
||||||
Score: 10
|
Score: 50
|
||||||
currCategory: 0
|
currCategory: 1
|
||||||
- EID: 15
|
- EID: 15
|
||||||
Name: ====ScoreZonePool====
|
Name: ====ScoreZonePool====
|
||||||
IsActive: true
|
IsActive: true
|
||||||
|
@ -8561,6 +8442,185 @@
|
||||||
Scripts:
|
Scripts:
|
||||||
- Type: ScoringZone
|
- Type: ScoringZone
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
- EID: 238
|
||||||
|
Name: ====GameManager====
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components: ~
|
||||||
|
Scripts:
|
||||||
|
- Type: GameManager
|
||||||
|
Enabled: true
|
||||||
|
itemPool: 240
|
||||||
|
zonePool: 15
|
||||||
|
winScene: 92009475
|
||||||
|
loseScene: 91685359
|
||||||
|
currGameState: 0
|
||||||
|
totalItemCount: 0
|
||||||
|
Score: 0
|
||||||
|
timer: 100
|
||||||
|
scoreText: 237
|
||||||
|
timeText: 206
|
||||||
|
- EID: 199
|
||||||
|
Name: =====Text====
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 2
|
||||||
|
Components: ~
|
||||||
|
Scripts: ~
|
||||||
|
- EID: 237
|
||||||
|
Name: Score
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: -800, y: 400, z: 0}
|
||||||
|
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
|
||||||
|
IsActive: true
|
||||||
|
Scripts: ~
|
||||||
|
- EID: 206
|
||||||
|
Name: Timer
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 500, y: 400, z: 0}
|
||||||
|
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
|
||||||
|
IsActive: true
|
||||||
|
Scripts: ~
|
||||||
|
- EID: 198
|
||||||
|
Name: ====Raccoon====
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 2
|
||||||
|
Components: ~
|
||||||
|
Scripts: ~
|
||||||
|
- EID: 2
|
||||||
|
Name: Player
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 3
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 2.12735963, y: 0.362327814, z: 6.98932981}
|
||||||
|
Rotate: {x: 0, y: 0, z: 0}
|
||||||
|
Scale: {x: 0.999999881, y: 1, z: 0.999999881}
|
||||||
|
IsActive: true
|
||||||
|
Renderable Component:
|
||||||
|
Mesh: 149697411
|
||||||
|
Material: 126974645
|
||||||
|
IsActive: true
|
||||||
|
RigidBody Component:
|
||||||
|
Type: Dynamic
|
||||||
|
Drag: 1
|
||||||
|
Angular Drag: 0.100000001
|
||||||
|
Use Gravity: false
|
||||||
|
Interpolate: true
|
||||||
|
Sleeping Enabled: true
|
||||||
|
Freeze Position X: false
|
||||||
|
Freeze Position Y: true
|
||||||
|
Freeze Position Z: false
|
||||||
|
Freeze Rotation X: true
|
||||||
|
Freeze Rotation Y: true
|
||||||
|
Freeze Rotation Z: true
|
||||||
|
IsActive: true
|
||||||
|
Collider Component:
|
||||||
|
Colliders:
|
||||||
|
- Is Trigger: false
|
||||||
|
Type: Box
|
||||||
|
Half Extents: {x: 0.400000006, y: 0.5, z: 0.300000012}
|
||||||
|
Friction: 0.400000006
|
||||||
|
Bounciness: 0
|
||||||
|
Density: 1
|
||||||
|
Position Offset: {x: 0, y: 0.25, z: 0}
|
||||||
|
Rotation Offset: {x: 0, y: 0, z: 0}
|
||||||
|
IsActive: true
|
||||||
|
Scripts:
|
||||||
|
- Type: PlayerController
|
||||||
|
Enabled: true
|
||||||
|
respawnPoint: 239
|
||||||
|
currentState: 0
|
||||||
|
maxMoveVel: 3
|
||||||
|
moveForce: 50
|
||||||
|
sprintMultiplier: 1.5
|
||||||
|
rotationFactorPerFrame: 5
|
||||||
|
maxJumpHeight: 1
|
||||||
|
maxJumpTime: 0.5
|
||||||
|
fallMultipler: 3
|
||||||
|
lightMultiper: 0.75
|
||||||
|
mediumMultiper: 0.5
|
||||||
|
heavyMultiper: 0.25
|
||||||
|
- Type: PickAndThrow
|
||||||
|
Enabled: true
|
||||||
|
throwForce: [50, 50, 50]
|
||||||
|
delayTimer: 1
|
||||||
|
aimingLength: 0.5
|
||||||
|
- EID: 3
|
||||||
|
Name: HoldingPoint
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 0, y: 0.700000048, z: 0.200000286}
|
||||||
|
Rotate: {x: 0, y: 0, z: -0}
|
||||||
|
Scale: {x: 1, y: 1, z: 1}
|
||||||
|
IsActive: true
|
||||||
|
Scripts: ~
|
||||||
|
- EID: 4
|
||||||
|
Name: PlayerCamera
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 0, y: -2.98023224e-08, z: 4.76837158e-07}
|
||||||
|
Rotate: {x: 0, y: 6.28318548, z: 2.23517329e-08}
|
||||||
|
Scale: {x: 1, y: 1, z: 1}
|
||||||
|
IsActive: true
|
||||||
|
Camera Component:
|
||||||
|
Position: {x: 2.12735963, y: 0.362327784, z: 7.98933029}
|
||||||
|
Pitch: 0
|
||||||
|
Yaw: 360
|
||||||
|
Roll: 1.28065994e-06
|
||||||
|
Width: 1920
|
||||||
|
Height: 1080
|
||||||
|
Near: 0.00999999978
|
||||||
|
Far: 10000
|
||||||
|
Perspective: true
|
||||||
|
IsActive: true
|
||||||
|
Camera Arm Component:
|
||||||
|
Arm Pitch: 0
|
||||||
|
Arm Yaw: 0
|
||||||
|
Arm Length: 1
|
||||||
|
Look At Camera Origin: true
|
||||||
|
IsActive: true
|
||||||
|
Scripts:
|
||||||
|
- Type: SHADE_Scripting.ThirdPersonCamera
|
||||||
|
Enabled: true
|
||||||
|
armLength: 1
|
||||||
|
turnSpeedPitch: 0.300000012
|
||||||
|
turnSpeedYaw: 0.5
|
||||||
|
pitchClamp: 45
|
||||||
|
- EID: 9
|
||||||
|
Name: PlayerBag
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 0, y: -2.98023224e-08, z: 4.76837158e-07}
|
||||||
|
Rotate: {x: 0, y: 0, z: -0}
|
||||||
|
Scale: {x: 1, y: 1, z: 1}
|
||||||
|
IsActive: true
|
||||||
|
Renderable Component:
|
||||||
|
Mesh: 144838771
|
||||||
|
Material: 123745521
|
||||||
|
IsActive: true
|
||||||
|
Scripts: ~
|
||||||
- EID: 239
|
- EID: 239
|
||||||
Name: RespawnPoint
|
Name: RespawnPoint
|
||||||
IsActive: true
|
IsActive: true
|
||||||
|
@ -8568,7 +8628,7 @@
|
||||||
Components:
|
Components:
|
||||||
Transform Component:
|
Transform Component:
|
||||||
Translate: {x: 2.5, y: 0.660660267, z: 7}
|
Translate: {x: 2.5, y: 0.660660267, z: 7}
|
||||||
Rotate: {x: -0, y: 0, z: -0}
|
Rotate: {x: 0, y: 0, z: 0}
|
||||||
Scale: {x: 1, y: 1, z: 1}
|
Scale: {x: 1, y: 1, z: 1}
|
||||||
IsActive: true
|
IsActive: true
|
||||||
Scripts: ~
|
Scripts: ~
|
|
@ -2,6 +2,7 @@
|
||||||
using SHADE_Scripting;
|
using SHADE_Scripting;
|
||||||
using System;
|
using System;
|
||||||
using static PlayerController;
|
using static PlayerController;
|
||||||
|
using static Item;
|
||||||
|
|
||||||
public class PickAndThrow : Script
|
public class PickAndThrow : Script
|
||||||
{
|
{
|
||||||
|
@ -17,6 +18,7 @@ public class PickAndThrow : Script
|
||||||
private RigidBody itemRidibody;
|
private RigidBody itemRidibody;
|
||||||
private Transform raccoonHoldLocation;
|
private Transform raccoonHoldLocation;
|
||||||
private Transform playerTran;
|
private Transform playerTran;
|
||||||
|
private Item itemScript;
|
||||||
private ThirdPersonCamera tpc;
|
private ThirdPersonCamera tpc;
|
||||||
private float lastXDir;
|
private float lastXDir;
|
||||||
private float lastZDir;
|
private float lastZDir;
|
||||||
|
@ -59,7 +61,6 @@ public class PickAndThrow : Script
|
||||||
|
|
||||||
if (Input.GetMouseButtonDown(Input.MouseCode.LeftButton))
|
if (Input.GetMouseButtonDown(Input.MouseCode.LeftButton))
|
||||||
{
|
{
|
||||||
Debug.Log("AIMING");
|
|
||||||
pc.isAiming = true;
|
pc.isAiming = true;
|
||||||
pc.camArm.ArmLength = aimingLength;
|
pc.camArm.ArmLength = aimingLength;
|
||||||
}
|
}
|
||||||
|
@ -73,19 +74,36 @@ public class PickAndThrow : Script
|
||||||
pc.holdItem = false;
|
pc.holdItem = false;
|
||||||
inRange = false;
|
inRange = false;
|
||||||
itemRidibody.IsGravityEnabled = true;
|
itemRidibody.IsGravityEnabled = true;
|
||||||
itemRidibody.AddForce(new Vector3(throwForce.x * lastXDir, throwForce.y, throwForce.z * lastZDir));
|
if (itemScript)
|
||||||
|
{
|
||||||
|
Vector3 vec = new Vector3(throwForce.x * lastXDir, throwForce.y, throwForce.z * lastZDir);
|
||||||
|
if (itemScript.currCategory == ItemCategory.LIGHT)
|
||||||
|
itemRidibody.AddForce(vec * 0.3f);
|
||||||
|
if (itemScript.currCategory == ItemCategory.MEDIUM)
|
||||||
|
itemRidibody.AddForce(vec * 0.75f);
|
||||||
|
if (itemScript.currCategory == ItemCategory.HEAVY)
|
||||||
|
itemRidibody.AddForce(vec);
|
||||||
|
}
|
||||||
itemRidibody.LinearVelocity += pc.rb.LinearVelocity;
|
itemRidibody.LinearVelocity += pc.rb.LinearVelocity;
|
||||||
ResetItemObject();
|
ResetItemObject();
|
||||||
timer = 0.0f;
|
timer = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetMouseButtonDown(Input.MouseCode.RightButton))
|
if (Input.GetMouseButtonDown(Input.MouseCode.RightButton) && !pc.isAiming)
|
||||||
{
|
{
|
||||||
pc.holdItem = false;
|
pc.holdItem = false;
|
||||||
inRange = false;
|
inRange = false;
|
||||||
itemRidibody.IsGravityEnabled = true;
|
itemRidibody.IsGravityEnabled = true;
|
||||||
ResetItemObject();
|
ResetItemObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Input.GetMouseButtonDown(Input.MouseCode.RightButton) && pc.isAiming)
|
||||||
|
{
|
||||||
|
pc.isAiming = false;
|
||||||
|
if (tpc)
|
||||||
|
pc.camArm.ArmLength = tpc.armLength;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (!pc.holdItem)
|
else if (!pc.holdItem)
|
||||||
itemRidibody.IsGravityEnabled = true;
|
itemRidibody.IsGravityEnabled = true;
|
||||||
|
@ -105,6 +123,7 @@ public class PickAndThrow : Script
|
||||||
{
|
{
|
||||||
itemRidibody = null;
|
itemRidibody = null;
|
||||||
itemTransform = null;
|
itemTransform = null;
|
||||||
|
itemScript = null;
|
||||||
item = new GameObject();
|
item = new GameObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,6 +150,10 @@ public class PickAndThrow : Script
|
||||||
itemTransform.LocalEulerAngles = Vector3.Zero;
|
itemTransform.LocalEulerAngles = Vector3.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
itemScript = item.GetScript<Item>();
|
||||||
|
if(!itemScript)
|
||||||
|
Debug.Log("Item script EMPTY");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,20 +29,19 @@ public class GameManager : Script
|
||||||
private IEnumerable<Item> listOfItems;
|
private IEnumerable<Item> listOfItems;
|
||||||
private IEnumerable<ScoringZone> listOfZone;
|
private IEnumerable<ScoringZone> listOfZone;
|
||||||
|
|
||||||
|
public GameObject scoreText;
|
||||||
|
public GameObject timeText;
|
||||||
|
|
||||||
|
private bool once = true;
|
||||||
|
|
||||||
|
|
||||||
protected override void awake()
|
protected override void awake()
|
||||||
{
|
{
|
||||||
|
Audio.PlayBGMOnce2D("event:/Music/player_undetected");
|
||||||
totalItemCount = 0;
|
totalItemCount = 0;
|
||||||
Score = 0;
|
Score = 0;
|
||||||
currGameState = GameState.START;
|
currGameState = GameState.START;
|
||||||
|
|
||||||
if (itemPool)
|
|
||||||
{
|
|
||||||
listOfItems = itemPool.GetScriptsInChildren<Item>();
|
|
||||||
if (listOfItems != null)
|
|
||||||
foreach (Item i in listOfItems)
|
|
||||||
totalItemCount += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (zonePool)
|
if (zonePool)
|
||||||
{
|
{
|
||||||
listOfZone = zonePool.GetScriptsInChildren<ScoringZone>();
|
listOfZone = zonePool.GetScriptsInChildren<ScoringZone>();
|
||||||
|
@ -54,20 +53,37 @@ public class GameManager : Script
|
||||||
|
|
||||||
protected override void update()
|
protected override void update()
|
||||||
{
|
{
|
||||||
if (timer > 0 && currGameState == GameState.START)
|
if (once)
|
||||||
|
{
|
||||||
|
if (itemPool)
|
||||||
|
{
|
||||||
|
listOfItems = itemPool.GetScriptsInChildren<Item>();
|
||||||
|
if (listOfItems != null)
|
||||||
|
foreach (Item i in listOfItems)
|
||||||
|
totalItemCount += 1;
|
||||||
|
}
|
||||||
|
once = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currGameState == GameState.START)
|
||||||
{
|
{
|
||||||
timer -= Time.DeltaTimeF;
|
timer -= Time.DeltaTimeF;
|
||||||
if (totalItemCount <= 0)
|
if(scoreText)
|
||||||
|
scoreText.GetComponent<TextRenderable>().Text = $"Score: {Score}";
|
||||||
|
if(timeText)
|
||||||
|
timeText.GetComponent<TextRenderable>().Text = $"Time Left: {timer.ToString("0.00")}";
|
||||||
|
|
||||||
|
if (timer > 0 && totalItemCount <= 0)
|
||||||
{
|
{
|
||||||
currGameState = GameState.WIN;
|
currGameState = GameState.WIN;
|
||||||
SceneManager.ChangeScene(winScene);
|
SceneManager.ChangeScene(winScene);
|
||||||
}
|
}
|
||||||
}
|
else if(timer < 0)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
currGameState = GameState.LOSE;
|
currGameState = GameState.LOSE;
|
||||||
SceneManager.ChangeScene(loseScene);
|
SceneManager.ChangeScene(loseScene);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -365,7 +365,7 @@ namespace YAML
|
||||||
if (!gfxSystem)
|
if (!gfxSystem)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
rhs.SetFont(SHResourceManager::LoadOrGet<SHFont>(node[TEXT_YAML_TAG.data()].as<AssetID>()));
|
rhs.SetFont(SHResourceManager::LoadOrGet<SHFont>(node[FONT_YAML_TAG.data()].as<AssetID>()));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue