Updated Player and MainGame scene, fix bugs #281

Merged
glencelow merged 7 commits from PlayerController into main 2022-11-25 16:34:51 +08:00
16 changed files with 2376 additions and 135 deletions

View File

@ -1,4 +1,4 @@
Start in Fullscreen: false
Starting Scene ID: 86098106
Starting Scene ID: 97158628
Window Size: {x: 1920, y: 1080}
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
Position 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
Scripts:
- Type: Item
@ -8294,14 +8286,6 @@
Density: 1
Position 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
Scripts:
- Type: Item
@ -8346,14 +8330,6 @@
Density: 1
Position 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
Scripts:
- Type: Item
@ -8372,7 +8348,7 @@
NumberOfChildren: 0
Components:
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}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
@ -8394,7 +8370,7 @@
Colliders:
- Is Trigger: true
Type: Box
Half Extents: {x: 1.79999995, y: 1, z: 0.200000003}
Half Extents: {x: 1.79999995, y: 1, z: 1}
Friction: 0.400000006
Bounciness: 0
Density: 1
@ -8558,9 +8534,12 @@
heavyMultiper: 0.25
- Type: PickAndThrow
Enabled: true
throwForce: [50, 50, 50]
throwForce: [8, 10, 8]
cameraArmOffSet: [0, 0.25, 0]
delayTimer: 1
aimingLength: 0.5
throwItem: false
rayDistance: 0.5
- EID: 3
Name: HoldingPoint
IsActive: true
@ -8608,6 +8587,8 @@
turnSpeedPitch: 0.300000012
turnSpeedYaw: 0.5
pitchClamp: 45
inverseXControls: true
inverseYControls: true
- EID: 9
Name: PlayerBag
IsActive: true
@ -8634,54 +8615,621 @@
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Scripts: ~
- EID: 196
Name: ====AI=====
- EID: 177
Name: ====Breakables====
IsActive: true
NumberOfChildren: 0
NumberOfChildren: 3
Components: ~
Scripts: ~
- EID: 1
Name: Plate
IsActive: true
NumberOfChildren: 4
Components:
Transform Component:
Translate: {x: 2.70000005, y: 0.100000001, z: -2}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
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: 140697366
Material: 129495479
Mesh: 140964851
Material: 126974645
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.00999999978
Use Gravity: true
Interpolate: false
Interpolate: true
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: true
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: true
Freeze Rotation Z: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Type: Box
Half Extents: {x: 1, y: 1.79999995, z: 0.400000006}
Half Extents: {x: 0.200000003, y: 0.100000001, z: 0.200000003}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.899999976, z: 0}
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts:
- Type: Homeowner1
- Type: Breakable
Enabled: true
waypointsPool: 51000
patrolSpeed: 1
chaseSpeed: 2
turningSpeed: 5
sightDistance: 8
eyeOffset: [0, 0, 0]
distanceToCapture: 0.5
captureTime: 0.5
footstepSFXIntervalMultiplier: 0.5
threshHold: 0.100000001
force: 1
- 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: ~

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 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 float delayTimer = 1.0f;
public float aimingLength = 1.5f;
private float timer;
private PlayerController pc;
private Camera cam;
private Transform itemTransform;
private RigidBody itemRidibody;
private Transform raccoonHoldLocation;
private Transform playerTran;
private RigidBody itemRidigBody;
private Collider itemCollider;
private Item itemScript;
private Transform raccoonHoldLocation;
private ThirdPersonCamera tpc;
private float lastXDir;
private float lastZDir;
private bool inRange = false;
public bool throwItem = false;
[Tooltip("Lenght of ray")]
public float rayDistance = 1;
protected override void awake()
{
playerTran = GetComponent<Transform>();
if (!playerTran)
Debug.Log("PLAYERTRANSFORM EMPTY"); ;
pc = GetScript<PlayerController>();
if(!pc)
Debug.Log("PLAYER CONTROLLER EMPTY");
Debug.LogError("PLAYER CONTROLLER EMPTY");
raccoonHoldLocation = GetComponentInChildren<Transform>();
if (!raccoonHoldLocation)
Debug.Log("CHILD EMPTY");
Debug.LogError("CHILD EMPTY");
tpc = GetScriptInChildren<ThirdPersonCamera>();
if(!tpc)
Debug.Log("TPC EMPTY");
Debug.LogError("TPC EMPTY");
timer = delayTimer;
}
protected override void update()
{
if(timer <= delayTimer)
timer += Time.DeltaTimeF;
CalculateDir();
CastRay();
if (pc && itemRidibody && itemTransform)
if (pc && itemRidigBody && itemTransform && itemCollider)
{
if (pc.holdItem)
{
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))
{
pc.isAiming = true;
pc.camArm.ArmLength = aimingLength;
pc.camArm.TargetOffset = cameraArmOffSet;
}
if (Input.GetMouseButtonUp(Input.MouseCode.LeftButton) && pc.isAiming)
{
Audio.PlaySFXOnce2D("event:/Raccoon/raccoon_throw");
itemRidigBody.IsGravityEnabled = true;
itemCollider.GetCollisionShape(0).IsTrigger = false;
pc.isAiming = false;
if(tpc)
pc.camArm.TargetOffset = Vector3.Zero;
if (tpc)
pc.camArm.ArmLength = tpc.armLength;
pc.holdItem = false;
inRange = false;
itemRidibody.IsGravityEnabled = 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();
throwItem = true;
timer = 0.0f;
}
@ -93,20 +88,25 @@ public class PickAndThrow : Script
{
pc.holdItem = false;
inRange = false;
itemRidibody.IsGravityEnabled = true;
itemRidigBody.IsGravityEnabled = true;
itemCollider.GetCollisionShape(0).IsTrigger = false;
ResetItemObject();
}
if (Input.GetMouseButtonDown(Input.MouseCode.RightButton) && pc.isAiming)
{
pc.isAiming = false;
pc.camArm.TargetOffset = Vector3.Zero;
if (tpc)
pc.camArm.ArmLength = tpc.armLength;
}
}
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))
@ -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()
{
itemRidibody = null;
itemRidigBody = null;
itemTransform = null;
itemCollider = null;
itemScript = null;
item = new GameObject();
}
@ -130,40 +151,43 @@ public class PickAndThrow : Script
private void RetrieveItemComponets()
{
//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>();
if (itemRidibody == null)
itemRidigBody = item.GetComponent<RigidBody>();
if (!itemRidigBody)
Debug.Log("Item rb EMPTY");
else
{
itemRidibody.IsGravityEnabled = false;
itemRidibody.LinearVelocity = Vector3.Zero;
itemRidibody.AngularVelocity = Vector3.Zero;
itemRidigBody.IsGravityEnabled = false;
}
itemTransform = item.GetComponent<Transform>();
if (itemTransform == null)
if (!itemTransform)
Debug.Log("Item transform EMPTY");
else
{
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>();
if(!itemScript)
Debug.Log("Item script EMPTY");
}
}
private void CalculateDir()
{
if (cam == null)
cam = GetComponentInChildren<Camera>();
else if (cam)
if (pc && pc.cam)
{
Vector3 camerAixs = cam.GetForward();
Vector3 camerAixs = pc.cam.GetForward();
camerAixs.y = 0;
camerAixs.Normalise();
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)
{
}
protected override void onTriggerEnter(CollisionInfo info)
if (ray.Hit)
{
if (info.GameObject.GetScript<Item>() && !pc.holdItem)
if (ray.Other.Value.GetScript<Item>() && !pc.holdItem)
{
item = info.GameObject;
inRange = true;
item = ray.Other.Value;
return true;
}
else
return false;
}
protected override void onTriggerStay(CollisionInfo info)
{
//Debug.Log("STAY");
}
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; }
private Transform tranform;
private Camera cam;
public Transform tranform { get; set; }
public Camera cam { get; set; }
public CameraArm camArm { get; set; }
private PickAndThrow pat;
private StateMachine stateMachine;

View File

@ -15,6 +15,8 @@ namespace SHADE_Scripting
public float turnSpeedPitch = 0.3f;
public float turnSpeedYaw = 0.5f;
public float pitchClamp = 45.0f;
public bool inverseXControls = false;
public bool inverseYControls = false;
protected override void awake()
{
@ -42,7 +44,14 @@ namespace SHADE_Scripting
if (arm)
{
Vector2 vel = Input.GetMouseVelocity();
if(inverseYControls)
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)

View File

@ -42,17 +42,12 @@ public class GameManager : Script
Score = 0;
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()
{
Cheats();
if (once)
{
if (itemPool)
@ -62,6 +57,14 @@ public class GameManager : Script
foreach (Item i in listOfItems)
totalItemCount += 1;
}
if (zonePool)
{
listOfZone = zonePool.GetScriptsInChildren<ScoringZone>();
if (listOfZone != null)
foreach (ScoringZone sz in listOfZone)
sz.gameManger = Owner.GetScript<GameManager>();
}
once = false;
}
@ -76,14 +79,35 @@ public class GameManager : Script
if (timer > 0 && totalItemCount <= 0)
{
currGameState = GameState.WIN;
Audio.StopAllSounds();
SceneManager.ChangeScene(winScene);
}
else if(timer < 0)
{
currGameState = GameState.LOSE;
Audio.StopAllSounds();
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()
{
rb = GetComponent<RigidBody>();
if (rb)
{
rb.FreezeRotationX = false;
rb.FreezeRotationY = false;
rb.FreezeRotationZ = false;
}
protected override void update()
{
}
protected override void onCollisionEnter(CollisionInfo info)

View File

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