added breakables to the main game and fix issues with it
This commit is contained in:
parent
9daaade56a
commit
6ac9bc4e94
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -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
|
|
@ -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: ~
|
|
@ -0,0 +1,3 @@
|
||||||
|
Name: Breakables
|
||||||
|
ID: 85040588
|
||||||
|
Type: 5
|
|
@ -8348,7 +8348,7 @@
|
||||||
NumberOfChildren: 0
|
NumberOfChildren: 0
|
||||||
Components:
|
Components:
|
||||||
Transform Component:
|
Transform Component:
|
||||||
Translate: {x: 2.24178481, y: 1.4327563, z: 9.3920002}
|
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
|
||||||
|
@ -8535,10 +8535,9 @@
|
||||||
- Type: PickAndThrow
|
- Type: PickAndThrow
|
||||||
Enabled: true
|
Enabled: true
|
||||||
throwForce: [8, 10, 8]
|
throwForce: [8, 10, 8]
|
||||||
item: 51000
|
cameraArmOffSet: [0, 0.25, 0]
|
||||||
delayTimer: 1
|
delayTimer: 1
|
||||||
aimingLength: 0.5
|
aimingLength: 0.5
|
||||||
inRange: false
|
|
||||||
rayDistance: 0.5
|
rayDistance: 0.5
|
||||||
- EID: 3
|
- EID: 3
|
||||||
Name: HoldingPoint
|
Name: HoldingPoint
|
||||||
|
@ -8613,3 +8612,621 @@
|
||||||
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
|
||||||
|
Name: Piece1
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 3.57627869e-07, y: 0, z: -0.0171995163}
|
||||||
|
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: 195
|
||||||
|
Name: Piece2
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 2.38418579e-07, y: 0, z: 0.0325665474}
|
||||||
|
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.0502780676, y: 1.18017197e-05, z: 6.96182251e-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.0364142656, y: 7.39097595e-06, z: 6.6280365e-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: 176
|
||||||
|
Name: Plate
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 4
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 3.23750496, y: 0.1594823, z: 6.75670671}
|
||||||
|
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: 175
|
||||||
|
Name: Piece1
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 3.57627869e-07, y: 0, z: -0.0171995163}
|
||||||
|
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: 174
|
||||||
|
Name: Piece2
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 2.38418579e-07, y: 0, z: 0.0325665474}
|
||||||
|
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: 173
|
||||||
|
Name: Piece3
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: -0.0502780676, y: 1.18017197e-05, z: 6.96182251e-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: 172
|
||||||
|
Name: Piece4
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 0.0364142656, y: 7.39097595e-06, z: 6.6280365e-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: 171
|
||||||
|
Name: Plate
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 4
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 3.48429918, y: 0.1594823, z: 7.54602051}
|
||||||
|
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: 170
|
||||||
|
Name: Piece1
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 3.57627869e-07, y: 0, z: -0.0171995163}
|
||||||
|
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: 169
|
||||||
|
Name: Piece2
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 2.38418579e-07, y: 0, z: 0.0325665474}
|
||||||
|
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: 168
|
||||||
|
Name: Piece3
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: -0.0502780676, y: 1.18017197e-05, z: 6.96182251e-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: 167
|
||||||
|
Name: Piece4
|
||||||
|
IsActive: true
|
||||||
|
NumberOfChildren: 0
|
||||||
|
Components:
|
||||||
|
Transform Component:
|
||||||
|
Translate: {x: 0.0364142656, y: 7.39097595e-06, z: 6.6280365e-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: ~
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
Name: Breakable
|
||||||
|
ID: 154790613
|
||||||
|
Type: 9
|
|
@ -7,23 +7,22 @@ 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 GameObject item;
|
public Vector3 cameraArmOffSet = new Vector3(0.0f, 0.25f, 0.0f);
|
||||||
|
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 itemRidibody;
|
||||||
private Transform raccoonHoldLocation;
|
private Collider itemCollider;
|
||||||
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;
|
||||||
public bool inRange = false;
|
private bool inRange = false;
|
||||||
|
|
||||||
private Collider collider;
|
|
||||||
|
|
||||||
[Tooltip("Lenght of ray")]
|
[Tooltip("Lenght of ray")]
|
||||||
public float rayDistance = 1;
|
public float rayDistance = 1;
|
||||||
|
@ -42,13 +41,6 @@ public class PickAndThrow : Script
|
||||||
if(!tpc)
|
if(!tpc)
|
||||||
Debug.LogError("TPC EMPTY");
|
Debug.LogError("TPC EMPTY");
|
||||||
|
|
||||||
collider = GetComponent<Collider>();
|
|
||||||
if (!collider)
|
|
||||||
Debug.LogError("COLLIDER EMPTY");
|
|
||||||
else
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
timer = delayTimer;
|
timer = delayTimer;
|
||||||
}
|
}
|
||||||
protected override void update()
|
protected override void update()
|
||||||
|
@ -59,7 +51,7 @@ public class PickAndThrow : Script
|
||||||
CalculateDir();
|
CalculateDir();
|
||||||
CastRay();
|
CastRay();
|
||||||
|
|
||||||
if (pc && itemRidibody && itemTransform)
|
if (pc && itemRidibody && itemTransform && itemCollider)
|
||||||
{
|
{
|
||||||
if (pc.holdItem)
|
if (pc.holdItem)
|
||||||
{
|
{
|
||||||
|
@ -70,17 +62,20 @@ public class PickAndThrow : Script
|
||||||
{
|
{
|
||||||
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");
|
||||||
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;
|
||||||
pc.holdItem = false;
|
pc.holdItem = false;
|
||||||
inRange = false;
|
inRange = false;
|
||||||
itemRidibody.IsGravityEnabled = true;
|
itemRidibody.IsGravityEnabled = true;
|
||||||
|
itemCollider.Enabled = true;
|
||||||
if (itemScript)
|
if (itemScript)
|
||||||
{
|
{
|
||||||
Vector3 vec = new Vector3(throwForce.x * lastXDir, throwForce.y, throwForce.z * lastZDir);
|
Vector3 vec = new Vector3(throwForce.x * lastXDir, throwForce.y, throwForce.z * lastZDir);
|
||||||
|
@ -102,19 +97,24 @@ public class PickAndThrow : Script
|
||||||
pc.holdItem = false;
|
pc.holdItem = false;
|
||||||
inRange = false;
|
inRange = false;
|
||||||
itemRidibody.IsGravityEnabled = true;
|
itemRidibody.IsGravityEnabled = true;
|
||||||
|
itemCollider.Enabled = true;
|
||||||
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;
|
itemRidibody.IsGravityEnabled = true;
|
||||||
|
itemCollider.Enabled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timer > delayTimer && pc && !pc.holdItem && inRange && Input.GetMouseButtonDown(Input.MouseCode.LeftButton))
|
if (timer > delayTimer && pc && !pc.holdItem && inRange && Input.GetMouseButtonDown(Input.MouseCode.LeftButton))
|
||||||
|
@ -135,6 +135,7 @@ public class PickAndThrow : Script
|
||||||
{
|
{
|
||||||
itemRidibody = null;
|
itemRidibody = null;
|
||||||
itemTransform = null;
|
itemTransform = null;
|
||||||
|
itemCollider = null;
|
||||||
itemScript = null;
|
itemScript = null;
|
||||||
item = new GameObject();
|
item = new GameObject();
|
||||||
}
|
}
|
||||||
|
@ -145,7 +146,7 @@ public class PickAndThrow : Script
|
||||||
if (item.GetScript<Item>() && !itemTransform && !itemRidibody )
|
if (item.GetScript<Item>() && !itemTransform && !itemRidibody )
|
||||||
{
|
{
|
||||||
itemRidibody = item.GetComponent<RigidBody>();
|
itemRidibody = item.GetComponent<RigidBody>();
|
||||||
if (itemRidibody == null)
|
if (!itemRidibody)
|
||||||
Debug.Log("Item rb EMPTY");
|
Debug.Log("Item rb EMPTY");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -155,27 +156,32 @@ public class PickAndThrow : Script
|
||||||
}
|
}
|
||||||
|
|
||||||
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.Enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class PlayerController : Script
|
||||||
|
|
||||||
public RigidBody rb { get; set; }
|
public RigidBody rb { get; set; }
|
||||||
public Transform tranform { get; set; }
|
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;
|
||||||
|
|
|
@ -12,7 +12,7 @@ public class MainMenu : Script
|
||||||
if (Input.GetKeyDown(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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue