Fixed AI C# Script for final submission #283

Merged
mushgunAX merged 8 commits from AIFinalFixesGAM300M3 into main 2022-11-25 22:33:58 +08:00
16 changed files with 2489 additions and 114 deletions
Showing only changes of commit a541565e55 - Show all commits

View File

@ -1,4 +1,4 @@
Start in Fullscreen: false Start in Fullscreen: false
Starting Scene ID: 86098106 Starting Scene ID: 97158628
Window Size: {x: 1920, y: 1080} Window Size: {x: 1920, y: 1080}
Window Title: SHADE Engine Window Title: SHADE Engine

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,46 @@
Name: MD_BreakableObjects1
ID: 68661596
Type: 4
Sub Assets:
Name: Plate01_Unshattered
ID: 140964851
Type: 8
Name: Plate01_Shattered.004
ID: 136742160
Type: 8
Name: Plate01_Shattered.001
ID: 146557542
Type: 8
Name: Plate01_Shattered.002
ID: 145439064
Type: 8
Name: Plate01_Shattered.003
ID: 139411134
Type: 8
Name: Bowl01_Unshattered
ID: 144894491
Type: 8
Name: Bowl01_Shattered.001
ID: 140591337
Type: 8
Name: Bowl01_Shattered.002
ID: 148464002
Type: 8
Name: Bowl01_Shattered.003
ID: 144132426
Type: 8
Name: Cup01_Unshattered
ID: 134951952
Type: 8
Name: Cup01_Shattered.001
ID: 140710075
Type: 8
Name: Cup01_Shattered.002
ID: 147241586
Type: 8
Name: Cup01_Shattered.003
ID: 141067850
Type: 8
Name: Cup01_Shattered.004
ID: 142028102
Type: 8

View File

@ -0,0 +1,276 @@
- EID: 0
Name: Main Camera
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0.472120881, z: 2.53064919}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Camera Component:
Position: {x: 0, y: 0.472120881, z: 2.53064919}
Pitch: 0
Yaw: 0
Roll: 0
Width: 1920
Height: 1080
Near: 0.00999999978
Far: 10000
Perspective: true
IsActive: true
Scripts: ~
- EID: 2
Name: Light
IsActive: true
NumberOfChildren: 0
Components:
Light Component:
Position: {x: 0, y: 0, z: 0}
Type: Directional
Direction: {x: 0, y: 0, z: 1}
Color: {x: 1, y: 1, z: 1, w: 1}
Layer: 4294967295
Strength: 0
IsActive: true
Scripts: ~
- EID: 1
Name: Plate
IsActive: true
NumberOfChildren: 4
Components:
Transform Component:
Translate: {x: 0.00451920554, y: 0.829197884, z: 1.75}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 0.999979734, y: 1, z: 0.999979734}
IsActive: true
Renderable Component:
Mesh: 140964851
Material: 126974645
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.200000003, y: 0.100000001, z: 0.200000003}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts:
- Type: Breakable
Enabled: true
threshHold: 0
force: 1
- EID: 4
Name: Piece1
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 3.2922253e-07, y: 0, z: -0.0171992779}
Rotate: {x: -1.31316483e-07, y: 3.60887498e-09, z: 5.27542454e-11}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 146557542
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.150000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 5
Name: Piece2
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 2.47731805e-07, y: 0, z: 0.0325666666}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 145439064
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.200000003}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 6
Name: Piece3
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0502781346, y: 1.18017197e-05, z: 6.97374344e-05}
Rotate: {x: 0.021297913, y: 0.00146768149, z: -5.48749846e-08}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 139411134
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.150000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 7
Name: Piece4
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0364143178, y: 7.39097595e-06, z: 6.61611557e-05}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 136742160
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.150000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 3
Name: Ground
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: -0.414889663, z: 0}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 5, y: 1, z: 5}
IsActive: true
RigidBody Component:
Type: Static
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~

View File

@ -0,0 +1,3 @@
Name: Breakables
ID: 85040588
Type: 5

View File

@ -8242,14 +8242,6 @@
Density: 1 Density: 1
Position Offset: {x: 0, y: 0, z: 0} Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: true
Type: Box
Half Extents: {x: 0.400000006, y: 0.400000006, z: 0.400000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: Scripts:
- Type: Item - Type: Item
@ -8294,14 +8286,6 @@
Density: 1 Density: 1
Position Offset: {x: 0, y: 0, z: 0} Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: true
Type: Box
Half Extents: {x: 0.699999988, y: 0.300000012, z: 0.75}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: Scripts:
- Type: Item - Type: Item
@ -8346,14 +8330,6 @@
Density: 1 Density: 1
Position Offset: {x: 0, y: 0, z: 0} Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: true
Type: Box
Half Extents: {x: 0.5, y: 0.5, z: 0.5}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: Scripts:
- Type: Item - Type: Item
@ -8372,7 +8348,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 2.24178481, y: 1.4327563, z: 8.89205742} Translate: {x: 2.24178481, y: 1.4327563, z: 9.46397972}
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
@ -8394,7 +8370,7 @@
Colliders: Colliders:
- Is Trigger: true - Is Trigger: true
Type: Box Type: Box
Half Extents: {x: 1.79999995, y: 1, z: 0.200000003} Half Extents: {x: 1.79999995, y: 1, z: 1}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
@ -8558,9 +8534,12 @@
heavyMultiper: 0.25 heavyMultiper: 0.25
- Type: PickAndThrow - Type: PickAndThrow
Enabled: true Enabled: true
throwForce: [50, 50, 50] throwForce: [8, 10, 8]
cameraArmOffSet: [0, 0.25, 0]
delayTimer: 1 delayTimer: 1
aimingLength: 0.5 aimingLength: 0.5
throwItem: false
rayDistance: 0.5
- EID: 3 - EID: 3
Name: HoldingPoint Name: HoldingPoint
IsActive: true IsActive: true
@ -8608,6 +8587,8 @@
turnSpeedPitch: 0.300000012 turnSpeedPitch: 0.300000012
turnSpeedYaw: 0.5 turnSpeedYaw: 0.5
pitchClamp: 45 pitchClamp: 45
inverseXControls: true
inverseYControls: true
- EID: 9 - EID: 9
Name: PlayerBag Name: PlayerBag
IsActive: true IsActive: true
@ -8634,7 +8615,708 @@
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 177
Name: ====Breakables====
IsActive: true
NumberOfChildren: 3
Components: ~
Scripts: ~
- EID: 1
Name: Plate
IsActive: true
NumberOfChildren: 4
Components:
Transform Component:
Translate: {x: 1.10128331, y: 0.1594823, z: 7.20125246}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 0.999979734, y: 1, z: 0.999979734}
IsActive: true
Renderable Component:
Mesh: 140964851
Material: 126974645
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.200000003, y: 0.100000001, z: 0.200000003}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts:
- Type: Breakable
Enabled: true
threshHold: 0.100000001
force: 1
- EID: 196 - EID: 196
Name: Piece1
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0586929321, y: 0, z: 0}
Rotate: {x: -0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 146557542
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.150000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 195
Name: Piece2
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0104182959, y: 0, z: -0.0662035942}
Rotate: {x: -0, y: 0.174533099, z: -0}
Scale: {x: 0.999999881, y: 1, z: 0.999999881}
IsActive: true
Renderable Component:
Mesh: 145439064
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.200000003}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 6
Name: Piece3
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0431699753, y: 1.18017197e-05, z: -0.0288243294}
Rotate: {x: -0, y: 0, z: 0.174533099}
Scale: {x: 0.999999881, y: 0.999999583, z: 1}
IsActive: true
Renderable Component:
Mesh: 139411134
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.150000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 7
Name: Piece4
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0341523886, y: 0.0088942796, z: 0.0554270744}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 136742160
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.150000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 65707
Name: Plate
IsActive: true
NumberOfChildren: 4
Components:
Transform Component:
Translate: {x: 2.97949171, y: 0.1594823, z: 7.20125246}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 0.999979734, y: 1, z: 0.999979734}
IsActive: true
Renderable Component:
Mesh: 140964851
Material: 126974645
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.200000003, y: 0.100000001, z: 0.200000003}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts:
- Type: Breakable
Enabled: true
threshHold: 0.100000001
force: 1
- EID: 65703
Name: Piece1
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0586929321, y: 0, z: 0}
Rotate: {x: -0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 146557542
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.150000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 65704
Name: Piece2
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0104182959, y: 0, z: -0.0662035942}
Rotate: {x: -0, y: 0.174533099, z: -0}
Scale: {x: 0.999999881, y: 1, z: 0.999999881}
IsActive: true
Renderable Component:
Mesh: 145439064
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.200000003}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 65705
Name: Piece3
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0431699753, y: 1.18017197e-05, z: -0.0288243294}
Rotate: {x: -0, y: 0, z: 0.174533099}
Scale: {x: 0.999999881, y: 0.999999583, z: 1}
IsActive: true
Renderable Component:
Mesh: 139411134
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.150000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 65706
Name: Piece4
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0341523886, y: 0.0088942796, z: 0.0554270744}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 136742160
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.150000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 65712
Name: Plate
IsActive: true
NumberOfChildren: 4
Components:
Transform Component:
Translate: {x: 3.0075531, y: 0.1594823, z: 8.19898987}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 0.999979734, y: 1, z: 0.999979734}
IsActive: true
Renderable Component:
Mesh: 140964851
Material: 126974645
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.200000003, y: 0.100000001, z: 0.200000003}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts:
- Type: Breakable
Enabled: true
threshHold: 0.100000001
force: 1
- EID: 65708
Name: Piece1
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0586929321, y: 0, z: 0}
Rotate: {x: -0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 146557542
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.150000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 65709
Name: Piece2
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0104182959, y: 0, z: -0.0662035942}
Rotate: {x: -0, y: 0.174533099, z: -0}
Scale: {x: 0.999999881, y: 1, z: 0.999999881}
IsActive: true
Renderable Component:
Mesh: 145439064
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.200000003}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 65710
Name: Piece3
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0431699753, y: 1.18017197e-05, z: -0.0288243294}
Rotate: {x: -0, y: 0, z: 0.174533099}
Scale: {x: 0.999999881, y: 0.999999583, z: 1}
IsActive: true
Renderable Component:
Mesh: 139411134
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.150000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 65711
Name: Piece4
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0341523886, y: 0.0088942796, z: 0.0554270744}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 136742160
Material: 124370424
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 0.100000001, y: 0.0500000007, z: 0.150000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 166
Name: ====WaypointPool====
IsActive: true
NumberOfChildren: 7
Components: ~
Scripts: ~
- EID: 165
Name: 1
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 2.75, y: 0, z: -2}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Scripts: ~
- EID: 164
Name: 2
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.25, y: 0, z: -3}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Scripts: ~
- EID: 163
Name: 3
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -2, y: 0, z: -3.75}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Scripts: ~
- EID: 162
Name: 4
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -3.75, y: 0, z: -2.25}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Scripts: ~
- EID: 161
Name: 5
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -2.75, y: 0, z: 2.75}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Scripts: ~
- EID: 160
Name: 6
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -1.5, y: 0, z: 4}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Scripts: ~
- EID: 159
Name: 7
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 2.75, y: 0, z: 4}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Scripts: ~
- EID: 158
Name: ====AI===== Name: ====AI=====
IsActive: true IsActive: true
NumberOfChildren: 0 NumberOfChildren: 0
@ -8676,12 +9358,12 @@
Scripts: Scripts:
- Type: Homeowner1 - Type: Homeowner1
Enabled: true Enabled: true
waypointsPool: 51000 waypointsPool: 166
patrolSpeed: 1 patrolSpeed: 1
chaseSpeed: 2 chaseSpeed: 2
turningSpeed: 5 turningSpeed: 5
sightDistance: 8 sightDistance: 8
eyeOffset: [0, 0, 0] eyeOffset: [0, 1.64999998, 0]
distanceToCapture: 0.5 distanceToCapture: 0.5
captureTime: 0.5 captureTime: 0.5
footstepSFXIntervalMultiplier: 0.5 footstepSFXIntervalMultiplier: 0.5

