Added Navigation System. Added basic AI FSM #438

Merged
maverickdgg merged 9 commits from Navigation into main 2023-03-24 16:11:14 +08:00
35 changed files with 922 additions and 93 deletions
Showing only changes of commit 0892322049 - Show all commits

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,7 @@
Name: MD_CeilingFan
ID: 73062062
Type: 4
Sub Assets:
Name: Sphere.005
ID: 135521751
Type: 8

View File

@ -2419,7 +2419,7 @@
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: 0, z: 0} Translate: {x: 0, y: 0, z: 0}
Rotate: {x: -1.48352981, y: 1.39999998, z: -3.50001717} 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
Renderable Component: Renderable Component:
@ -6864,8 +6864,8 @@
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 140697366 Mesh: 148542784
Material: 129495479 Material: 121518381
IsActive: true IsActive: true
RigidBody Component: RigidBody Component:
Type: Dynamic Type: Dynamic
@ -7207,11 +7207,11 @@
- Is Trigger: true - Is Trigger: true
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1.79999995, y: 1, z: 1} Half Extents: {x: 4, y: 1, z: 4}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0, z: 0} Position Offset: {x: -1, y: -1.5, z: 1.5}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: Scripts:
@ -7270,11 +7270,11 @@
- Is Trigger: true - Is Trigger: true
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1, y: 1, z: 0.200000003} Half Extents: {x: 4, y: 1, z: 4}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0, z: 0} Position Offset: {x: 0, y: -1.5, z: -2}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: Scripts:
@ -7333,11 +7333,11 @@
- Is Trigger: true - Is Trigger: true
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1.79999995, y: 1, z: 1} Half Extents: {x: 4, y: 1, z: 4}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0, z: 0} Position Offset: {x: 1, y: -1.5, z: 1.5}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: Scripts:
@ -7396,11 +7396,11 @@
- Is Trigger: true - Is Trigger: true
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1, y: 1, z: 1.79999995} Half Extents: {x: 4, y: 1, z: 4}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0, z: 0} Position Offset: {x: 1.5, y: -1.5, z: -1}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: Scripts:
@ -7459,11 +7459,11 @@
- Is Trigger: true - Is Trigger: true
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1, y: 1, z: 1.79999995} Half Extents: {x: 4, y: 1, z: 4}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0, z: 0} Position Offset: {x: 1.5, y: -1.5, z: 1}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: Scripts:
@ -7501,7 +7501,7 @@
- EID: 65775 - EID: 65775
Name: Player Name: Player
IsActive: true IsActive: true
NumberOfChildren: 5 NumberOfChildren: 8
Components: Components:
Transform Component: Transform Component:
Translate: {x: -8, y: 0.899999976, z: -4} Translate: {x: -8, y: 0.899999976, z: -4}
@ -7547,6 +7547,7 @@
Scripts: Scripts:
- Type: PlayerController - Type: PlayerController
Enabled: true Enabled: true
smokeCount: 4
respawnPoint: 65732 respawnPoint: 65732
currentState: 0 currentState: 0
walkMaxMoveVel: 2.5 walkMaxMoveVel: 2.5
@ -7565,6 +7566,8 @@
heavyMultiper: 0.5 heavyMultiper: 0.5
silhouettePlayer: 462 silhouettePlayer: 462
silhouetteBag: 465 silhouetteBag: 465
leftParticle: 573
rightParticle: 574
- Type: PickAndThrow - Type: PickAndThrow
Enabled: true Enabled: true
throwForce: [8, 4, 8] throwForce: [8, 4, 8]
@ -7577,6 +7580,8 @@
lerpPickUpDuration: 0.75 lerpPickUpDuration: 0.75
tweenAimDuration: 0.300000012 tweenAimDuration: 0.300000012
aimingFOV: 15 aimingFOV: 15
trajMaxSteps: 50
trajTimeSteps: 0.0160000008
- Type: StateMachine - Type: StateMachine
Enabled: true Enabled: true
currentStateName: Idle State currentStateName: Idle State
@ -7702,6 +7707,85 @@
AnimationController: 0 AnimationController: 0
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 522
Name: Tracjectory
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 0.200000003, y: 0.200000003, z: 0.200000003}
IsActive: true
Trajectory Renderer Component:
Mesh: 134305891
Start Color: {x: 0.625550628, y: 1, z: 0}
Start Alpha: 1
End Color: {x: 1, y: 0.898678422, z: 0}
End Alpha: 1
"Color Eval Rate ": 0.5
IsActive: true
Scripts: ~
- EID: 573
Name: LeftSmoke
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0899999142, y: 0.100000001, z: -6.25735765e-08}
Rotate: {x: -5.83341553e-08, y: -3.14159274, z: 1.10461471e-08}
Scale: {x: 1.00000012, y: 1, z: 1.00000012}
IsActive: true
classSHADE::SHParticleEmitterComponent:
Emission Count: 8
Is Passive: false
Emission Interval: 0
Min Life: 0.100000001
Max Life: 2
Minimum Speed: 1
Maximum Speed: 1.5
Minimum Size: 0.100000001
Maximum Size: 0.100000001
Size Decay: 0.907000005
Angular Ranges And Offset: {x: 0.779999971, y: 0, z: -1.57070005, w: 0}
Rotation Speed: 0.805999994
Rotation Decay: 0
Texture Asset ID: 56224060
Custom Update Shader Asset ID: 42141152
Color Tint: {x: 1, y: 1, z: 1, w: 1}
Acceleration: {x: 0, y: 0.0500000007, z: 0}
IsActive: true
Scripts: ~
- EID: 574
Name: RightSmoke
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0900000036, y: 0.100000001, z: -1.03427794e-07}
Rotate: {x: -5.83341553e-08, y: -3.14159274, z: 1.10461471e-08}
Scale: {x: 1.00000012, y: 1, z: 1.00000012}
IsActive: true
classSHADE::SHParticleEmitterComponent:
Emission Count: 8
Is Passive: false
Emission Interval: 0
Min Life: 0.100000001
Max Life: 2
Minimum Speed: 1
Maximum Speed: 1.5
Minimum Size: 0.100000001
Maximum Size: 0.100000001
Size Decay: 0.907000005
Angular Ranges And Offset: {x: 0.779999971, y: 0, z: -1.57070005, w: 0}
Rotation Speed: 0.805999994
Rotation Decay: 0
Texture Asset ID: 56224060
Custom Update Shader Asset ID: 42141152
Color Tint: {x: 1, y: 1, z: 1, w: 1}
Acceleration: {x: 0, y: 0.0500000007, z: 0}
IsActive: true
Scripts: ~
- EID: 65732 - EID: 65732
Name: RespawnPoint Name: RespawnPoint
IsActive: true IsActive: true

View File

@ -1025,8 +1025,8 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 4.37222624, y: 0.944371462, z: 4.06488085} Translate: {x: 2.66560459, y: 0.10531798, z: 5.97001934}
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
Renderable Component: Renderable Component:
@ -2767,11 +2767,11 @@
- Is Trigger: true - Is Trigger: true
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1.79999995, y: 1, z: 1} Half Extents: {x: 5, y: 1, z: 4}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0, z: 0} Position Offset: {x: 0, y: -1.5, z: 1.5}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: Scripts:
@ -2830,11 +2830,11 @@
- Is Trigger: true - Is Trigger: true
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1, y: 1, z: 0.200000003} Half Extents: {x: 4, y: 1, z: 4}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0, z: 0} Position Offset: {x: 0, y: -1.5, z: -2}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: Scripts:
@ -2899,7 +2899,7 @@
- EID: 2 - EID: 2
Name: Player Name: Player
IsActive: true IsActive: true
NumberOfChildren: 5 NumberOfChildren: 8
Components: Components:
Transform Component: Transform Component:
Translate: {x: 2.35245037, y: 0.0613552481, z: 7.10571432} Translate: {x: 2.35245037, y: 0.0613552481, z: 7.10571432}
@ -2963,6 +2963,8 @@
heavyMultiper: 0.5 heavyMultiper: 0.5
silhouettePlayer: 462 silhouettePlayer: 462
silhouetteBag: 465 silhouetteBag: 465
leftParticle: 573
rightParticle: 574
- Type: PickAndThrow - Type: PickAndThrow
Enabled: true Enabled: true
throwForce: [10, 4, 10] throwForce: [10, 4, 10]
@ -2975,6 +2977,8 @@
lerpPickUpDuration: 0.75 lerpPickUpDuration: 0.75
tweenAimDuration: 0.300000012 tweenAimDuration: 0.300000012
aimingFOV: 15 aimingFOV: 15
trajMaxSteps: 50
trajTimeSteps: 0.0160000008
- Type: PlayerAnimations - Type: PlayerAnimations
Enabled: true Enabled: true
playerIdleClip: 227450439 playerIdleClip: 227450439
@ -3096,6 +3100,85 @@
AnimationController: 0 AnimationController: 0
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 569
Name: Trajectory
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 2.35245013, y: -0.0613552481, z: 7.10571909}
Rotate: {x: 0, y: -3.14159274, z: 0}
Scale: {x: 0.200000033, y: 0.200000003, z: 0.200000033}
IsActive: true
Trajectory Renderer Component:
Mesh: 134305891
Start Color: {x: 0.627451003, y: 1, z: 0}
Start Alpha: 1
End Color: {x: 1, y: 0.898039222, z: 0}
End Alpha: 1
"Color Eval Rate ": 0.5
IsActive: true
Scripts: ~
- EID: 573
Name: LeftSmoke
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0899999142, y: 0.100000001, z: -6.25735765e-08}
Rotate: {x: -5.83341553e-08, y: -3.14159274, z: 1.10461471e-08}
Scale: {x: 1.00000012, y: 1, z: 1.00000012}
IsActive: true
classSHADE::SHParticleEmitterComponent:
Emission Count: 8
Is Passive: false
Emission Interval: 0
Min Life: 0.100000001
Max Life: 2
Minimum Speed: 1
Maximum Speed: 1.5
Minimum Size: 0.100000001
Maximum Size: 0.100000001
Size Decay: 0.907000005
Angular Ranges And Offset: {x: 0.779999971, y: 0, z: -1.57070005, w: 0}
Rotation Speed: 0.805999994
Rotation Decay: 0
Texture Asset ID: 56224060
Custom Update Shader Asset ID: 42141152
Color Tint: {x: 1, y: 1, z: 1, w: 1}
Acceleration: {x: 0, y: 0.0500000007, z: 0}
IsActive: true
Scripts: ~
- EID: 574
Name: RightSmoke
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0900000036, y: 0.100000001, z: -1.03427794e-07}
Rotate: {x: -5.83341553e-08, y: -3.14159274, z: 1.10461471e-08}
Scale: {x: 1.00000012, y: 1, z: 1.00000012}
IsActive: true
classSHADE::SHParticleEmitterComponent:
Emission Count: 8
Is Passive: false
Emission Interval: 0
Min Life: 0.100000001
Max Life: 2
Minimum Speed: 1
Maximum Speed: 1.5
Minimum Size: 0.100000001
Maximum Size: 0.100000001
Size Decay: 0.907000005
Angular Ranges And Offset: {x: 0.779999971, y: 0, z: -1.57070005, w: 0}
Rotation Speed: 0.805999994
Rotation Decay: 0
Texture Asset ID: 56224060
Custom Update Shader Asset ID: 42141152
Color Tint: {x: 1, y: 1, z: 1, w: 1}
Acceleration: {x: 0, y: 0.0500000007, z: 0}
IsActive: true
Scripts: ~
- EID: 239 - EID: 239
Name: RespawnPoint Name: RespawnPoint
IsActive: true IsActive: true
@ -5367,8 +5450,8 @@
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 140697366 Mesh: 148542784
Material: 129495479 Material: 121518381
IsActive: true IsActive: true
RigidBody Component: RigidBody Component:
Type: Dynamic Type: Dynamic
@ -5461,7 +5544,7 @@
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: -300, z: 0} Translate: {x: 0, y: -300, z: 0}
Rotate: {x: -1.48352981, y: 0.5, z: 0.399993658} Rotate: {x: -1.48352981, y: 2.82014489, z: 0.5}
Scale: {x: 400, y: 100, z: 500} Scale: {x: 400, y: 100, z: 500}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
@ -15002,3 +15085,201 @@
Clicked: false Clicked: false
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 570
Name: CeilingFan
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -3.43279505, y: 3.04381442, z: 0.590506613}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 135521751
Material: 131956078
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: 0.34906584, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: 1.60570288, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: -0.907571197, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: -2.16420817, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: 2.87979317, z: 0}
IsActive: true
Scripts:
- Type: CeilingFan
Enabled: true
rotateSpeed: 3
- EID: 571
Name: CeilingFan
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0900869966, y: 3.04381442, z: -2.56089497}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 135521751
Material: 131956078
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: 0.34906584, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: 1.60570288, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: -0.907571197, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: -2.16420817, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: 2.87979317, z: 0}
IsActive: true
Scripts:
- Type: CeilingFan
Enabled: true
rotateSpeed: 3
- EID: 572
Name: CeilingFan
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 2.14731741, y: 3.04381442, z: 3.51156116}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 135521751
Material: 131956078
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: 0.34906584, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: 1.60570288, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: -0.907571197, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: -2.16420817, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 0.699999988, y: 0.0500000007, z: 0.300000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.699999988, y: -0.75, z: 0}
Rotation Offset: {x: 0, y: 2.87979317, z: 0}
IsActive: true
Scripts:
- Type: CeilingFan
Enabled: true
rotateSpeed: 3

