added breakable food into the scene

#issues to fix
egg collision too small so weight is really small
throwing heavy objects doesnt give enuff force compared to rolling and hitting it
This commit is contained in:
Glence 2023-01-31 00:43:25 +08:00
parent 3e015d924e
commit d1d7d430b1
8 changed files with 1630 additions and 6 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,22 @@
Name: MD_Prop_Large_Watermelon
ID: 70609427
Type: 4
Sub Assets:
Name: Watermelon_Unbroken
ID: 134305891
Type: 8
Name: Watermelon_Broken01
ID: 144023586
Type: 8
Name: Watermelon_Broken02
ID: 142132679
Type: 8
Name: Watermelon_Broken03
ID: 138231239
Type: 8
Name: Watermelon_Broken04
ID: 135293480
Type: 8
Name: Watermelon_Broken05
ID: 146157335
Type: 8

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,19 @@
Name: MD_Prop_Small_Egg
ID: 78383364
Type: 4
Sub Assets:
Name: Egg_Unbroken
ID: 147457317
Type: 8
Name: Egg._Broken01
ID: 134900190
Type: 8
Name: Egg._Broken02
ID: 146271645
Type: 8
Name: Egg._Broken03
ID: 135945648
Type: 8
Name: Egg._Broken04
ID: 141722646
Type: 8

View File

@ -8514,6 +8514,7 @@
Enabled: true Enabled: true
Score: 50 Score: 50
currCategory: 1 currCategory: 1
firstPostion: [0, 0, 0]
- EID: 157 - EID: 157
Name: Mesh_Meat Name: Mesh_Meat
IsActive: true IsActive: true
@ -8559,6 +8560,7 @@
Enabled: true Enabled: true
Score: 50 Score: 50
currCategory: 1 currCategory: 1
firstPostion: [0, 0, 0]
- EID: 156 - EID: 156
Name: Mesh_Meat Name: Mesh_Meat
IsActive: true IsActive: true
@ -8604,6 +8606,7 @@
Enabled: true Enabled: true
Score: 50 Score: 50
currCategory: 1 currCategory: 1
firstPostion: [0, 0, 0]
- EID: 155 - EID: 155
Name: Mesh_Cheese Name: Mesh_Cheese
IsActive: true IsActive: true
@ -8649,6 +8652,7 @@
Enabled: true Enabled: true
Score: 100 Score: 100
currCategory: 2 currCategory: 2
firstPostion: [0, 0, 0]
- EID: 154 - EID: 154
Name: Mesh_Cheese Name: Mesh_Cheese
IsActive: true IsActive: true
@ -8694,6 +8698,7 @@
Enabled: true Enabled: true
Score: 100 Score: 100
currCategory: 2 currCategory: 2
firstPostion: [0, 0, 0]
- EID: 153 - EID: 153
Name: Mesh_Cheese Name: Mesh_Cheese
IsActive: true IsActive: true
@ -8739,6 +8744,7 @@
Enabled: true Enabled: true
Score: 100 Score: 100
currCategory: 2 currCategory: 2
firstPostion: [0, 0, 0]
- EID: 65778 - EID: 65778
Name: Mesh_Apple Name: Mesh_Apple
IsActive: true IsActive: true
@ -8784,6 +8790,7 @@
Enabled: true Enabled: true
Score: 10 Score: 10
currCategory: 0 currCategory: 0
firstPostion: [0, 0, 0]
- EID: 152 - EID: 152
Name: Mesh_Apple Name: Mesh_Apple
IsActive: true IsActive: true
@ -8829,6 +8836,7 @@
Enabled: true Enabled: true
Score: 10 Score: 10
currCategory: 0 currCategory: 0
firstPostion: [0, 0, 0]
- EID: 151 - EID: 151
Name: Mesh_Apple Name: Mesh_Apple
IsActive: true IsActive: true
@ -8874,6 +8882,7 @@
Enabled: true Enabled: true
Score: 10 Score: 10
currCategory: 0 currCategory: 0
firstPostion: [0, 0, 0]
- EID: 15 - EID: 15
Name: ====ScoreZonePool==== Name: ====ScoreZonePool====
IsActive: true IsActive: true
@ -9087,7 +9096,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: 0.700000048, z: 0.200000286} Translate: {x: 0, y: 0.899999976, z: 0.200000286}
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
@ -9206,7 +9215,7 @@
- Type: Breakable - Type: Breakable
Enabled: true Enabled: true
threshHold: 0.100000001 threshHold: 0.100000001
force: 1 ignoreRaccoon: false
- EID: 196 - EID: 196
Name: Piece1 Name: Piece1
IsActive: true IsActive: true
@ -9415,7 +9424,7 @@
- Type: Breakable - Type: Breakable
Enabled: true Enabled: true
threshHold: 0.100000001 threshHold: 0.100000001
force: 1 ignoreRaccoon: false
- EID: 65703 - EID: 65703
Name: Piece1 Name: Piece1
IsActive: true IsActive: true
@ -9624,7 +9633,7 @@
- Type: Breakable - Type: Breakable
Enabled: true Enabled: true
threshHold: 0.100000001 threshHold: 0.100000001
force: 1 ignoreRaccoon: false
- EID: 65708 - EID: 65708
Name: Piece1 Name: Piece1
IsActive: true IsActive: true
@ -9923,4 +9932,498 @@
eyeOffset: [0, 1.64999998, 0] eyeOffset: [0, 1.64999998, 0]
distanceToCapture: 0.5 distanceToCapture: 0.5
captureTime: 0.5 captureTime: 0.5
footstepSFXIntervalMultiplier: 0.5 footstepSFXIntervalMultiplier: 0.5
- EID: 65686
Name: Watermelon
IsActive: true
NumberOfChildren: 5
Components:
Transform Component:
Translate: {x: 2.44600534, y: 0.333341181, z: 6.14019775}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 0.999979734, y: 1, z: 0.999979734}
IsActive: true
Renderable Component:
Mesh: 134305891
Material: 131956078
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
Collision Tag: 1
Type: Sphere
Radius: 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: Breakable
Enabled: true
threshHold: 2
ignoreRaccoon: true
- Type: Item
Enabled: true
Score: 100
currCategory: 2
firstPostion: [0, 0, 0]
- EID: 131220
Name: Piece1
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0219824314, y: 2.77161598e-05, z: 0.140744686}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 144023586
Material: 131956078
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
Collision Tag: 1
Type: Box
Half Extents: {x: 0.25, y: 0.25, z: 0.100000001}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0.164060935, y: 0, z: 0}
IsActive: true
Scripts:
- Type: Item
Enabled: true
Score: 10
currCategory: 0
firstPostion: [0, 0, 0]
- EID: 131219
Name: Piece2
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0213363171, y: 0.082513541, z: -0.0573720932}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 142132679
Material: 131956078
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
Collision Tag: 1
Type: Box
Half Extents: {x: 0.300000012, y: 0.200000003, 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.34906584}
IsActive: true
Scripts:
- Type: Item
Enabled: true
Score: 10
currCategory: 0
firstPostion: [0, 0, 0]
- EID: 131221
Name: Piece3
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0268242359, y: -0.140726671, z: -0.0336794853}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 138231239
Material: 131956078
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
Collision Tag: 1
Type: Box
Half Extents: {x: 0.200000003, y: 0.0799999982, 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.261799395}
IsActive: true
Scripts:
- Type: Item
Enabled: true
Score: 10
currCategory: 0
firstPostion: [0, 0, 0]
- EID: 145
Name: Piece4
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.194803953, y: -0.0580093861, z: -0.00789308548}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 135293480
Material: 131956078
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
Collision Tag: 1
Type: Box
Half Extents: {x: 0.200000003, 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: -1.04719758}
IsActive: true
Scripts:
- Type: Item
Enabled: true
Score: 10
currCategory: 0
firstPostion: [0, 0, 0]
- EID: 196754
Name: Piece5
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0839636326, y: 0.175804704, z: 0.0484313965}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 146157335
Material: 131956078
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
Collision Tag: 1
Type: Box
Half Extents: {x: 0.25, 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.436332315}
IsActive: true
Scripts:
- Type: Item
Enabled: true
Score: 10
currCategory: 0
firstPostion: [0, 0, 0]
- EID: 144
Name: Egg
IsActive: true
NumberOfChildren: 4
Components:
Transform Component:
Translate: {x: 3.11708331, y: 0.333341181, z: 6.14019775}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 0.999979734, y: 1, z: 0.999979734}
IsActive: true
Renderable Component:
Mesh: 147457317
Material: 131956078
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
Collision Tag: 1
Type: Sphere
Radius: 0.075000003
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: 2
ignoreRaccoon: true
- Type: Item
Enabled: true
Score: 10
currCategory: 0
firstPostion: [0, 0, 0]
- EID: 143
Name: Piece1
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0224030018, y: 0.060772866, z: -0.00627422333}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 134900190
Material: 131956078
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
Collision Tag: 1
Type: Box
Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0.164060935, y: 0, z: 0}
IsActive: true
Scripts: ~
- EID: 142
Name: Piece2
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.00627422333, y: 0.0337567627, z: -0.00243234634}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 146271645
Material: 131956078
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
Collision Tag: 1
Type: Box
Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: -0.34906584}
IsActive: true
Scripts: ~
- EID: 141
Name: Piece3
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0166685581, y: -0.0367090702, z: 0.0114421844}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 135945648
Material: 131956078
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
Collision Tag: 1
Type: Box
Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: -0.261799395}
IsActive: true
Scripts: ~
- EID: 140
Name: Piece4
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.020128727, y: -0.0155199766, z: -0.0045747757}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 141722646
Material: 131956078
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
Collision Tag: 1
Type: Box
Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: -1.04719758}
IsActive: true
Scripts: ~

View File

@ -7,7 +7,7 @@ using System.Xml.Linq;
public class Breakable : Script public class Breakable : Script
{ {
public float threshHold = 1.0f; public float threshHold = 1.0f;
public float force = 2.0f; public bool ignoreRaccoon = false;
private RigidBody rb; private RigidBody rb;
private Transform trans; private Transform trans;
private bool isBreak = false; private bool isBreak = false;
@ -38,6 +38,9 @@ public class Breakable : Script
protected override void onCollisionEnter(CollisionInfo info) protected override void onCollisionEnter(CollisionInfo info)
{ {
if (ignoreRaccoon && info.GameObject.GetScript<PlayerController>())
return;
if (rb.LinearVelocity.GetSqrMagnitude() > threshHold) if (rb.LinearVelocity.GetSqrMagnitude() > threshHold)
{ {
isBreak = true; isBreak = true;