View File

@ -0,0 +1,64 @@
using SHADE;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Xml.Linq;
public class Breakable : Script
{
public float threshHold = 1.0f;
public float force = 2.0f;
private RigidBody rb;
private Transform trans;
private bool isBreak = false;
private List<GameObject> itemPieces = new List<GameObject>();
private Random ran = new Random();
protected override void awake()
{
rb = GetComponent<RigidBody>();
if (!rb)
Debug.LogError("RIGIDBODY EMPTY");
trans = GetComponent<Transform>();
if(!trans)
Debug.LogError("TRANSFORM EMPTY");
foreach (GameObject pieces in GameObject)
{
itemPieces.Add(pieces);
pieces.SetActive(false);
}
}
protected override void update()
{
if (isBreak)
Break();
}
protected override void onCollisionEnter(CollisionInfo info)
{
if (rb.LinearVelocity.GetSqrMagnitude() > threshHold)
{
isBreak = true;
}
}
protected override void onTriggerEnter(CollisionInfo info)
{
}
private void Break()
{
foreach (GameObject item in itemPieces)
{
item.SetActive(true);
item.GetComponent<Transform>().GlobalPosition = trans.LocalPosition + item.GetComponent<Transform>().LocalPosition;
GameObject gO = item;
gO.Parent = GameObject.Null;
}
isBreak = false;
Owner.SetActive(false);
}
}

View File

@ -0,0 +1,3 @@
Name: Breakable
ID: 154790613
Type: 9

View File

@ -7,85 +7,80 @@ using static Item;
public class PickAndThrow : Script public class PickAndThrow : Script
{ {
public Vector3 throwForce = new Vector3(100.0f, 200.0f, 100.0f); public Vector3 throwForce = new Vector3(100.0f, 200.0f, 100.0f);
public Vector3 cameraArmOffSet = new Vector3(0.0f, 0.25f, 0.0f);
public GameObject item { get; set; } public GameObject item { get; set; }
public float delayTimer = 1.0f; public float delayTimer = 1.0f;
public float aimingLength = 1.5f; public float aimingLength = 1.5f;
private float timer; private float timer;
private PlayerController pc; private PlayerController pc;
private Camera cam;
private Transform itemTransform; private Transform itemTransform;
private RigidBody itemRidibody; private RigidBody itemRidigBody;
private Transform raccoonHoldLocation; private Collider itemCollider;
private Transform playerTran;
private Item itemScript; private Item itemScript;
private Transform raccoonHoldLocation;
private ThirdPersonCamera tpc; private ThirdPersonCamera tpc;
private float lastXDir; private float lastXDir;
private float lastZDir; private float lastZDir;
private bool inRange = false; private bool inRange = false;
public bool throwItem = false;
[Tooltip("Lenght of ray")]
public float rayDistance = 1;
protected override void awake() protected override void awake()
{ {
playerTran = GetComponent<Transform>();
if (!playerTran)
Debug.Log("PLAYERTRANSFORM EMPTY"); ;
pc = GetScript<PlayerController>(); pc = GetScript<PlayerController>();
if(!pc) if(!pc)
Debug.Log("PLAYER CONTROLLER EMPTY"); Debug.LogError("PLAYER CONTROLLER EMPTY");
raccoonHoldLocation = GetComponentInChildren<Transform>(); raccoonHoldLocation = GetComponentInChildren<Transform>();
if (!raccoonHoldLocation) if (!raccoonHoldLocation)
Debug.Log("CHILD EMPTY"); Debug.LogError("CHILD EMPTY");
tpc = GetScriptInChildren<ThirdPersonCamera>(); tpc = GetScriptInChildren<ThirdPersonCamera>();
if(!tpc) if(!tpc)
Debug.Log("TPC EMPTY"); Debug.LogError("TPC EMPTY");
timer = delayTimer; timer = delayTimer;
} }
protected override void update() protected override void update()
{ {
if(timer <= delayTimer) if(timer <= delayTimer)
timer += Time.DeltaTimeF; timer += Time.DeltaTimeF;
CalculateDir(); CalculateDir();
CastRay();
if (pc && itemRidibody && itemTransform) if (pc && itemRidigBody && itemTransform && itemCollider)
{ {
if (pc.holdItem) if (pc.holdItem)
{ {
itemTransform.LocalPosition = raccoonHoldLocation.GlobalPosition; itemTransform.LocalPosition = raccoonHoldLocation.GlobalPosition;
itemTransform.LocalRotation = playerTran.LocalRotation; itemTransform.LocalRotation = pc.tranform.LocalRotation;
itemRidigBody.LinearVelocity = Vector3.Zero;
itemRidigBody.AngularVelocity = Vector3.Zero;
if (Input.GetMouseButtonDown(Input.MouseCode.LeftButton)) if (Input.GetMouseButtonDown(Input.MouseCode.LeftButton))
{ {
pc.isAiming = true; pc.isAiming = true;
pc.camArm.ArmLength = aimingLength; pc.camArm.ArmLength = aimingLength;
pc.camArm.TargetOffset = cameraArmOffSet;
} }
if (Input.GetMouseButtonUp(Input.MouseCode.LeftButton) && pc.isAiming) if (Input.GetMouseButtonUp(Input.MouseCode.LeftButton) && pc.isAiming)
{ {
Audio.PlaySFXOnce2D("event:/Raccoon/raccoon_throw"); Audio.PlaySFXOnce2D("event:/Raccoon/raccoon_throw");
itemRidigBody.IsGravityEnabled = true;
itemCollider.GetCollisionShape(0).IsTrigger = false;
pc.isAiming = false; pc.isAiming = false;
if(tpc) pc.camArm.TargetOffset = Vector3.Zero;
if (tpc)
pc.camArm.ArmLength = tpc.armLength; pc.camArm.ArmLength = tpc.armLength;
pc.holdItem = false; pc.holdItem = false;
inRange = false; inRange = false;
itemRidibody.IsGravityEnabled = true; throwItem = true;
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;
ResetItemObject();
timer = 0.0f; timer = 0.0f;
} }
@ -93,20 +88,25 @@ public class PickAndThrow : Script
{ {
pc.holdItem = false; pc.holdItem = false;
inRange = false; inRange = false;
itemRidibody.IsGravityEnabled = true; itemRidigBody.IsGravityEnabled = true;
itemCollider.GetCollisionShape(0).IsTrigger = false;
ResetItemObject(); ResetItemObject();
} }
if (Input.GetMouseButtonDown(Input.MouseCode.RightButton) && pc.isAiming) if (Input.GetMouseButtonDown(Input.MouseCode.RightButton) && pc.isAiming)
{ {
pc.isAiming = false; pc.isAiming = false;
pc.camArm.TargetOffset = Vector3.Zero;
if (tpc) if (tpc)
pc.camArm.ArmLength = tpc.armLength; pc.camArm.ArmLength = tpc.armLength;
} }
} }
else if (!pc.holdItem) else if (!pc.holdItem)
itemRidibody.IsGravityEnabled = true; {
itemRidigBody.IsGravityEnabled = true;
itemCollider.GetCollisionShape(0).IsTrigger = false;
}
} }
if (timer > delayTimer && pc && !pc.holdItem && inRange && Input.GetMouseButtonDown(Input.MouseCode.LeftButton)) if (timer > delayTimer && pc && !pc.holdItem && inRange && Input.GetMouseButtonDown(Input.MouseCode.LeftButton))
@ -119,10 +119,31 @@ public class PickAndThrow : Script
} }
} }
protected override void fixedUpdate()
{
if (throwItem && itemRidigBody && pc)
{
if (itemScript)
{
Vector3 vec = new Vector3(throwForce.x * lastXDir, throwForce.y, throwForce.z * lastZDir);
if (itemScript.currCategory == ItemCategory.LIGHT)
itemRidigBody.AddForce(vec * 0.2f);
if (itemScript.currCategory == ItemCategory.MEDIUM)
itemRidigBody.AddForce(vec * 0.75f);
if (itemScript.currCategory == ItemCategory.HEAVY)
itemRidigBody.AddForce(vec);
}
itemRidigBody.LinearVelocity += pc.rb.LinearVelocity;
throwItem = false;
ResetItemObject();
}
}
private void ResetItemObject() private void ResetItemObject()
{ {
itemRidibody = null; itemRidigBody = null;
itemTransform = null; itemTransform = null;
itemCollider = null;
itemScript = null; itemScript = null;
item = new GameObject(); item = new GameObject();
} }
@ -130,40 +151,43 @@ public class PickAndThrow : Script
private void RetrieveItemComponets() private void RetrieveItemComponets()
{ {
//get the transform of the given item //get the transform of the given item
if (item.GetScript<Item>() && itemTransform == null && itemRidibody == null) if (item.GetScript<Item>() && !itemTransform && !itemRidigBody)
{ {
itemRidibody = item.GetComponent<RigidBody>(); itemRidigBody = item.GetComponent<RigidBody>();
if (itemRidibody == null) if (!itemRidigBody)
Debug.Log("Item rb EMPTY"); Debug.Log("Item rb EMPTY");
else else
{ {
itemRidibody.IsGravityEnabled = false; itemRidigBody.IsGravityEnabled = false;
itemRidibody.LinearVelocity = Vector3.Zero;
itemRidibody.AngularVelocity = Vector3.Zero;
} }
itemTransform = item.GetComponent<Transform>(); itemTransform = item.GetComponent<Transform>();
if (itemTransform == null) if (!itemTransform)
Debug.Log("Item transform EMPTY"); Debug.Log("Item transform EMPTY");
else else
{ {
itemTransform.LocalEulerAngles = Vector3.Zero; itemTransform.LocalEulerAngles = Vector3.Zero;
} }
itemCollider = item.GetComponent<Collider>();
if (!itemCollider)
Debug.Log("Item collider EMPTY");
else
{
itemCollider.GetCollisionShape(0).IsTrigger = true;
}
itemScript = item.GetScript<Item>(); itemScript = item.GetScript<Item>();
if(!itemScript) if(!itemScript)
Debug.Log("Item script EMPTY"); Debug.Log("Item script EMPTY");
} }
} }
private void CalculateDir() private void CalculateDir()
{ {
if (cam == null) if (pc && pc.cam)
cam = GetComponentInChildren<Camera>();
else if (cam)
{ {
Vector3 camerAixs = cam.GetForward(); Vector3 camerAixs = pc.cam.GetForward();
camerAixs.y = 0; camerAixs.y = 0;
camerAixs.Normalise(); camerAixs.Normalise();
lastXDir = camerAixs.x; lastXDir = camerAixs.x;
@ -171,33 +195,36 @@ public class PickAndThrow : Script
} }
} }
private void DelayCheck() private void CastRay()
{ {
timer += Time.DeltaTimeF; if (pc != null)
{
Vector3 dirNor = pc.tranform.Forward;
Vector3 playerRayPos = pc.tranform.GlobalPosition;
playerRayPos.y += 0.05f;
dirNor.Normalise();
RaycastHit ray1 = Physics.Raycast(new Ray(playerRayPos, Vector3.RotateY(dirNor, SHADE.Math.DegreesToRadians(22.5f))), rayDistance);
RaycastHit ray2 = Physics.Raycast(new Ray(playerRayPos, Vector3.RotateY(dirNor, SHADE.Math.DegreesToRadians(-22.5f))), rayDistance);
RaycastHit ray3 = Physics.Raycast(new Ray(playerRayPos, dirNor), rayDistance * 0.75f);
inRange = CheckForItem(ray1) || CheckForItem(ray2) || CheckForItem(ray3);
}
} }
protected override void onCollisionEnter(CollisionInfo info) private bool CheckForItem(RaycastHit ray)
{ {
} if (ray.Hit)
protected override void onTriggerEnter(CollisionInfo info)
{
if (info.GameObject.GetScript<Item>() && !pc.holdItem)
{ {
item = info.GameObject; if (ray.Other.Value.GetScript<Item>() && !pc.holdItem)
inRange = true; {
} item = ray.Other.Value;
} return true;
protected override void onTriggerStay(CollisionInfo info) }
{ else
//Debug.Log("STAY"); return false;
}
protected override void onTriggerExit(CollisionInfo info)
{
//Debug.Log("EXIT");
if (info.GameObject.GetScript<Item>() != null && !pc.holdItem)
{
inRange = false;
} }
return false;
} }
} }

View File

@ -27,8 +27,8 @@ public class PlayerController : Script
}*/ }*/
public RigidBody rb { get; set; } public RigidBody rb { get; set; }
private Transform tranform; public Transform tranform { get; set; }
private Camera cam; public Camera cam { get; set; }
public CameraArm camArm { get; set; } public CameraArm camArm { get; set; }
private PickAndThrow pat; private PickAndThrow pat;
private StateMachine stateMachine; private StateMachine stateMachine;

View File

@ -15,6 +15,8 @@ namespace SHADE_Scripting
public float turnSpeedPitch = 0.3f; public float turnSpeedPitch = 0.3f;
public float turnSpeedYaw = 0.5f; public float turnSpeedYaw = 0.5f;
public float pitchClamp = 45.0f; public float pitchClamp = 45.0f;
public bool inverseXControls = false;
public bool inverseYControls = false;
protected override void awake() protected override void awake()
{ {
@ -42,8 +44,15 @@ namespace SHADE_Scripting
if (arm) if (arm)
{ {
Vector2 vel = Input.GetMouseVelocity(); Vector2 vel = Input.GetMouseVelocity();
arm.Pitch -= vel.y * turnSpeedPitch * Time.DeltaTimeF; if(inverseYControls)
arm.Yaw += vel.x * turnSpeedYaw * Time.DeltaTimeF; arm.Pitch -= vel.y * turnSpeedPitch * Time.DeltaTimeF;
else
arm.Pitch += vel.y * turnSpeedPitch * Time.DeltaTimeF;
if (inverseXControls)
arm.Yaw -= vel.x * turnSpeedYaw * Time.DeltaTimeF;
else
arm.Yaw += vel.x * turnSpeedYaw * Time.DeltaTimeF;
if (arm.Pitch > pitchClamp) if (arm.Pitch > pitchClamp)
{ {

View File

@ -42,17 +42,12 @@ public class GameManager : Script
Score = 0; Score = 0;
currGameState = GameState.START; currGameState = GameState.START;
if (zonePool)
{
listOfZone = zonePool.GetScriptsInChildren<ScoringZone>();
if (listOfZone != null)
foreach (ScoringZone sz in listOfZone)
sz.gameManger = Owner.GetScript<GameManager>();
}
} }
protected override void update() protected override void update()
{ {
Cheats();
if (once) if (once)
{ {
if (itemPool) if (itemPool)
@ -62,6 +57,14 @@ public class GameManager : Script
foreach (Item i in listOfItems) foreach (Item i in listOfItems)
totalItemCount += 1; totalItemCount += 1;
} }
if (zonePool)
{
listOfZone = zonePool.GetScriptsInChildren<ScoringZone>();
if (listOfZone != null)
foreach (ScoringZone sz in listOfZone)
sz.gameManger = Owner.GetScript<GameManager>();
}
once = false; once = false;
} }
@ -76,14 +79,35 @@ public class GameManager : Script
if (timer > 0 && totalItemCount <= 0) if (timer > 0 && totalItemCount <= 0)
{ {
currGameState = GameState.WIN; currGameState = GameState.WIN;
Audio.StopAllSounds();
SceneManager.ChangeScene(winScene); SceneManager.ChangeScene(winScene);
} }
else if(timer < 0) else if(timer < 0)
{ {
currGameState = GameState.LOSE; currGameState = GameState.LOSE;
Audio.StopAllSounds();
SceneManager.ChangeScene(loseScene); SceneManager.ChangeScene(loseScene);
} }
} }
} }
private void Cheats()
{
if (Input.GetKeyDown(Input.KeyCode.F1))
{
Audio.StopAllSounds();
SceneManager.ChangeScene(loseScene);
}
if (Input.GetKeyDown(Input.KeyCode.F2))
{
Audio.StopAllSounds();
SceneManager.ChangeScene(winScene);
}
if (Input.GetKeyDown(Input.KeyCode.Escape))
{
Audio.StopAllSounds();
SceneManager.ChangeScene(97158628);
}
}
} }

View File

@ -18,12 +18,10 @@ public class Item : Script
protected override void awake() protected override void awake()
{ {
rb = GetComponent<RigidBody>(); rb = GetComponent<RigidBody>();
if (rb) }
{
rb.FreezeRotationX = false; protected override void update()
rb.FreezeRotationY = false; {
rb.FreezeRotationZ = false;
}
} }
protected override void onCollisionEnter(CollisionInfo info) protected override void onCollisionEnter(CollisionInfo info)

View File

@ -9,14 +9,14 @@ public class MainMenu : Script
} }
protected override void update() protected override void update()
{ {
if (Input.GetKey(Input.KeyCode.Space)) if (Input.GetKeyDown(Input.KeyCode.Space))
{ {
Audio.PlaySFXOnce2D("event:/UI/mouse_down_element"); Audio.PlaySFXOnce2D("event:/UI/mouse_down_element");
SceneManager.ChangeScene(89830755); SceneManager.ChangeScene(86098106);
Audio.StopAllSounds(); Audio.StopAllSounds();
} }
if (Input.GetKey(Input.KeyCode.Escape)) if (Input.GetKeyDown(Input.KeyCode.Escape))
{ {
Audio.StopAllSounds(); Audio.StopAllSounds();
Application.Quit(); Application.Quit();

View File

@ -144,7 +144,6 @@ namespace SHADE
// HACK: Clamp DT here to prevent a ridiculous amount of updates. This limits updates from large dt to 2. // HACK: Clamp DT here to prevent a ridiculous amount of updates. This limits updates from large dt to 2.
// HACK: This should be done by the FRC and not here for predictable behaviour. // HACK: This should be done by the FRC and not here for predictable behaviour.
dt = std::clamp(dt, 0.0, 1.0 / 30.0);
accumulatedTime += dt; accumulatedTime += dt;
//testFunction(); //testFunction();