View File

@ -8661,13 +8661,13 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0.892607987, y: 0, z: 1.50168896} Translate: {x: 1.19757175, y: 0, z: 0.855755448}
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
Renderable Component: Renderable Component:
Mesh: 140697366 Mesh: 148542784
Material: 129495479 Material: 121518381
IsActive: true IsActive: true
RigidBody Component: RigidBody Component:
Type: Dynamic Type: Dynamic
@ -8877,11 +8877,11 @@
- Is Trigger: true - Is Trigger: true
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1, y: 1, z: 1.79999995} Half Extents: {x: 5, y: 1, z: 5}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0, z: 0} Position Offset: {x: -1.89999998, y: -1.5, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: Scripts:
@ -8940,11 +8940,11 @@
- Is Trigger: true - Is Trigger: true
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 0.5, y: 1, z: 1} Half Extents: {x: 4, y: 1, z: 4}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0, z: 0} Position Offset: {x: -1.89999998, y: -1.5, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: Scripts:
@ -9003,11 +9003,11 @@
- Is Trigger: true - Is Trigger: true
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1.79999995, y: 1, z: 1} Half Extents: {x: 4, y: 0.5, z: 4}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0, z: 0} Position Offset: {x: 0, y: -1, z: -1.60000002}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: Scripts:
@ -11964,7 +11964,7 @@
- EID: 65775 - EID: 65775
Name: Player Name: Player
IsActive: true IsActive: true
NumberOfChildren: 5 NumberOfChildren: 8
Components: Components:
Transform Component: Transform Component:
Translate: {x: 5.5, y: 0.171148509, z: 10} Translate: {x: 5.5, y: 0.171148509, z: 10}
@ -12010,6 +12010,7 @@
Scripts: Scripts:
- Type: PlayerController - Type: PlayerController
Enabled: true Enabled: true
smokeCount: 4
respawnPoint: 66065 respawnPoint: 66065
currentState: 0 currentState: 0
walkMaxMoveVel: 2.5 walkMaxMoveVel: 2.5
@ -12028,6 +12029,8 @@
heavyMultiper: 0.5 heavyMultiper: 0.5
silhouettePlayer: 462 silhouettePlayer: 462
silhouetteBag: 465 silhouetteBag: 465
leftParticle: 66138
rightParticle: 66137
- Type: PickAndThrow - Type: PickAndThrow
Enabled: true Enabled: true
throwForce: [10, 4, 10] throwForce: [10, 4, 10]
@ -12040,6 +12043,8 @@
lerpPickUpDuration: 0.75 lerpPickUpDuration: 0.75
tweenAimDuration: 0.300000012 tweenAimDuration: 0.300000012
aimingFOV: 15 aimingFOV: 15
trajMaxSteps: 50
trajTimeSteps: 0.0160000008
- Type: PlayerAnimations - Type: PlayerAnimations
Enabled: true Enabled: true
playerIdleClip: 227450439 playerIdleClip: 227450439
@ -12161,6 +12166,85 @@
AnimationController: 0 AnimationController: 0
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 600
Name: Trajectory
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 2.35245013, y: -0.0613552481, z: 7.10571909}
Rotate: {x: 0, y: -3.14159274, z: 0}
Scale: {x: 0.200000033, y: 0.200000003, z: 0.200000033}
IsActive: true
Trajectory Renderer Component:
Mesh: 134305891
Start Color: {x: 0.627451003, y: 1, z: 0}
Start Alpha: 1
End Color: {x: 1, y: 0.898039222, z: 0}
End Alpha: 1
"Color Eval Rate ": 0.5
IsActive: true
Scripts: ~
- EID: 66138
Name: LeftSmoke
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0899999142, y: 0.100000001, z: -6.25735765e-08}
Rotate: {x: -5.83341553e-08, y: -3.14159274, z: 1.10461471e-08}
Scale: {x: 1.00000012, y: 1, z: 1.00000012}
IsActive: true
classSHADE::SHParticleEmitterComponent:
Emission Count: 8
Is Passive: false
Emission Interval: 0
Min Life: 0.100000001
Max Life: 2
Minimum Speed: 1
Maximum Speed: 1.5
Minimum Size: 0.100000001
Maximum Size: 0.100000001
Size Decay: 0.907000005
Angular Ranges And Offset: {x: 0.779999971, y: 0, z: -1.57070005, w: 0}
Rotation Speed: 0.805999994
Rotation Decay: 0
Texture Asset ID: 56224060
Custom Update Shader Asset ID: 42141152
Color Tint: {x: 1, y: 1, z: 1, w: 1}
Acceleration: {x: 0, y: 0.0500000007, z: 0}
IsActive: true
Scripts: ~
- EID: 66137
Name: RightSmoke
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0900000036, y: 0.100000001, z: -1.03427794e-07}
Rotate: {x: -5.83341553e-08, y: -3.14159274, z: 1.10461471e-08}
Scale: {x: 1.00000012, y: 1, z: 1.00000012}
IsActive: true
classSHADE::SHParticleEmitterComponent:
Emission Count: 8
Is Passive: false
Emission Interval: 0
Min Life: 0.100000001
Max Life: 2
Minimum Speed: 1
Maximum Speed: 1.5
Minimum Size: 0.100000001
Maximum Size: 0.100000001
Size Decay: 0.907000005
Angular Ranges And Offset: {x: 0.779999971, y: 0, z: -1.57070005, w: 0}
Rotation Speed: 0.805999994
Rotation Decay: 0
Texture Asset ID: 56224060
Custom Update Shader Asset ID: 42141152
Color Tint: {x: 1, y: 1, z: 1, w: 1}
Acceleration: {x: 0, y: 0.0500000007, z: 0}
IsActive: true
Scripts: ~
- EID: 66065 - EID: 66065
Name: RespawnPoint Name: RespawnPoint
IsActive: true IsActive: true
@ -12532,8 +12616,8 @@
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0.728688836, y: 0.534546018, z: 10.5705957} Translate: {x: 0.728688836, y: 0.534546018, z: 10.5705957}
Rotate: {x: 0, y: 3.10297418, z: 0} Rotate: {x: -0, y: 3.10297418, z: 0}
Scale: {x: 1.00027728, y: 1, z: 1.00027728} Scale: {x: 1.00027752, y: 1, z: 1.00027752}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 150010583 Mesh: 150010583
@ -12657,9 +12741,9 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0.102274597, y: 0, z: -0.00395232625} Translate: {x: -1.78079093, y: -0.150818765, z: 0.483723372}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1.00002515, y: 1, z: 1.00002515} Scale: {x: 1.00025964, y: 1, z: 1.00025964}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 150010583 Mesh: 150010583

View File

@ -25,6 +25,7 @@ public class Item : Script
private bool checkSound = false; private bool checkSound = false;
private bool homeownerOnce = true;
public float soundDistance = 10; public float soundDistance = 10;
private float highlightPos = 0.0f; private float highlightPos = 0.0f;
@ -98,8 +99,11 @@ public class Item : Script
rb.ClearTorque(); rb.ClearTorque();
} }
if(transform) if (transform)
{
transform.LocalEulerAngles = Vector3.Zero;
transform.LocalPosition = firstPostion; transform.LocalPosition = firstPostion;
}
returnBack = false; returnBack = false;
} }
@ -143,11 +147,11 @@ public class Item : Script
if(emitter) if(emitter)
emitter.Emit(); emitter.Emit();
Debug.Log("EMIT");
} }
if (info.GameObject.GetScript<Homeowner1>() && !returnBack) if (info.GameObject.GetScript<Homeowner1>() && homeownerOnce)
{ {
homeownerOnce = false;
returnBack = true; returnBack = true;
} }
} }
@ -156,6 +160,7 @@ public class Item : Script
{ {
playSound = true; playSound = true;
checkSound = true; checkSound = true;
homeownerOnce = true;
} }
} }

View File

@ -6,6 +6,7 @@ public class PlayerRunState : BaseState
{ {
private float timer; private float timer;
private float delay = 0.25f; private float delay = 0.25f;
private bool left = true;
public PlayerRunState(StateMachine stateMachine) : base(stateMachine) public PlayerRunState(StateMachine stateMachine) : base(stateMachine)
{ {
@ -14,6 +15,11 @@ public class PlayerRunState : BaseState
public override void OnEnter() public override void OnEnter()
{ {
//Debug.Log("WALK ENTER"); //Debug.Log("WALK ENTER");
timer = delay;
machine.GetScript<PlayerController>().playLandedAnimation = false;
machine.GetScript<PlayerController>().Leftsmoke.EmissionCount = machine.GetScript<PlayerController>().smokeCount * 4;
machine.GetScript<PlayerController>().Rightsmoke.EmissionCount = machine.GetScript<PlayerController>().smokeCount * 4;
if (PlayerAnimations.Instance) if (PlayerAnimations.Instance)
{ {
PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerRunClip); PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerRunClip);
@ -29,6 +35,27 @@ public class PlayerRunState : BaseState
if (timer > delay) if (timer > delay)
{ {
if (left)
{
if (machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y > 0.0f)
machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y - (MathF.PI * 1.5f), machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets.y);
else
machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y + (MathF.PI * 0.5f), machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets.y);
machine.GetScript<PlayerController>().Leftsmoke.Emit();
left = false;
}
else
{
if (machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y > 0.0f)
machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y - (MathF.PI * 1.5f), machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets.y);
else
machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y + (MathF.PI * 0.5f), machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets.y);
machine.GetScript<PlayerController>().Rightsmoke.Emit();
left = true;
}
AudioHandler.audioClipHandlers["footsteps"].Play(); AudioHandler.audioClipHandlers["footsteps"].Play();
timer = 0; timer = 0;
} }

View File

@ -1,11 +1,12 @@
using SHADE; using SHADE;
using SHADE_Scripting.Audio; using SHADE_Scripting.Audio;
using System; using System;
public class PlayerWalkState : BaseState public class PlayerWalkState : BaseState
{ {
private float timer; private float timer;
private float delay = 0.5f; private float delay = 0.4f;
private bool left = true;
public PlayerWalkState(StateMachine stateMachine) : base(stateMachine) public PlayerWalkState(StateMachine stateMachine) : base(stateMachine)
{ {
stateName = "Walk State"; stateName = "Walk State";
@ -14,6 +15,8 @@ public class PlayerWalkState : BaseState
{ {
//Debug.Log("WALK ENTER"); //Debug.Log("WALK ENTER");
timer = delay; timer = delay;
machine.GetScript<PlayerController>().Leftsmoke.EmissionCount = machine.GetScript<PlayerController>().smokeCount;
machine.GetScript<PlayerController>().Rightsmoke.EmissionCount = machine.GetScript<PlayerController>().smokeCount;
machine.GetScript<PlayerController>().playLandedAnimation = false; machine.GetScript<PlayerController>().playLandedAnimation = false;
@ -47,6 +50,27 @@ public class PlayerWalkState : BaseState
if (timer > delay) if (timer > delay)
{ {
if (left)
{
if (machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y > 0.0f)
machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y - (MathF.PI * 1.5f), machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets.y);
else
machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y + (MathF.PI * 0.5f), machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets.y);
machine.GetScript<PlayerController>().Leftsmoke.Emit();
left = false;
}
else
{
if (machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y > 0.0f)
machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y - (MathF.PI * 1.5f), machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets.y);
else
machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y + (MathF.PI * 0.5f), machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets.y);
machine.GetScript<PlayerController>().Rightsmoke.Emit();
left = true;
}
AudioHandler.audioClipHandlers["footsteps"].Play(); AudioHandler.audioClipHandlers["footsteps"].Play();
timer = 0; timer = 0;
} }

View File

@ -50,6 +50,14 @@ public class PickAndThrow : Script
public float aimingFOV = 15.0f; public float aimingFOV = 15.0f;
private TrajectoryRenderable trajComp;
private Vector3 currThrowForce;
private float currentItemMass;
public uint trajMaxSteps = 50;
public float trajTimeSteps = 0.03f;
protected override void awake() protected override void awake()
{ {
pc = GetScript<PlayerController>(); pc = GetScript<PlayerController>();
@ -67,6 +75,10 @@ public class PickAndThrow : Script
AudioHandler.audioClipHandlers["SFXThrow"] = Audio.CreateAudioClip("event:/Raccoon/raccoon_throw"); AudioHandler.audioClipHandlers["SFXThrow"] = Audio.CreateAudioClip("event:/Raccoon/raccoon_throw");
timer = delayTimer; timer = delayTimer;
trajComp = GetComponentInChildren<TrajectoryRenderable>();
if(!trajComp)
Debug.LogError("TrajectoryRenderable MISSING");
} }
protected override void start() protected override void start()
@ -161,6 +173,19 @@ public class PickAndThrow : Script
PlayPickUpAnimation(); PlayPickUpAnimation();
} }
} }
if (pc.isAiming && itemScript)
{
if (itemScript.currCategory == ItemCategory.LIGHT)
currThrowForce = new Vector3(throwForce.x * lastXDir, throwForce.y + (throwForce.y * GetPitchRatioRange()), throwForce.z * lastZDir) * 0.2f;
else if (itemScript.currCategory == ItemCategory.MEDIUM)
currThrowForce = new Vector3(throwForce.x * lastXDir, throwForce.y + (throwForce.y * GetPitchRatioRange()), throwForce.z * lastZDir) * 0.75f;
else
currThrowForce = new Vector3(throwForce.x * lastXDir, throwForce.y + (throwForce.y * GetPitchRatioRange()), throwForce.z * lastZDir);
if (pc.holdItem && trajComp)
trajComp.SimulateTrajectory(item.EntityId, currentItemMass, currThrowForce, trajTimeSteps, trajMaxSteps);
}
} }
protected override void fixedUpdate() protected override void fixedUpdate()
@ -172,16 +197,7 @@ public class PickAndThrow : Script
if (throwItem && itemRidigBody && pc) if (throwItem && itemRidigBody && pc)
{ {
if (itemScript) itemRidigBody.AddForce(currThrowForce);
{
Vector3 vec = new Vector3(throwForce.x * lastXDir, throwForce.y + (throwForce.y * GetPitchRatioRange()), 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; itemRidigBody.LinearVelocity += pc.rb.LinearVelocity;
throwItem = false; throwItem = false;
ResetItemObject(); ResetItemObject();
@ -207,6 +223,7 @@ public class PickAndThrow : Script
Debug.Log("Item rb EMPTY"); Debug.Log("Item rb EMPTY");
else else
{ {
currentItemMass = itemRidigBody.Mass;
itemRidigBody.IsGravityEnabled = false; itemRidigBody.IsGravityEnabled = false;
} }

View File

@ -24,6 +24,9 @@ public class PlayerController : Script
public CameraArm camArm { get; set; } public CameraArm camArm { get; set; }
private PickAndThrow pat; private PickAndThrow pat;
public StateMachine stateMachine { get; set; } public StateMachine stateMachine { get; set; }
public ParticleEmitter Leftsmoke { get; set; }
public ParticleEmitter Rightsmoke { get; set; }
public int smokeCount = 4;
public bool holdItem { get; set; } public bool holdItem { get; set; }
public bool isAiming { get; set; } public bool isAiming { get; set; }
@ -92,6 +95,10 @@ public class PlayerController : Script
public bool playLandedAnimation { get; set; } public bool playLandedAnimation { get; set; }
public GameObject leftParticle;
public GameObject rightParticle;
protected override void awake() protected override void awake()
{ {
//default setup //default setup
@ -145,6 +152,13 @@ public class PlayerController : Script
AudioHandler.audioClipHandlers["footsteps"] = Audio.CreateAudioClip("event:/Raccoon/raccoon_footsteps"); AudioHandler.audioClipHandlers["footsteps"] = Audio.CreateAudioClip("event:/Raccoon/raccoon_footsteps");
playLandedAnimation = false; playLandedAnimation = false;
Leftsmoke = leftParticle.GetComponent<ParticleEmitter>();
if (!Leftsmoke)
Debug.LogError("left ParticleEmitter MISSING");
Rightsmoke = rightParticle.GetComponent<ParticleEmitter>();
if (!Leftsmoke)
Debug.LogError("right ParticleEmitter MISSING");
} }
protected override void start() protected override void start()
@ -209,7 +223,6 @@ public class PlayerController : Script
} }
} }
GotCaught(); GotCaught();
Rotation(); Rotation();
MoveKey(); MoveKey();
@ -292,11 +305,11 @@ public class PlayerController : Script
private void Move() private void Move()
{ {
if (rb != null && currentState != RaccoonStates.CAUGHT) if (rb && currentState != RaccoonStates.CAUGHT)
{ {
rb.LinearVelocity += new Vector3(axisMove.x * moveForce, 0.0f, axisMove.y * moveForce) * Time.DeltaTimeF; rb.LinearVelocity += new Vector3(axisMove.x * moveForce, 0.0f, axisMove.y * moveForce) * Time.DeltaTimeF;
if (isMoveKeyPress && rb) if (isMoveKeyPress)
{ {
Vector3 velNor = rb.LinearVelocity; Vector3 velNor = rb.LinearVelocity;
velNor.y = 0.0f; velNor.y = 0.0f;
@ -335,6 +348,13 @@ public class PlayerController : Script
} }
} }
if (Input.GetKey(Input.KeyCode.LeftShift) && !isMoveKeyPress && isGrounded)
{
currentState = RaccoonStates.IDLE;
if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState)))
stateMachine.SetState(typeof(PlayerIdleState));
}
if (Input.GetKeyUp(Input.KeyCode.LeftShift)) if (Input.GetKeyUp(Input.KeyCode.LeftShift))
{ {
if (isMoveKeyPress && isGrounded) if (isMoveKeyPress && isGrounded)
@ -343,7 +363,7 @@ public class PlayerController : Script
if (stateMachine && !stateMachine.IsState(typeof(PlayerWalkState))) if (stateMachine && !stateMachine.IsState(typeof(PlayerWalkState)))
stateMachine.SetState(typeof(PlayerWalkState)); stateMachine.SetState(typeof(PlayerWalkState));
} }
else if(!isMoveKeyPress && isGrounded) else if (!isMoveKeyPress && isGrounded)
{ {
currentState = RaccoonStates.IDLE; currentState = RaccoonStates.IDLE;
if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState))) if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState)))
@ -483,6 +503,7 @@ public class PlayerController : Script
if (holdItem) if (holdItem)
{ {
holdItem = false; holdItem = false;
Debug.Log("PLAYER RETURN");
pat.item.GetScript<Item>().returnBack = true; pat.item.GetScript<Item>().returnBack = true;
} }
if (isAiming) if (isAiming)

View File

@ -0,0 +1,79 @@
using SHADE;
using SHADE_Scripting.Audio;
using System;
public class CeilingFan : Script
{
private Transform tran;
private Collider collider;
private float rotate = 0.0f;
public float rotateSpeed = 10.0f;
private float rotateCollider1 = 0.0f;
private float rotateCollider2 = 0.0f;
private float rotateCollider3 = 0.0f;
private float rotateCollider4 = 0.0f;
private float rotateCollider5 = 0.0f;
private float defaultCollider1 = 0.0f;
private float defaultCollider2 = 0.0f;
private float defaultCollider3 = 0.0f;
private float defaultCollider4 = 0.0f;
private float defaultCollider5 = 0.0f;
protected override void awake()
{
tran = GetComponent<Transform>();
if (!tran)
Debug.Log("FAN TRAN MISSING");
collider = GetComponent<Collider>();
if (!collider)
Debug.Log("FAN COLLIDER MISSING");
else
{
rotateCollider1 = collider.GetCollisionShape(0).RotationOffset.y;
defaultCollider1 = collider.GetCollisionShape(0).RotationOffset.y;
rotateCollider2 = collider.GetCollisionShape(1).RotationOffset.y;
defaultCollider2 = collider.GetCollisionShape(1).RotationOffset.y;
rotateCollider3 = collider.GetCollisionShape(2).RotationOffset.y;
defaultCollider3 = collider.GetCollisionShape(2).RotationOffset.y;
rotateCollider4 = collider.GetCollisionShape(3).RotationOffset.y;
defaultCollider4 = collider.GetCollisionShape(3).RotationOffset.y;
rotateCollider5 = collider.GetCollisionShape(4).RotationOffset.y;
defaultCollider5 = collider.GetCollisionShape(4).RotationOffset.y;
}
}
protected override void fixedUpdate()
{
rotate += rotateSpeed * (float)Time.FixedDeltaTime;
rotateCollider1 += rotateSpeed * (float)Time.FixedDeltaTime;
rotateCollider2 += rotateSpeed * (float)Time.FixedDeltaTime;
rotateCollider3 += rotateSpeed * (float)Time.FixedDeltaTime;
rotateCollider4 += rotateSpeed * (float)Time.FixedDeltaTime;
rotateCollider5 += rotateSpeed * (float)Time.FixedDeltaTime;
if (rotate >= MathF.PI * 2)
{
rotate = 0;
rotateCollider1 = defaultCollider1;
rotateCollider2 = defaultCollider2;
rotateCollider3 = defaultCollider3;
rotateCollider4 = defaultCollider4;
rotateCollider5 = defaultCollider5;
}
tran.LocalEulerAngles = new Vector3(0.0f, rotate, 0.0f);
collider.GetCollisionShape(0).RotationOffset = new Vector3(0.0f, rotateCollider1, 0.0f);
collider.GetCollisionShape(1).RotationOffset = new Vector3(0.0f, rotateCollider2, 0.0f);
collider.GetCollisionShape(2).RotationOffset = new Vector3(0.0f, rotateCollider3, 0.0f);
collider.GetCollisionShape(3).RotationOffset = new Vector3(0.0f, rotateCollider4, 0.0f);
collider.GetCollisionShape(4).RotationOffset = new Vector3(0.0f, rotateCollider5, 0.0f);
}
}

View File

@ -0,0 +1,3 @@
Name: SC_CeilingFan
ID: 157170734
Type: 9

View File

@ -88,6 +88,8 @@ public class GameManager : Script
Input.SetMouseCentering(true); Input.SetMouseCentering(true);
Application.IsCursorVisible = false; Application.IsCursorVisible = false;
Application.FixDeltaTime = Time.DefaultFixDeltaTime; Application.FixDeltaTime = Time.DefaultFixDeltaTime;
AudioHandler.audioClipHandlers["SFXItemScore"] = Audio.CreateAudioClip("event:/Music/stingers/item_scored");
} }
protected override void start() protected override void start()
@ -244,6 +246,9 @@ public class GameManager : Script
if (currMultiplierCombo < maxMultiplierCombo) if (currMultiplierCombo < maxMultiplierCombo)
currMultiplierCombo += 1; currMultiplierCombo += 1;
Audio.SetParameter("Multiplier", currMultiplierCombo);
AudioHandler.audioClipHandlers["SFXItemScore"].Play();
MultiplierTextFx fx = multiplierText.GetScript<MultiplierTextFx>(); MultiplierTextFx fx = multiplierText.GetScript<MultiplierTextFx>();
if (fx) if (fx)
{ {

View File

@ -6,14 +6,12 @@ public class ScoringZone : Script
protected override void awake() protected override void awake()
{ {
AudioHandler.audioClipHandlers["SFXItemScore"] = Audio.CreateAudioClip("event:/Music/stingers/item_scored");
} }
protected override void onTriggerEnter(CollisionInfo info) protected override void onTriggerEnter(CollisionInfo info)
{ {
if (GameManager.Instance && info.GameObject.GetScript<Item>() && info.GameObject.IsActiveSelf && !info.GameObject.GetComponent<Collider>().GetCollisionShape(0).IsTrigger ) if (GameManager.Instance && info.GameObject.GetScript<Item>() && info.GameObject.IsActiveSelf && !info.GameObject.GetComponent<Collider>().GetCollisionShape(0).IsTrigger )
{ {
AudioHandler.audioClipHandlers["SFXItemScore"].Play();
GameManager.Instance.Score += info.GameObject.GetScript<Item>().Score * GameManager.Instance.currMultiplierCombo; GameManager.Instance.Score += info.GameObject.GetScript<Item>().Score * GameManager.Instance.currMultiplierCombo;
GameManager.Instance.ItemScored(); GameManager.Instance.ItemScored();
info.GameObject.SetActive(false); info.GameObject.SetActive(false);

View File

@ -139,19 +139,20 @@ void main()
// emit particle from emitter position // emit particle from emitter position
particle.position = vec4 (emitterPosition.xyz, 1.0f); particle.position = vec4 (emitterPosition.xyz, 1.0f);
vec2 eulerAngles = vec2 (rand(seed) * angularRangesAndOffsets.x + angularRangesAndOffsets.z, vec2 eulerAngles = vec2 ((rand(seed) - 0.5f) * angularRangesAndOffsets.x + angularRangesAndOffsets.z,
rand(seed) * angularRangesAndOffsets.y + angularRangesAndOffsets.w); (rand(seed) - 0.5f) * angularRangesAndOffsets.y + angularRangesAndOffsets.w);
// Set its velocity // Set its velocity
// particle.velocity.xyz = vec3 (cos(eulerAngles.x) * cos(eulerAngles.y), // particle.velocity.xyz = vec3 (cos(eulerAngles.x) * cos(eulerAngles.y),
// sin(eulerAngles.x) * cos(eulerAngles.y), // sin(eulerAngles.x) * cos(eulerAngles.y),
// sin(eulerAngles.y)); // sin(eulerAngles.y));
float heading = eulerAngles.x;
float bank = eulerAngles.y; float bank = eulerAngles.y;
float cb = cos(bank); float cb = cos(bank);
float sb = sin(bank); float sb = sin(bank);
float ch = cos (eulerAngles.x); float ch = cos (heading);
float sh = sin (eulerAngles.x); float sh = sin (heading);
float cp = cos (0.0f); float cp = cos (0.0f);
float sp = sin (0.0f); float sp = sin (0.0f);

View File

@ -0,0 +1,173 @@
#version 450
layout(local_size_x = 128) in;
struct DrawArraysIndirectArgs
{
uint count;
uint instanceCount;
uint first;
uint baseInstance;
};
struct ParticleData
{
vec4 position;
vec4 orientationSpeedDecay;
vec4 velocity;
vec4 acceleration;
vec4 scaleAndDecay;
vec4 colorTint;
float life;
uint textureIndex;
};
struct GenericData
{
//! Delta time
float dt;
//! Elapsed time of the application
float elapsedTime;
//! Viewport width of the scene (excluding imgui, that means smaller than window)
uint viewportWidth;
//! Ditto but for height
uint viewportHeight;
};
layout(set = 1, binding = 0) uniform CameraData
{
vec4 position;
mat4 vpMat;
mat4 viewMat;
mat4 projMat;
} cameraData;
layout (set = 0, binding = 0) uniform GenericDataBuffer
{
GenericData data;
} genericDataBuffer;
layout (std430, set = 2, binding = 1) coherent restrict readonly buffer ParticlesInputBuffer
{
ParticleData data[];
} inputParticles;
// output buffer not needed
layout (std430, set = 2, binding = 2) coherent restrict buffer ParticlesOutputBuffer
{
ParticleData data[];
} outputParticles;
layout (std430, set = 2, binding = 3) coherent restrict buffer ParticlesFreelistBuffer
{
int freeCount;
int freeIndices[];
} freelist;
layout (std430, set = 2, binding = 4) coherent restrict buffer IndicesData
{
uint indices[];
};
layout (std140, set = 2, binding = 5) coherent restrict buffer IndirectDrawArgs
{
DrawArraysIndirectArgs indirectArgs;
};
// push constants
layout(std140, push_constant) uniform EmitterPushConstant
{
vec4 emitterPosition;
uint emissionCount;
} emitterPushConstant;
uint pcg_hash(uint seed)
{
uint state = seed * 747796405u + 2891336453u;
uint word = ((state >> ((state >> 28u) + 4u)) ^ state) * 277803737u;
return (word >> 22u) ^ word;
}
// Used to advance the PCG state.
uint rand_pcg(inout uint rng_state)
{
uint state = rng_state;
rng_state = rng_state * 747796405u + 2891336453u;
uint word = ((state >> ((state >> 28u) + 4u)) ^ state) * 277803737u;
return (word >> 22u) ^ word;
}
// Advances the prng state and returns the corresponding random float.
float rand(inout uint state)
{
uint x = rand_pcg(state);
state = x;
return float(x)*uintBitsToFloat(0x2f800004u);
}
void main()
{
uint index = gl_GlobalInvocationID.x;
ParticleData particle = inputParticles.data[index];
if (particle.life > 0.0f)
{
// update position from velocity
particle.position.xyz += particle.velocity.xyz * genericDataBuffer.data.dt;
particle.velocity += particle.acceleration;
particle.life -= genericDataBuffer.data.dt;
particle.orientationSpeedDecay.x += particle.orientationSpeedDecay.y;
// particle.scaleAndDecay.x *= particle.scaleAndDecay.z;
// particle.scaleAndDecay.y *= particle.scaleAndDecay.w;
if (particle.position.w == 0.0f)
{
particle.scaleAndDecay.x *= particle.scaleAndDecay.z;
particle.scaleAndDecay.y *= particle.scaleAndDecay.w;
if (particle.scaleAndDecay.x < 0.0f)
{
particle.scaleAndDecay.x = 0.0f;
particle.scaleAndDecay.y = 0.0f;
}
}
else
{
particle.scaleAndDecay.x /= particle.scaleAndDecay.z;
particle.scaleAndDecay.y /= particle.scaleAndDecay.w;
if (particle.scaleAndDecay.x > 0.2f)
particle.position.w = 0.0f;
}
if (particle.orientationSpeedDecay.y > 0.0f)
{
particle.orientationSpeedDecay.y -= particle.orientationSpeedDecay.z * genericDataBuffer.data.dt;
if (particle.orientationSpeedDecay.y < 0.0f)
particle.orientationSpeedDecay.y = 0.0f;
}
if (particle.life < 0.0f || particle.scaleAndDecay.x < 0.0f || particle.scaleAndDecay.y < 0.0f)
{
particle.life = 0.0f;
particle.position.x = 9999.0f;
outputParticles.data[index] = particle;
freelist.freeIndices[atomicAdd(freelist.freeCount, 1)] = int (index);
return;
}
uint drawIndex = atomicAdd (indirectArgs.instanceCount, 1);
indices[drawIndex] = index;
}
outputParticles.data[index] = particle;
}

View File

@ -0,0 +1,3 @@
Name: ParticleUpdateGrowThenShrink_CS
ID: 42141152
Type: 2

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_Particles_Smoke
ID: 56224060
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_Particles_Splatter
ID: 64562973
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_Particles_Star
ID: 65401279
Type: 3

View File

@ -913,12 +913,6 @@ namespace SHADE
{ {
comp->SetTextureAssetID(val); comp->SetTextureAssetID(val);
}); });
ImGui::SameLine();
if (ImGui::Button("Reset"))
{
component->SetTextureAssetID(0);
component->SetTextureIndex(0);
}
if (SHDragDrop::BeginTarget()) if (SHDragDrop::BeginTarget())
{ {
@ -940,6 +934,13 @@ namespace SHADE
SHDragDrop::EndTarget(); SHDragDrop::EndTarget();
} }
} }
ImGui::SameLine();
if (ImGui::Button("Reset"))
{
component->SetTextureAssetID(0);
component->SetTextureIndex(0);
}
SHEditorWidgets::InputText("Custom Update Shader", SHEditorWidgets::InputText("Custom Update Shader",
[comp = component]() [comp = component]()
{ {

View File

@ -115,8 +115,6 @@ namespace SHADE
comp.ResetSimulationInfo(); comp.ResetSimulationInfo();
std::cout << positions.size() << std::endl;
// If has positions, feed data to buffer. // If has positions, feed data to buffer.
if (!positions.empty()) if (!positions.empty())
{ {

View File

@ -316,7 +316,8 @@ namespace SHADE
// Error handling // Error handling
if (!SHEntityManager::IsValidEID(entityID)) if (!SHEntityManager::IsValidEID(entityID))
{ {
//SHLOG_ERROR("Entity {} is invalid!", entityID) //geting spamed called, need to look into it
SHLOG_ERROR_D("Entity {} is invalid!", entityID)
return; return;
} }

View File

@ -576,6 +576,9 @@ namespace YAML
if (node[MAX_SPEED_TAG.data()].IsDefined()) if (node[MAX_SPEED_TAG.data()].IsDefined())
rhs.SetMaxSpeed (node[MAX_SPEED_TAG.data()].as<float>()); rhs.SetMaxSpeed (node[MAX_SPEED_TAG.data()].as<float>());
if (node[MIN_SIZE_TAG.data()].IsDefined())
rhs.SetMinSize(node[MIN_SIZE_TAG.data()].as<float>());
if (node[MAX_SIZE_TAG.data()].IsDefined()) if (node[MAX_SIZE_TAG.data()].IsDefined())
rhs.SetMaxSize(node[MAX_SIZE_TAG.data()].as<float>()); rhs.SetMaxSize(node[MAX_SIZE_TAG.data()].as<float>());
@ -619,7 +622,7 @@ namespace YAML
//gfxSystem->BuildTextures(); //gfxSystem->BuildTextures();
rhs.SetCustomUpdateShader(shaderModule); rhs.SetCustomUpdateShader(shaderModule);
rhs.SetTextureAssetID(id); rhs.SetCustomUpdateShaderAssetID(id);
} }
return true; return true;

View File

@ -17,6 +17,16 @@ namespace SHADE
} }
System::Int32 ParticleEmitter::EmissionCount::get()
{
return (GetNativeComponent()->GetEmissionCount());
}
void ParticleEmitter::EmissionCount::set(System::Int32 val)
{
GetNativeComponent()->SetEmissionCount(val);
}
float ParticleEmitter::EmissionInterval::get() float ParticleEmitter::EmissionInterval::get()
{ {
return (GetNativeComponent()->GetEmissionInterval()); return (GetNativeComponent()->GetEmissionInterval());

View File

@ -24,6 +24,12 @@ namespace SHADE
void set(bool val); void set(bool val);
} }
property System::Int32 EmissionCount
{
System::Int32 get();
void set(System::Int32 val);
}
property float EmissionInterval property float EmissionInterval
{ {
float get(); float get();