Bug fixes and scene changes #267
|
@ -8220,7 +8220,7 @@
|
|||
Interpolate: true
|
||||
Sleeping Enabled: true
|
||||
Freeze Position X: false
|
||||
Freeze Position Y: false
|
||||
Freeze Position Y: true
|
||||
Freeze Position Z: false
|
||||
Freeze Rotation X: true
|
||||
Freeze Rotation Y: true
|
||||
|
@ -8240,6 +8240,7 @@
|
|||
Scripts:
|
||||
- Type: PlayerController
|
||||
Enabled: true
|
||||
respawnPoint: 239
|
||||
currentState: 0
|
||||
maxMoveVel: 3
|
||||
moveForce: 50
|
||||
|
@ -8255,14 +8256,14 @@
|
|||
Enabled: true
|
||||
throwForce: [300, 300, 300]
|
||||
delayTimer: 1
|
||||
aimingLength: 1.5
|
||||
aimingLength: 0.5
|
||||
- EID: 3
|
||||
Name: HoldingPoint
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 0, y: 1.20000005, z: 0.5}
|
||||
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
|
||||
|
@ -8369,7 +8370,11 @@
|
|||
Position Offset: {x: 0, y: 0, z: 0}
|
||||
Rotation Offset: {x: 0, y: 0, z: 0}
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
Scripts:
|
||||
- Type: Item
|
||||
Enabled: true
|
||||
Score: 10
|
||||
currCategory: 0
|
||||
- EID: 242
|
||||
Name: Mesh_Cheese
|
||||
IsActive: true
|
||||
|
@ -8417,7 +8422,11 @@
|
|||
Position Offset: {x: 0, y: 0, z: 0}
|
||||
Rotation Offset: {x: 0, y: 0, z: 0}
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
Scripts:
|
||||
- Type: Item
|
||||
Enabled: true
|
||||
Score: 10
|
||||
currCategory: 0
|
||||
- EID: 241
|
||||
Name: Mesh_Meat
|
||||
IsActive: true
|
||||
|
@ -8465,7 +8474,11 @@
|
|||
Position Offset: {x: 0, y: 0, z: 0}
|
||||
Rotation Offset: {x: 0, y: 0, z: 0}
|
||||
IsActive: true
|
||||
Scripts: ~
|
||||
Scripts:
|
||||
- Type: Item
|
||||
Enabled: true
|
||||
Score: 10
|
||||
currCategory: 0
|
||||
- EID: 15
|
||||
Name: ====ScoreZonePool====
|
||||
IsActive: true
|
||||
|
@ -8548,3 +8561,14 @@
|
|||
Scripts:
|
||||
- Type: ScoringZone
|
||||
Enabled: true
|
||||
- EID: 239
|
||||
Name: RespawnPoint
|
||||
IsActive: true
|
||||
NumberOfChildren: 0
|
||||
Components:
|
||||
Transform Component:
|
||||
Translate: {x: 2.5, y: 0.660660267, z: 7}
|
||||
Rotate: {x: -0, y: 0, z: -0}
|
||||
Scale: {x: 1, y: 1, z: 1}
|
||||
IsActive: true
|
||||
Scripts: ~
|
|
@ -17,14 +17,14 @@ public class PlayerController : Script
|
|||
TOTAL
|
||||
}
|
||||
|
||||
public enum WalkingState
|
||||
/* public enum WalkingState
|
||||
{
|
||||
CARRY,
|
||||
AIMING,
|
||||
THROW,
|
||||
WALK,
|
||||
TOTAL
|
||||
}
|
||||
}*/
|
||||
|
||||
public RigidBody rb { get; set; }
|
||||
private Transform tranform;
|
||||
|
@ -36,6 +36,9 @@ public class PlayerController : Script
|
|||
public bool holdItem { get; set; }
|
||||
public bool isAiming { get; set; }
|
||||
|
||||
public GameObject respawnPoint;
|
||||
private float delayTimer = 0.0f;
|
||||
|
||||
[Tooltip("The current state fo the raccoon")]
|
||||
public RaccoonStates currentState = RaccoonStates.IDLE;
|
||||
|
||||
|
@ -113,8 +116,27 @@ public class PlayerController : Script
|
|||
|
||||
}
|
||||
|
||||
protected override void lateUpdate()
|
||||
{
|
||||
//rb.FreezePositionY = false;
|
||||
}
|
||||
protected override void update()
|
||||
{
|
||||
if (delayTimer <= 1)
|
||||
delayTimer += Time.DeltaTimeF;
|
||||
|
||||
if (delayTimer < 1)
|
||||
{
|
||||
if (tranform && respawnPoint && rb)
|
||||
{
|
||||
rb.LinearVelocity = Vector3.Zero;
|
||||
tranform.LocalPosition = respawnPoint.GetComponent<Transform>().LocalPosition;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rb.FreezePositionY = false;
|
||||
}
|
||||
//PickAndThrow check
|
||||
if (!pat)
|
||||
{
|
||||
|
@ -138,6 +160,7 @@ public class PlayerController : Script
|
|||
|
||||
protected override void fixedUpdate()
|
||||
{
|
||||
|
||||
MoveKey();
|
||||
Move();
|
||||
Sprint();
|
||||
|
@ -341,12 +364,12 @@ public class PlayerController : Script
|
|||
|
||||
private void GotCaught()
|
||||
{
|
||||
if (currentState == RaccoonStates.CAUGHT && tranform != null)
|
||||
if (currentState == RaccoonStates.CAUGHT && tranform && respawnPoint)
|
||||
{
|
||||
currentState = RaccoonStates.IDLE;
|
||||
if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState)))
|
||||
stateMachine.SetState(typeof(PlayerIdleState));
|
||||
tranform.LocalPosition = new Vector3(-3.0f, -2.0f, -5.0f);
|
||||
tranform.LocalPosition = respawnPoint.GetComponent<Transform>().LocalPosition;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,9 @@ public class GameManager : Script
|
|||
public GameObject itemPool;
|
||||
public GameObject zonePool;
|
||||
|
||||
public uint winScene = 92009475;
|
||||
public uint loseScene = 91685359;
|
||||
|
||||
[NonSerialized]
|
||||
public GameState currGameState;
|
||||
[NonSerialized]
|
||||
|
@ -57,10 +60,14 @@ public class GameManager : Script
|
|||
if (totalItemCount <= 0)
|
||||
{
|
||||
currGameState = GameState.WIN;
|
||||
SceneManager.ChangeScene(winScene);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
currGameState = GameState.LOSE;
|
||||
SceneManager.ChangeScene(loseScene);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ public class MainMenu : Script
|
|||
{
|
||||
protected override void awake()
|
||||
{
|
||||
Audio.PlayBGMOnce2D("event:/Music/player_undetected");
|
||||
}
|
||||
protected override void update()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue