Merge remote-tracking branch 'origin/SP3-22-AnimationController' into SP3-22-AnimationController

This commit is contained in:
Xiao Qi 2023-03-03 17:23:18 +08:00
commit 0741163774
39 changed files with 3807 additions and 492 deletions

View File

@ -521,47 +521,11 @@
- Is Trigger: false - Is Trigger: false
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012} Half Extents: {x: 1.10000002, y: 2, z: 0.550000012}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0.0299999993, z: 0} Position Offset: {x: 0, y: 1, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.5, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.985000014, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 1.47500002, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 1.97000003, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
@ -584,47 +548,11 @@
- Is Trigger: false - Is Trigger: false
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012} Half Extents: {x: 1.10000002, y: 2, z: 0.550000012}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0.0299999993, z: 0} Position Offset: {x: 0, y: 1, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.5, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.985000014, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 1.47500002, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 1.97000003, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
@ -647,47 +575,11 @@
- Is Trigger: false - Is Trigger: false
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012} Half Extents: {x: 1.10000002, y: 2, z: 0.550000012}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0.0299999993, z: 0} Position Offset: {x: 0, y: 1, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.5, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.985000014, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 1.47500002, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 1.97000003, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
@ -836,47 +728,11 @@
- Is Trigger: false - Is Trigger: false
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012} Half Extents: {x: 1.10000002, y: 2, z: 0.550000012}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0.0299999993, z: 0} Position Offset: {x: 0, y: 1, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.5, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.985000014, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 1.47500002, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 1.97000003, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
@ -962,47 +818,11 @@
- Is Trigger: false - Is Trigger: false
Collision Tag: 0 Collision Tag: 0
Type: Box Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012} Half Extents: {x: 1.10000002, y: 2, z: 0.550000012}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
Position Offset: {x: 0, y: 0.0299999993, z: 0} Position Offset: {x: 0, y: 1, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.5, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.985000014, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 1.47500002, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 0
Type: Box
Half Extents: {x: 1.04999995, y: 0.0500000007, z: 0.550000012}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 1.97000003, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
@ -2583,7 +2403,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: 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:
@ -4293,13 +4113,14 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -800, y: 400, z: 0} Translate: {x: -800, y: 400, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 60, y: 60, z: 60} Scale: {x: 60, y: 60, z: 60}
IsActive: true IsActive: true
Text Renderer Component: Text Renderer Component:
Text: My name is Brandon. Text: "Score: 0"
Font: 176667660 Font: 176667660
Color: {x: 1, y: 1, z: 1, w: 1}
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 206 - EID: 206
@ -4308,13 +4129,14 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 500, y: 400, z: 0} Translate: {x: 500, y: 400, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 60, y: 60, z: 60} Scale: {x: 60, y: 60, z: 60}
IsActive: true IsActive: true
Text Renderer Component: Text Renderer Component:
Text: My name is Brandon. Text: "Time Left: 200"
Font: 176667660 Font: 176667660
Color: {x: 1, y: 1, z: 1, w: 1}
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 238 - EID: 238
@ -4323,13 +4145,14 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -800, y: 300, z: 0} Translate: {x: -800, y: 300, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 60, y: 60, z: 60} Scale: {x: 60, y: 60, z: 60}
IsActive: true IsActive: true
Text Renderer Component: Text Renderer Component:
Text: TEST Text: ""
Font: 176667660 Font: 176667660
Color: {x: 1, y: 1, z: 1, w: 1}
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 236 - EID: 236
@ -4343,7 +4166,7 @@
winScene: 86098106 winScene: 86098106
loseScene: 91685359 loseScene: 91685359
currGameState: 0 currGameState: 0
totalItemCount: 0 totalItemCount: 4
Score: 0 Score: 0
timer: 200 timer: 200
scoreText: 237 scoreText: 237
@ -4352,14 +4175,20 @@
maxMultiplierDuration: 5 maxMultiplierDuration: 5
maxMultiplierCombo: 10 maxMultiplierCombo: 10
multiplierFont: 60 multiplierFont: 60
- Type: PauseMenu
Enabled: true
resumeBtn: 457
retryBtn: 455
quitBtn: 456
canvas: 458
- EID: 235 - EID: 235
Name: ====AI===== Name: ====AI=====
IsActive: true IsActive: true
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0.406909943, y: 0.100000001, z: -2} Translate: {x: 2.13981342, y: 0.0490087792, z: -1.96055627}
Rotate: {x: -0, y: 0, z: -0} Rotate: {x: 0, y: -1.53675354, z: 0}
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
@ -4385,7 +4214,7 @@
- Is Trigger: false - Is Trigger: false
Collision Tag: 5 Collision Tag: 5
Type: Box Type: Box
Half Extents: {x: 1, y: 1.79999995, z: 0.400000006} Half Extents: {x: 0.600000024, y: 1.79999995, z: 0.400000006}
Friction: 0.400000006 Friction: 0.400000006
Bounciness: 0 Bounciness: 0
Density: 1 Density: 1
@ -4466,8 +4295,8 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 3.71994686, y: 1.14058578, z: -9.35119247} Translate: {x: 3.71994758, y: 1.0997268, z: -9.35119152}
Rotate: {x: -0, y: 0, z: -0} Rotate: {x: 4.18975469e-06, y: -1.08915871e-11, z: -5.03928231e-06}
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
@ -4509,7 +4338,7 @@
dontReturn: false dontReturn: false
soundDistance: 10 soundDistance: 10
highlightSpeed: 200 highlightSpeed: 200
highlightThickness: 600 highlightThickness: 120
highlightLowerClamp: 0.25 highlightLowerClamp: 0.25
- EID: 227 - EID: 227
Name: Mesh_Cheese Name: Mesh_Cheese
@ -4517,8 +4346,8 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 3.22328258, y: 1.08429813, z: -0.57395637} Translate: {x: 3.22328258, y: 1.02709854, z: -0.57395637}
Rotate: {x: -0, y: 0, z: -0} Rotate: {x: 5.62993963e-09, y: -7.03049191e-17, z: -1.92319405e-08}
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
@ -4530,7 +4359,7 @@
Drag: 0.00999999978 Drag: 0.00999999978
Angular Drag: 0.100000001 Angular Drag: 0.100000001
Use Gravity: true Use Gravity: true
Interpolate: true Interpolate: false
Sleeping Enabled: true Sleeping Enabled: true
Freeze Position X: false Freeze Position X: false
Freeze Position Y: false Freeze Position Y: false
@ -4560,7 +4389,7 @@
dontReturn: false dontReturn: false
soundDistance: 10 soundDistance: 10
highlightSpeed: 200 highlightSpeed: 200
highlightThickness: 600 highlightThickness: 50
highlightLowerClamp: 0.25 highlightLowerClamp: 0.25
- EID: 65778 - EID: 65778
Name: Mesh_Apple Name: Mesh_Apple
@ -4568,8 +4397,8 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -2.5, y: 0.778462529, z: -5} Translate: {x: -2.50000072, y: 0.799999774, z: -5.00000095}
Rotate: {x: -0, y: 0, z: -0} Rotate: {x: -4.09249949e-08, y: 1.40052995e-13, z: 2.95086267e-08}
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
@ -4581,7 +4410,7 @@
Drag: 0.00999999978 Drag: 0.00999999978
Angular Drag: 0.100000001 Angular Drag: 0.100000001
Use Gravity: true Use Gravity: true
Interpolate: true Interpolate: false
Sleeping Enabled: true Sleeping Enabled: true
Freeze Position X: false Freeze Position X: false
Freeze Position Y: false Freeze Position Y: false
@ -4611,7 +4440,7 @@
dontReturn: false dontReturn: false
soundDistance: 10 soundDistance: 10
highlightSpeed: 200 highlightSpeed: 200
highlightThickness: 600 highlightThickness: 60
highlightLowerClamp: 0.25 highlightLowerClamp: 0.25
- EID: 216 - EID: 216
Name: Mesh_Apple Name: Mesh_Apple
@ -4619,8 +4448,8 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -2.5, y: 0.778462529, z: -4.28408813} Translate: {x: -2.50000072, y: 0.799999893, z: -4.28408909}
Rotate: {x: -0, y: 0, z: -0} Rotate: {x: -5.83341553e-08, y: 7.48974247e-14, z: 1.10461471e-08}
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
@ -4632,7 +4461,7 @@
Drag: 0.00999999978 Drag: 0.00999999978
Angular Drag: 0.100000001 Angular Drag: 0.100000001
Use Gravity: true Use Gravity: true
Interpolate: true Interpolate: false
Sleeping Enabled: true Sleeping Enabled: true
Freeze Position X: false Freeze Position X: false
Freeze Position Y: false Freeze Position Y: false
@ -4662,7 +4491,7 @@
dontReturn: false dontReturn: false
soundDistance: 10 soundDistance: 10
highlightSpeed: 200 highlightSpeed: 200
highlightThickness: 600 highlightThickness: 60
highlightLowerClamp: 0.25 highlightLowerClamp: 0.25
- EID: 229 - EID: 229
Name: ====ScoreZonePool==== Name: ====ScoreZonePool====
@ -4677,7 +4506,7 @@
Components: Components:
Transform Component: Transform Component:
Translate: {x: -7.47360849, y: 1.4327563, z: -2.44241929} Translate: {x: -7.47360849, y: 1.4327563, z: -2.44241929}
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
RigidBody Component: RigidBody Component:
@ -4739,7 +4568,7 @@
Components: Components:
Transform Component: Transform Component:
Translate: {x: 1.97487497, y: 1.3500793, z: -10.195508} Translate: {x: 1.97487497, y: 1.3500793, z: -10.195508}
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
RigidBody Component: RigidBody Component:
@ -4800,8 +4629,8 @@
NumberOfChildren: 1 NumberOfChildren: 1
Components: Components:
Transform Component: Transform Component:
Translate: {x: -5.47656059, y: 1.4327563, z: -2.44241929} Translate: {x: -5.47656107, y: 1.4327563, z: -2.44241929}
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
RigidBody Component: RigidBody Component:
@ -4863,7 +4692,7 @@
Components: Components:
Transform Component: Transform Component:
Translate: {x: 6.09239721, y: 1.4327563, z: -6.03106117} Translate: {x: 6.09239721, y: 1.4327563, z: -6.03106117}
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
RigidBody Component: RigidBody Component:
@ -4925,7 +4754,7 @@
Components: Components:
Transform Component: Transform Component:
Translate: {x: 6.09239721, y: 1.4327563, z: -3.94262314} Translate: {x: 6.09239721, y: 1.4327563, z: -3.94262314}
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
RigidBody Component: RigidBody Component:
@ -5075,7 +4904,7 @@
Components: Components:
Transform Component: Transform Component:
Translate: {x: -8, y: 1.142977, z: -4} Translate: {x: -8, y: 1.142977, z: -4}
Rotate: {x: -0, y: 0, z: -0} Rotate: {x: -0, y: 1.57079649, z: 0}
Scale: {x: 0.999999881, y: 1, z: 0.999999881} Scale: {x: 0.999999881, y: 1, z: 0.999999881}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
@ -5090,7 +4919,7 @@
Interpolate: false Interpolate: false
Sleeping Enabled: true Sleeping Enabled: true
Freeze Position X: false Freeze Position X: false
Freeze Position Y: true Freeze Position Y: false
Freeze Position Z: false Freeze Position Z: false
Freeze Rotation X: true Freeze Rotation X: true
Freeze Rotation Y: true Freeze Rotation Y: true
@ -5120,23 +4949,27 @@
maxJumpHeight: 2 maxJumpHeight: 2
maxJumpTime: 0.75 maxJumpTime: 0.75
fallMultipler: 3 fallMultipler: 3
jumpPadMultiplayer: 2 jumpPadMultiplayer: 1.20000005
lightMultiper: 0.75 lightMultiper: 0.899999976
mediumMultiper: 0.5 mediumMultiper: 0.699999988
heavyMultiper: 0.25 heavyMultiper: 0.5
silhouettePlayer: 462
silhouetteBag: 465
- Type: PickAndThrow - Type: PickAndThrow
Enabled: true Enabled: true
throwForce: [8, 10, 8] throwForce: [8, 10, 8]
cameraArmOffSet: [0, 0.25, 0] cameraArmOffSet: [0.25, 0.600000024, 0.200000003]
delayTimer: 1 delayTimer: 1
aimingLength: 0.899999976 aimingLength: 1
throwItem: false throwItem: false
silhouettePlayer: 462 rayDistance: 0.75
silhouetteBag: 465
rayDistance: 0.5
rayHeight: 0.100000001 rayHeight: 0.100000001
aimingFOV: 50 aimingFOV: 50
defaultFOV: 45 defaultFOV: 45
- Type: StateMachine
Enabled: true
currentStateName: Idle State
currentAnimName: ""
- EID: 65733 - EID: 65733
Name: HoldingPoint Name: HoldingPoint
IsActive: true IsActive: true
@ -5155,36 +4988,36 @@
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: -2.98023224e-08, z: 4.76837158e-07} Translate: {x: 0, y: -2.98023224e-08, z: 4.76837158e-07}
Rotate: {x: 0, y: 6.28318548, z: 2.23517329e-08} Rotate: {x: -0.173316926, y: 3.1415925, z: 2.23517329e-08}
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
Camera Component: Camera Component:
Position: {x: 2.12735963, y: 0.362327784, z: 7.98933029} Position: {x: -8.9091711, y: 2.05214882, z: -4}
Pitch: 0 Pitch: -9.93032837
Yaw: 360 Yaw: 270
Roll: 1.28065994e-06 Roll: 1.28065994e-06
Width: 1920 Width: 1920
Near: 0.00999999978 Near: 0.00999999978
Far: 10000 Far: 10000
Perspective: true Perspective: true
FOV: 90 FOV: 45
IsActive: true IsActive: true
Camera Arm Component: Camera Arm Component:
Arm Pitch: 0 Arm Pitch: 45
Arm Yaw: 0 Arm Yaw: -90
Arm Length: 1 Arm Length: 3
Look At Camera Origin: true Look At Camera Origin: true
Target Offset: {x: 0, y: 0, z: 0} Target Offset: {x: 0, y: 0.75, z: 0}
Camera Collision: true Camera Collision: true
IsActive: true IsActive: true
Scripts: Scripts:
- Type: SHADE_Scripting.ThirdPersonCamera - Type: SHADE_Scripting.ThirdPersonCamera
Enabled: true Enabled: true
armLength: 2 armLength: 3
turnSpeedPitch: 0.300000012 turnSpeedPitch: 0.200000003
turnSpeedYaw: 0.5 turnSpeedYaw: 0.400000006
inverseXControls: true inverseXControls: false
inverseYControls: true inverseYControls: false
pitchUpperClamp: 45 pitchUpperClamp: 45
pitchLowerClamp: 5 pitchLowerClamp: 5
- EID: 65731 - EID: 65731
@ -5244,7 +5077,7 @@
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 464 - EID: 464
Name: Canvas Name: StealFoodCanvas
IsActive: true IsActive: true
NumberOfChildren: 1 NumberOfChildren: 1
Components: Components:
@ -5277,7 +5110,7 @@
- Type: SHADE_Scripting.UI.StealFoodPopUp - Type: SHADE_Scripting.UI.StealFoodPopUp
Enabled: true Enabled: true
popInDuration: 0.5 popInDuration: 0.5
popOutDuration: 0.5 popOutDuration: 0.075000003
stayDuration: 1 stayDuration: 1
rotationAmt: 1800 rotationAmt: 1800
scaleAmtX: 538 scaleAmtX: 538
@ -5291,6 +5124,192 @@
- Type: SHADE_Scripting.UI.TweenManager - Type: SHADE_Scripting.UI.TweenManager
Enabled: true Enabled: true
- EID: 461 - EID: 461
Name: CameraPoints
IsActive: true
NumberOfChildren: 3
Components: ~
Scripts:
- Type: SHADE_Scripting.UI.PreviewLevel
Enabled: true
endPoint1: [-5.5, 1.5, -2]
endPoint2: [1, 1.5, -7.5]
endPoint3: [2.5, 1.5, -3]
playerCamera: 65730
duration: 3
- EID: 453
Name: PreviewLevel1
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -7.5, y: 1.5, z: -2}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Camera Component:
Position: {x: -5.5, y: 1.5, z: -2}
Pitch: 0
Yaw: 0
Roll: 0
Width: 1920
Near: 0.00999999978
Far: 10000
Perspective: true
FOV: 90
IsActive: true
Scripts: ~
- EID: 452
Name: PreviewLevel2
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -1.5, y: 1.5, z: -7.5}
Rotate: {x: 0, y: -3.14159274, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Camera Component:
Position: {x: -0.24528563, y: 1.5, z: -7.5}
Pitch: 0
Yaw: -180
Roll: 0
Width: 1920
Near: 0.00999999978
Far: 10000
Perspective: true
FOV: 90
IsActive: true
Scripts: ~
- EID: 451
Name: PreviewLevel3
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 2.5, y: 1.5, z: -7.5}
Rotate: {x: 0, y: 4.71238899, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Camera Component:
Position: {x: 2.5, y: 1.5, z: -7.5}
Pitch: 0
Yaw: 270
Roll: 0
Width: 1920
Near: 0.00999999978
Far: 10000
Perspective: true
FOV: 90
IsActive: true
Scripts: ~
- EID: 458
Name: PauseCanvas
IsActive: false
NumberOfChildren: 4
Components:
Canvas Component:
Canvas Width: 1920
Canvas Height: 1080
Scale by canvas width: false
IsActive: false
Scripts: ~
- EID: 457
Name: ResumeButton
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 100, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 300, y: 200, z: 500}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 129340704
IsActive: true
Button Component:
Default Texture: 63979907
Hovered Texture: 51379325
Clicked Texture: 66788278
IsActive: true
UI Component:
Canvas ID: 458
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 456
Name: QuitButton
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: -300, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 300, y: 200, z: 500}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 129340704
IsActive: true
Button Component:
Default Texture: 61602036
Hovered Texture: 58910810
Clicked Texture: 57786063
IsActive: true
UI Component:
Canvas ID: 458
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 455
Name: RetryButton
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: -100, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 300, y: 200, z: 500}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 129340704
IsActive: true
Button Component:
Default Texture: 64806384
Hovered Texture: 58347825
Clicked Texture: 63234380
IsActive: true
UI Component:
Canvas ID: 458
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 454
Name: GamePauseText
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -250, y: 300, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 100, y: 100, z: 100}
IsActive: true
Text Renderer Component:
Text: Game Pause
Font: 176667660
Color: {x: 1, y: 1, z: 1, w: 1}
IsActive: false
UI Component:
Canvas ID: 458
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 450
Name: TransitionCanvas Name: TransitionCanvas
IsActive: true IsActive: true
NumberOfChildren: 1 NumberOfChildren: 1
@ -5301,22 +5320,22 @@
Scale by canvas width: false Scale by canvas width: false
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 459 - EID: 65982
Name: Transition Name: Transition
IsActive: true IsActive: true
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: 0, z: 0} Translate: {x: 0, y: 0, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1920, y: 1080, z: 1} Scale: {x: 2500, y: 1080, z: 1}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 141771688 Mesh: 141771688
Material: 120016136 Material: 120016136
IsActive: true IsActive: true
UI Component: UI Component:
Canvas ID: 461 Canvas ID: 450
Hovered: false Hovered: false
Clicked: false Clicked: false
IsActive: true IsActive: true

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -28,11 +28,6 @@ public class PickAndThrow : Script
public bool throwItem = false; public bool throwItem = false;
private Vector3 prevTargetOffSet; private Vector3 prevTargetOffSet;
public GameObject silhouettePlayer;
public Renderable silhouettePlayerRend;
public GameObject silhouetteBag;
public Renderable silhouetteBagRend;
[Tooltip("Lenght of ray")] [Tooltip("Lenght of ray")]
public float rayDistance = 1; public float rayDistance = 1;
@ -58,41 +53,17 @@ public class PickAndThrow : Script
if(!tpc) if(!tpc)
Debug.LogError("TPC EMPTY"); Debug.LogError("TPC EMPTY");
if(!silhouettePlayer)
Debug.LogError("silhouettePlayer EMPTY");
else
silhouettePlayerRend = silhouettePlayer.GetComponent<Renderable>();
if (!silhouetteBag)
Debug.LogError("silhouetteBag EMPTY");
else
silhouetteBagRend = silhouetteBag.GetComponent<Renderable>();
AudioHandler.audioClipHandlers["SFXThrow"] = Audio.CreateAudioClip("event:/Raccoon/raccoon_throw"); AudioHandler.audioClipHandlers["SFXThrow"] = Audio.CreateAudioClip("event:/Raccoon/raccoon_throw");
timer = delayTimer; timer = delayTimer;
} }
protected override void update() protected override void update()
{ {
if (GameManager.Instance.GamePause) if (GameManager.Instance.GamePause || !GameManager.Instance.stealFoodPopUpDone)
{ {
return; return;
} }
if (silhouettePlayerRend && silhouetteBagRend)
{
//wait for daniel
//0.00075f;
Vector3 dis = Camera.GetMainCamera().Position - GameObject.GetComponent<Transform>().LocalPosition;
float disSqr = dis.GetSqrMagnitude();
float ratio = System.Math.Clamp(1 - (disSqr / (1 + disSqr)), 0, 1.0f);
float temp = (1 - ratio) * 0.00075f;
if (temp <= 0.0006f)
temp = 0.1f;
silhouettePlayerRend.Material.SetProperty<float>("data.offset", temp);
silhouetteBagRend.Material.SetProperty<float>("data.offset", temp);
}
if (timer <= delayTimer) if (timer <= delayTimer)
timer += Time.DeltaTimeF; timer += Time.DeltaTimeF;
@ -171,7 +142,7 @@ public class PickAndThrow : Script
protected override void fixedUpdate() protected override void fixedUpdate()
{ {
if (GameManager.Instance.GamePause) if (GameManager.Instance.GamePause || !GameManager.Instance.stealFoodPopUpDone)
{ {
return; return;
} }

View File

@ -17,15 +17,6 @@ public class PlayerController : Script
TOTAL TOTAL
} }
/* public enum WalkingState
{
CARRY,
AIMING,
THROW,
WALK,
TOTAL
}*/
public RigidBody rb { get; set; } public RigidBody rb { get; set; }
public Transform tranform { get; set; } public Transform tranform { get; set; }
public Camera cam { get; set; } public Camera cam { get; set; }
@ -85,6 +76,12 @@ public class PlayerController : Script
[Tooltip("How heavy item will affect player jump")] [Tooltip("How heavy item will affect player jump")]
public float heavyMultiper = 0.25f; public float heavyMultiper = 0.25f;
//silhouette=====================================================================
public GameObject silhouettePlayer;
public Renderable silhouettePlayerRend;
public GameObject silhouetteBag;
public Renderable silhouetteBagRend;
protected override void awake() protected override void awake()
{ {
//default setup //default setup
@ -119,6 +116,21 @@ public class PlayerController : Script
dictionary.Add(typeof(PlayerCaughtState), new PlayerCaughtState(stateMachine)); dictionary.Add(typeof(PlayerCaughtState), new PlayerCaughtState(stateMachine));
stateMachine.InitStateMachine(dictionary); stateMachine.InitStateMachine(dictionary);
if (!silhouettePlayer)
Debug.LogError("silhouettePlayer EMPTY");
else
{
silhouettePlayerRend = silhouettePlayer.GetComponent<Renderable>();
silhouettePlayerRend.Material.SetProperty<float>("data.offset", 0.1f);
}
if (!silhouetteBag)
Debug.LogError("silhouetteBag EMPTY");
else
{
silhouetteBagRend = silhouetteBag.GetComponent<Renderable>();
silhouetteBagRend.Material.SetProperty<float>("data.offset", 0.1f);
}
} }
protected override void lateUpdate() protected override void lateUpdate()
@ -127,26 +139,23 @@ public class PlayerController : Script
protected override void update() protected override void update()
{ {
if (GameManager.Instance.GamePause) if (GameManager.Instance.GamePause || !GameManager.Instance.stealFoodPopUpDone)
{ {
return; return;
} }
if (delayTimer <= 1) if (silhouettePlayerRend && silhouetteBagRend)
delayTimer += Time.DeltaTimeF; {
Vector3 dis = Camera.GetMainCamera().Position - GameObject.GetComponent<Transform>().LocalPosition;
float disSqr = dis.GetSqrMagnitude();
float ratio = System.Math.Clamp(1 - (disSqr / (1 + disSqr)), 0, 1.0f);
float temp = (1 - ratio) * 0.00075f;
if (temp <= 0.0006f)
temp = 0.1f;
silhouettePlayerRend.Material.SetProperty<float>("data.offset", temp);
silhouetteBagRend.Material.SetProperty<float>("data.offset", temp);
}
if (delayTimer < 1)
{
if (tranform && respawnPoint && rb)
{
rb.LinearVelocity = Vector3.Zero;
tranform.LocalPosition = respawnPoint.GetComponent<Transform>().LocalPosition;
}
}
else
{
rb.FreezePositionY = false;
}
//PickAndThrow check //PickAndThrow check
if (!pat) if (!pat)
{ {
@ -156,13 +165,15 @@ public class PlayerController : Script
} }
if (!cam) if (!cam)
{
cam = GetComponentInChildren<Camera>(); cam = GetComponentInChildren<Camera>();
if(pat)
cam.FOV = pat.defaultFOV;
}
if(!camArm) if(!camArm)
camArm = GetComponentInChildren<CameraArm>(); camArm = GetComponentInChildren<CameraArm>();
//tempFix
if (tranform)
tranform.LocalEulerAngles = new Vector3(0.0f, tranform.LocalEulerAngles.y, 0.0f);
GotCaught(); GotCaught();
Rotation(); Rotation();
@ -178,7 +189,7 @@ public class PlayerController : Script
protected override void fixedUpdate() protected override void fixedUpdate()
{ {
if (GameManager.Instance.GamePause) if (GameManager.Instance.GamePause || !GameManager.Instance.stealFoodPopUpDone)
{ {
return; return;
} }
@ -333,10 +344,11 @@ public class PlayerController : Script
private void Rotation() private void Rotation()
{ {
tranform.LocalEulerAngles = new Vector3(0.0f, tranform.LocalEulerAngles.y, 0.0f);
if (isMoveKeyPress && tranform && !isAiming) if (isMoveKeyPress && tranform && !isAiming)
{ {
Quaternion currentRotation = tranform.LocalRotation; Quaternion currentRotation = tranform.LocalRotation;
Quaternion targetRotation = Quaternion.LookRotation(new Vector3(axisMove.x, 0.0f, axisMove.y), new Vector3(0.0f, 1.0f, 0.0f)); Quaternion targetRotation = Quaternion.LookRotation(new Vector3(axisMove.x, 0.0f, axisMove.y), Vector3.Up);
tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.FixedDeltaTime); tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.FixedDeltaTime);
} }
else if (camArm && tranform && isAiming) else if (camArm && tranform && isAiming)
@ -345,6 +357,7 @@ public class PlayerController : Script
Quaternion targetRotation = Quaternion.Euler(0.0f, SHADE.Math.DegreesToRadians(camArm.Yaw + 180.0f), 0.0f); Quaternion targetRotation = Quaternion.Euler(0.0f, SHADE.Math.DegreesToRadians(camArm.Yaw + 180.0f), 0.0f);
tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.FixedDeltaTime); tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.FixedDeltaTime);
} }
} }
private void Gravity() private void Gravity()

View File

@ -41,7 +41,7 @@ namespace SHADE_Scripting
protected override void update() protected override void update()
{ {
if (GameManager.Instance.GamePause) if (GameManager.Instance.GamePause || !GameManager.Instance.stealFoodPopUpDone)
{ {
return; return;
} }

View File

@ -41,6 +41,8 @@ public class GameManager : Script
public static GameManager Instance { get; private set; } public static GameManager Instance { get; private set; }
public bool GamePause { get; set; } public bool GamePause { get; set; }
public bool stealFoodPopUpDone { get; set; }
public bool PreviewLevelDone { get; set; }
public bool itemShatter { get; set; } public bool itemShatter { get; set; }
@ -63,12 +65,20 @@ public class GameManager : Script
currMultiplierDuration = 0; currMultiplierDuration = 0;
fontScalar = new Vector3(multiplierFont / maxMultiplierDuration, multiplierFont / maxMultiplierDuration , multiplierFont / maxMultiplierDuration); fontScalar = new Vector3(multiplierFont / maxMultiplierDuration, multiplierFont / maxMultiplierDuration , multiplierFont / maxMultiplierDuration);
itemShatter = false; itemShatter = false;
GamePause = false;
stealFoodPopUpDone = false;
PreviewLevelDone = false;
AudioHandler.audioClipHandlers["BGMWin"] = Audio.CreateAudioClip("event:/Music/stingers/game_win"); AudioHandler.audioClipHandlers["BGMWin"] = Audio.CreateAudioClip("event:/Music/stingers/game_win");
AudioHandler.audioClipHandlers["BGMLose"] = Audio.CreateAudioClip("event:/Music/stingers/game_lose"); AudioHandler.audioClipHandlers["BGMLose"] = Audio.CreateAudioClip("event:/Music/stingers/game_lose");
goingToWin = false; goingToWin = false;
goingToLose = false; goingToLose = false;
if (scoreText)
scoreText.GetComponent<TextRenderable>().Text = $"Score: {Score}";
if (timeText)
timeText.GetComponent<TextRenderable>().Text = $"Time Left: {timer.ToString("0")}";
} }
protected override void start() protected override void start()
@ -90,7 +100,7 @@ public class GameManager : Script
protected override void update() protected override void update()
{ {
if (GamePause) if (GamePause || !stealFoodPopUpDone)
{ {
return; return;
} }
@ -101,7 +111,7 @@ public class GameManager : Script
if(scoreText) if(scoreText)
scoreText.GetComponent<TextRenderable>().Text = $"{Score}"; scoreText.GetComponent<TextRenderable>().Text = $"{Score}";
if(timeText) if(timeText)
timeText.GetComponent<TextRenderable>().Text = $"Time Left: {timer.ToString("0.00")}"; timeText.GetComponent<TextRenderable>().Text = $"Time Left: {timer.ToString("0")}";
if (itemScored) if (itemScored)
{ {

View File

@ -0,0 +1,158 @@
using SHADE;
using System;
using System.Collections.Generic;
using System.Linq;
namespace SHADE_Scripting.UI
{
public class PreviewLevel : Script
{
private List<Camera> listOfCamera;
public Vector3 endPoint1;
public Vector3 endPoint2;
public Vector3 endPoint3;
public GameObject playerCamera;
public float duration = 3.0f;
private bool point1Done = false;
private bool point2Done = false;
private bool point3Done = false;
private bool reset2 = true;
private bool reset3 = true;
private bool skip = false;
[NonSerialized]
private TweenThreadVec3 moveToEndPoint1;
[NonSerialized]
private TweenThreadVec3 moveToEndPoint2;
[NonSerialized]
private TweenThreadVec3 moveToEndPoint3;
protected override void awake()
{
listOfCamera = GameObject.GetComponentsInChildren<Camera>().ToList();
if (listOfCamera.Count == 0)
Debug.LogError("EMPTY PREVIEW POINTS");
listOfCamera[0].SetMainCamera();
moveToEndPoint1 = TweenManager.CreateTweenThreadVec3(duration, listOfCamera[0].GetComponent<Transform>().LocalPosition, endPoint1, EASING_METHOD.EASE_IN_SINE);
moveToEndPoint2 = TweenManager.CreateTweenThreadVec3(duration, listOfCamera[1].GetComponent<Transform>().LocalPosition, endPoint2, EASING_METHOD.EASE_IN_SINE);
moveToEndPoint3 = TweenManager.CreateTweenThreadVec3(duration, listOfCamera[2].GetComponent<Transform>().LocalPosition, endPoint3, EASING_METHOD.EASE_IN_SINE);
}
protected override void update()
{
if (!SceneFadeInOut.Instance.FadeOutFinished() && !point1Done)
{
moveToEndPoint1.Reset();
return;
}
if (Input.GetKeyUp(Input.KeyCode.Space))
{
skip = true;
point1Done = true;
SceneFadeInOut.Instance.CallFadeIn();
SceneFadeInOut.Instance.alphaValue = 0.01f;
}
if (skip && SceneFadeInOut.Instance.FadeInFinished())
{
playerCamera.GetComponent<Camera>().SetMainCamera();
SceneFadeInOut.Instance.CallFadeOut();
}
if (skip && SceneFadeInOut.Instance.FadeOutFinished())
{
GameManager.Instance.PreviewLevelDone = true;
}
if (!skip)
{
if (!point1Done)
{
listOfCamera[0].GetComponent<Transform>().LocalPosition = moveToEndPoint1.GetValue();
if (moveToEndPoint1.IsCompleted())
{
point1Done = true;
SceneFadeInOut.Instance.CallFadeIn();
SceneFadeInOut.Instance.alphaValue = 0.01f;
}
}
if (SceneFadeInOut.Instance.FadeInFinished() && point1Done)
{
listOfCamera[1].SetMainCamera();
SceneFadeInOut.Instance.CallFadeOut();
}
if (SceneFadeInOut.Instance.FadeOutFinished() && point1Done)
{
if (!point2Done)
{
if (reset2)
{
moveToEndPoint2.Reset();
reset2 = false;
}
listOfCamera[1].GetComponent<Transform>().LocalPosition = moveToEndPoint2.GetValue();
if (moveToEndPoint2.IsCompleted())
{
point2Done = true;
SceneFadeInOut.Instance.CallFadeIn();
SceneFadeInOut.Instance.alphaValue = 0.01f;
}
}
}
if (SceneFadeInOut.Instance.FadeInFinished() && point2Done)
{
listOfCamera[2].SetMainCamera();
SceneFadeInOut.Instance.CallFadeOut();
}
if (SceneFadeInOut.Instance.FadeOutFinished() && point2Done)
{
if (!point3Done)
{
if (reset3)
{
moveToEndPoint3 = TweenManager.CreateTweenThreadVec3(duration, listOfCamera[2].GetComponent<Transform>().LocalPosition, endPoint3, EASING_METHOD.EASE_IN_SINE);
reset3 = false;
}
listOfCamera[2].GetComponent<Transform>().LocalPosition = moveToEndPoint3.GetValue();
if (moveToEndPoint3.IsCompleted())
{
point3Done = true;
SceneFadeInOut.Instance.CallFadeIn();
SceneFadeInOut.Instance.alphaValue = 0.01f;
}
}
}
if (SceneFadeInOut.Instance.FadeInFinished() && point3Done)
{
playerCamera.GetComponent<Camera>().SetMainCamera();
SceneFadeInOut.Instance.CallFadeOut();
}
if (SceneFadeInOut.Instance.FadeOutFinished() && point3Done)
{
GameManager.Instance.PreviewLevelDone = true;
}
}
}
}
}

View File

@ -0,0 +1,3 @@
Name: SC_PreviewLevel
ID: 155897609
Type: 9

View File

@ -52,12 +52,12 @@ namespace SHADE_Scripting.UI
private static float EaseInSine(float value) private static float EaseInSine(float value)
{ {
return (float)(1.0f - Math.Cos((value * Math.PI) / 2.0f)); return (float)(1.0f - Math.Cos((value * Math.PI / 2.0f)));
} }
private static float EaseOutSine(float value) private static float EaseOutSine(float value)
{ {
return (float)(Math.Sin(value * Math.PI) / 2.0f); return (float)(Math.Sin(value * Math.PI / 2.0f));
} }

View File

@ -409,7 +409,11 @@ public class Cutscene : Script
private void initCutscene1() private void initCutscene1()
{ {
if(cutscene1Points)
listOfCutscene1Points = cutscene1Points.GetComponentsInChildren<Transform>().ToList(); listOfCutscene1Points = cutscene1Points.GetComponentsInChildren<Transform>().ToList();
else
Debug.LogError("Cutscene1Points Missing");
if (listOfCutscene1Points.Count == 0) if (listOfCutscene1Points.Count == 0)
Debug.LogError("Cutscene1Points Empty"); Debug.LogError("Cutscene1Points Empty");
@ -455,7 +459,11 @@ public class Cutscene : Script
private void initCutscene2() private void initCutscene2()
{ {
if(cutscene2Points)
listOfCutscene2Points = cutscene2Points.GetComponentsInChildren<Transform>().ToList(); listOfCutscene2Points = cutscene2Points.GetComponentsInChildren<Transform>().ToList();
else
Debug.LogError("cutscene2Points Missing");
if (listOfCutscene2Points.Count == 0) if (listOfCutscene2Points.Count == 0)
Debug.LogError("Cutscene2Points Empty"); Debug.LogError("Cutscene2Points Empty");
@ -503,7 +511,11 @@ public class Cutscene : Script
private void initCutscene3() private void initCutscene3()
{ {
if(cutscene3Points)
listOfCutscene3Points = cutscene3Points.GetComponentsInChildren<Transform>().ToList(); listOfCutscene3Points = cutscene3Points.GetComponentsInChildren<Transform>().ToList();
else
Debug.LogError("cutscene3Points Missing");
if (listOfCutscene3Points.Count == 0) if (listOfCutscene3Points.Count == 0)
Debug.LogError("Cutscene3Points Empty"); Debug.LogError("Cutscene3Points Empty");

View File

@ -8,16 +8,18 @@ public class PauseMenu : Script
public GameObject retryBtn; public GameObject retryBtn;
public GameObject quitBtn; public GameObject quitBtn;
public GameObject gamePauseText; private TextRenderable gamePauseText;
public GameObject canvas; public GameObject canvas;
protected override void awake() protected override void awake()
{ {
GameManager.Instance.GamePause = false; GameManager.Instance.GamePause = false;
if (gamePauseText)
gamePauseText.GetComponent<TextRenderable>().Enabled = false;
if (canvas) if (canvas)
{
gamePauseText = canvas.GetComponentInChildren<TextRenderable>();
canvas.SetActive(false); canvas.SetActive(false);
}
if (!resumeBtn) if (!resumeBtn)
Debug.LogError("Resume Btn missing"); Debug.LogError("Resume Btn missing");
@ -41,7 +43,7 @@ public class PauseMenu : Script
GameManager.Instance.GamePause = false; GameManager.Instance.GamePause = false;
AudioHandler.PauseAllSounds(false); AudioHandler.PauseAllSounds(false);
if (gamePauseText) if (gamePauseText)
gamePauseText.GetComponent<TextRenderable>().Enabled = false; gamePauseText.Enabled = false;
if (canvas) if (canvas)
canvas.SetActive(false); canvas.SetActive(false);
} }
@ -86,12 +88,12 @@ public class PauseMenu : Script
protected override void update() protected override void update()
{ {
if (Input.GetKeyDown(Input.KeyCode.Escape) && !GameManager.Instance.GamePause) if (Input.GetKeyDown(Input.KeyCode.Escape) && !GameManager.Instance.GamePause && GameManager.Instance.stealFoodPopUpDone)
{ {
GameManager.Instance.GamePause = true; GameManager.Instance.GamePause = true;
AudioHandler.PauseAllSounds(true); AudioHandler.PauseAllSounds(true);
if (gamePauseText) if (gamePauseText)
gamePauseText.GetComponent<TextRenderable>().Enabled = true; gamePauseText.Enabled = true;
if (canvas) if (canvas)
canvas.SetActive(true); canvas.SetActive(true);
} }

View File

@ -65,7 +65,6 @@ namespace SHADE_Scripting.UI
if (alphaValue >= 1.0f) if (alphaValue >= 1.0f)
{ {
alphaValue = 1.0f; alphaValue = 1.0f;
GameObject.Parent.SetActive(false);
} }
} }

View File

@ -51,6 +51,13 @@ namespace SHADE_Scripting.UI
//538x377 //538x377
protected override void update() protected override void update()
{ {
if (!GameManager.Instance.PreviewLevelDone)
{
rot.Reset();
scaleX.Reset();
scaleY.Reset();
return;
}
if (!popInDone) if (!popInDone)
{ {
@ -79,11 +86,11 @@ namespace SHADE_Scripting.UI
if (scaleOutX.IsCompleted() && scaleOutY.IsCompleted()) if (scaleOutX.IsCompleted() && scaleOutY.IsCompleted())
{ {
GameObject.SetActive(false); GameObject.SetActive(false);
GameManager.Instance.stealFoodPopUpDone = true;
} }
} }
} }
} }
} }

View File

@ -32,5 +32,5 @@ void main()
Out.uv = aUV; Out.uv = aUV;
Out.color = aColor; Out.color = aColor;
gl_Position = cameraData.projMat * aTransform * vec4(aPos, 1.0f); gl_Position = cameraData.vpMat * aTransform * vec4(aPos, 1.0f);
} }

View File

@ -37,7 +37,7 @@ layout(location = 1) out uint outEntityID;
void main() void main()
{ {
fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv); fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv);
if (fragColor.a < 0.01f) if (fragColor.a < 0.1f)
{ {
discard; discard;
} }

Binary file not shown.

View File

@ -22,6 +22,7 @@ namespace SHADE
SHRawAnimation::SHRawAnimation(const SHAnimAsset& asset) SHRawAnimation::SHRawAnimation(const SHAnimAsset& asset)
: ticksPerSecond { static_cast<int>(asset.ticksPerSecond) } : ticksPerSecond { static_cast<int>(asset.ticksPerSecond) }
, totalTime { static_cast<float>(asset.duration) / static_cast<int>(asset.ticksPerSecond) } , totalTime { static_cast<float>(asset.duration) / static_cast<int>(asset.ticksPerSecond) }
, totalFrames { static_cast<int>(asset.duration) }
{ {
// Populate keyframes // Populate keyframes
for (const auto& channel : asset.nodeChannels) for (const auto& channel : asset.nodeChannels)

View File

@ -67,6 +67,7 @@ namespace SHADE
const std::vector<Channel>& GetChannels() const noexcept { return channels; } const std::vector<Channel>& GetChannels() const noexcept { return channels; }
int GetTicksPerSecond() const noexcept { return ticksPerSecond; } int GetTicksPerSecond() const noexcept { return ticksPerSecond; }
float GetTotalTime() const noexcept { return totalTime; } float GetTotalTime() const noexcept { return totalTime; }
int GetTotalFrames() const noexcept { return totalFrames; }
private: private:
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@ -75,6 +76,7 @@ namespace SHADE
std::vector<Channel> channels; std::vector<Channel> channels;
int ticksPerSecond; int ticksPerSecond;
float totalTime; float totalTime;
int totalFrames;
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* Helper Functions */ /* Helper Functions */

View File

@ -14,3 +14,4 @@
#include "Physics/Interface/SHColliderComponent.h" #include "Physics/Interface/SHColliderComponent.h"
#include "Graphics/MiddleEnd/TextRendering/SHTextRenderableComponent.h" #include "Graphics/MiddleEnd/TextRendering/SHTextRenderableComponent.h"
#include "AudioSystem/SHAudioListenerComponent.h" #include "AudioSystem/SHAudioListenerComponent.h"
#include "Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.h"

View File

@ -12,6 +12,7 @@ of DigiPen Institute of Technology is prohibited.
#pragma once #pragma once
// STL Includes // STL Includes
#include <vector>
// Project Includes // Project Includes
#include "Resource/SHHandle.h" #include "Resource/SHHandle.h"
#include "Editor/EditorWindow/SHEditorWindow.h" #include "Editor/EditorWindow/SHEditorWindow.h"
@ -19,6 +20,9 @@ of DigiPen Institute of Technology is prohibited.
namespace SHADE namespace SHADE
{ {
/// <summary>
/// Editor for modifying the Animation Controller state machine.
/// </summary>
class SHAnimationControllerEditor final : public SHEditorWindow class SHAnimationControllerEditor final : public SHEditorWindow
{ {
public: public:
@ -36,10 +40,35 @@ namespace SHADE
void Exit() override; void Exit() override;
private: private:
/*---------------------------------------------------------------------------------*/
/* Type Definitions */
/*---------------------------------------------------------------------------------*/
union NodeAttributeIndex
{
int16_t Raw;
struct
{
uint8_t OwnerNodeIndex;
uint8_t AttributeIndex;
};
};
union NodeLinkIndex
{
int32_t Raw;
struct
{
NodeAttributeIndex SourceAttribute;
NodeAttributeIndex DestinationAttribute;
};
}; // What about same source and destination but different link?
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* Data Members */ /* Data Members */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
SHAnimationController controller; SHAnimationController controller;
std::vector<std::vector<NodeAttributeIndex>> inputNodesMap;
std::vector<std::vector<NodeAttributeIndex>> outputNodesMap;
std::vector<NodeLinkIndex> linkIndices; // Encodes details of the link in the node index
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* Helper Functions */ /* Helper Functions */

View File

@ -23,6 +23,7 @@
#include "Serialization/SHSerialization.h" #include "Serialization/SHSerialization.h"
#include <Editor/EditorWindow/HierarchyPanel/SHHierarchyPanel.h> #include <Editor/EditorWindow/HierarchyPanel/SHHierarchyPanel.h>
#include "Serialization/Prefab/SHPrefabManager.h" #include "Serialization/Prefab/SHPrefabManager.h"
#include "Editor/EditorWindow/RawAnimationInspector/SHRawAnimInspector.h"
namespace SHADE namespace SHADE
{ {
@ -371,14 +372,18 @@ namespace SHADE
case AssetType::SHADER: break; case AssetType::SHADER: break;
case AssetType::SHADER_BUILT_IN: break; case AssetType::SHADER_BUILT_IN: break;
case AssetType::TEXTURE: break; case AssetType::TEXTURE: break;
case AssetType::MODEL:
if (auto animInspector = SHEditorWindowManager::GetEditorWindow<SHRawAnimInspector>())
{
animInspector->Open(asset->id);
}
break;
case AssetType::MESH: break; case AssetType::MESH: break;
case AssetType::SCENE: case AssetType::SCENE:
{ if (editor->LoadScene(asset->id))
if(editor->LoadScene(asset->id))
{ {
editor->editorConfig->workingSceneID = asset->id; editor->editorConfig->workingSceneID = asset->id;
} }
}
break; break;
case AssetType::PREFAB: break; case AssetType::PREFAB: break;
case AssetType::MATERIAL: case AssetType::MATERIAL:

View File

@ -27,6 +27,7 @@
#include "Physics/Collision/Shapes/SHSphere.h" #include "Physics/Collision/Shapes/SHSphere.h"
#include "../SHEditorWindowManager.h" #include "../SHEditorWindowManager.h"
#include "../AssetBrowser/SHAssetBrowser.h" #include "../AssetBrowser/SHAssetBrowser.h"
#include "Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.h"
#include "Animation/SHAnimationClip.h" #include "Animation/SHAnimationClip.h"
namespace SHADE namespace SHADE
@ -601,7 +602,7 @@ namespace SHADE
component->SetText(val); component->SetText(val);
} }
); );
SHEditorWidgets::DragVec3("Text Size", { "X", "Y", "Z" }, [&textComp = component]() {return textComp->GetTextSize();}, [&textComp = component](SHVec3 const& size) {textComp->SetTextSize(size); });
SHEditorWidgets::ColorPicker("Color", [&textComp = component]() {return textComp->GetColor(); }, [&textComp = component](SHVec4 const& newColor) {textComp->SetColor(newColor); }); SHEditorWidgets::ColorPicker("Color", [&textComp = component]() {return textComp->GetColor(); }, [&textComp = component](SHVec4 const& newColor) {textComp->SetColor(newColor); });
} }
else else
@ -656,4 +657,95 @@ namespace SHADE
ImGui::PopID(); ImGui::PopID();
} }
template<>
static void DrawComponent(SHTrajectoryRenderableComponent* component)
{
if (!component)
return;
ImGui::PushID(SHFamilyID<SHComponent>::GetID<SHTrajectoryRenderableComponent>());
const auto componentType = rttr::type::get(*component);
SHEditorWidgets::CheckBox("##IsActive", [component]() {return component->isActive; }, [component](bool const& active) {component->isActive = active; }, "Is Component Active");
ImGui::SameLine();
if (ImGui::CollapsingHeader(componentType.get_name().data(), ImGuiTreeNodeFlags_DefaultOpen))
{
DrawContextMenu(component);
Handle<SHMesh> const& mesh = component->GetMesh();
const auto MESH_NAME = SHResourceManager::GetAssetName<SHMesh>(mesh).value_or("");
SHEditorWidgets::DragDropReadOnlyField<AssetID>("Mesh", MESH_NAME, [component]()
{
Handle<SHMesh> const& mesh = component->GetMesh();
return SHResourceManager::GetAssetID<SHMesh>(mesh).value_or(0);
},
[component](AssetID const& id)
{
if (SHAssetManager::GetType(id) != AssetType::MESH)
{
SHLOG_WARNING("Attempted to assign non mesh asset to Renderable Mesh property!")
return;
}
component->SetMesh(SHResourceManager::LoadOrGet<SHMesh>(id));
SHResourceManager::FinaliseChanges();
}, SHDragDrop::DRAG_RESOURCE);
if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left))
{
if (Handle<SHMesh> const& mesh = component->GetMesh())
{
AssetID assetID = SHResourceManager::GetAssetID<SHMesh>(mesh).value_or(0);
SHEditorWindowManager::GetEditorWindow<SHAssetBrowser>()->SetScrollTo(assetID);
}
}
SHEditorWidgets::ColorPicker("Start Color",
[comp = component]()
{
SHVec4 newColor(comp->GetStartColor());
newColor.w = comp->GetStartAlpha();
return newColor;
},
[comp = component](SHVec4 vec)
{
SHVec3 temp{vec.x, vec.y, vec.z};
float a = vec.w;
comp->SetStartColor(temp);
comp->SetStartAlpha(a);
});
SHEditorWidgets::ColorPicker("End Color",
[comp = component]()
{
SHVec4 newColor(comp->GetEndColor());
newColor.w = comp->GetEndAlpha();
return newColor;
},
[comp = component](SHVec4 vec)
{
SHVec3 temp{ vec.x, vec.y, vec.z };
float a = vec.w;
comp->SetEndColor(temp);
comp->SetEndAlpha(a);
});
SHEditorWidgets::DragFloat("Color Evolve Rate",
[comp = component]()
{
return comp->GetColorEvolveRate();
},
[comp = component](float rate)
{
return comp->SetColorEvolveRate(rate);
});
}
else
{
DrawContextMenu(component);
}
ImGui::PopID();
}
} }

View File

@ -0,0 +1,170 @@
/************************************************************************************//*!
\file SHRawAnimInspector.cpp
\author Tng Kah Wei, kahwei.tng, 390009620
\par email: kahwei.tng\@digipen.edu
\date Mar 1, 2023
\brief Contains the definition of SHRawAnimInspector's functions.
Copyright (C) 2023 DigiPen Institute of Technology.
Reproduction or disclosure of this file or its contents without the prior written consent
of DigiPen Institute of Technology is prohibited.
*//*************************************************************************************/
#include "SHpch.h"
#include "SHRawAnimInspector.h"
// STL Includes
#include <format>
// External Dependencies
#include <imgui.h>
#include <misc/cpp/imgui_stdlib.h>
// Project Includes
#include "Editor/IconsMaterialDesign.h"
#include "Animation/SHAnimationClip.h"
#include "Resource/SHResourceManager.h"
#include "Editor/EditorWindow/SHEditorWindowManager.h"
#include "Editor/SHEditorUI.h"
namespace SHADE
{
/*-----------------------------------------------------------------------------------*/
/* SHAnimClipCreatePrompt - Constructors/Destructors */
/*-----------------------------------------------------------------------------------*/
SHAnimClipCreatePrompt::SHAnimClipCreatePrompt()
: SHPopUpWindow("Create Animation Clip", true, 0, 0) {}
/*---------------------------------------------------------------------------------*/
/* SHAnimClipCreatePrompt - Lifecycle Functions */
/*---------------------------------------------------------------------------------*/
void SHAnimClipCreatePrompt::Init(Handle<SHRawAnimation> rawAnim)
{
rawAnimation = rawAnim;
// Set default parameters
if (rawAnimation)
{
newAssetName.clear();
firstIndex = 0;
lastIndex = rawAnimation->GetTotalFrames();
}
}
void SHAnimClipCreatePrompt::Draw()
{
if (Begin())
{
// Properties
SHEditorUI::InputTextField("Name", newAssetName);
SHEditorUI::PushID(0);
SHEditorUI::InputSlider("First Frame Index", 0, rawAnimation->GetTotalFrames(), firstIndex);
SHEditorUI::PopID();
SHEditorUI::PushID(1);
SHEditorUI::InputSlider("Last Frame Index", 0, rawAnimation->GetTotalFrames(), lastIndex);
SHEditorUI::PopID();
// Invalid values
const bool INVALID_CONFIG = newAssetName.empty() || firstIndex > lastIndex;
// Buttons
ImGui::BeginDisabled(INVALID_CONFIG);
{
if (ImGui::Button("Save"))
{
// Generate new asset
// Close
isOpen = false;
ImGui::CloseCurrentPopup();
}
}
ImGui::EndDisabled();
ImGui::SameLine();
if (ImGui::Button("Cancel"))
{
// Close
isOpen = false;
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
}
}
/*-----------------------------------------------------------------------------------*/
/* Cosntructors/Destructors */
/*-----------------------------------------------------------------------------------*/
SHRawAnimInspector::SHRawAnimInspector()
: SHEditorWindow("Animation Editor", ImGuiWindowFlags_MenuBar)
{}
/*-----------------------------------------------------------------------------------*/
/* Lifecycle Functions */
/*-----------------------------------------------------------------------------------*/
void SHRawAnimInspector::Init()
{
SHEditorWindow::Init();
SHEditorWindowManager::CreatePopupWindow<SHAnimClipCreatePrompt>();
}
void SHRawAnimInspector::Update()
{
SHEditorWindow::Update();
// Draw
if (Begin())
{
// Ignore if no asset
if (currRawAnim)
{
drawMenuBar();
// Button to add a new clip
if (ImGui::Button(std::format("{} Add", ICON_MD_ADD).data()))
{
auto prompt = SHEditorWindowManager::GetPopupWindow<SHAnimClipCreatePrompt>();
prompt->Init(currRawAnim);
prompt->isOpen = true;
}
// Render all clips
}
}
ImGui::End();
}
void SHRawAnimInspector::Exit()
{
SHEditorWindow::Exit();
}
/*-----------------------------------------------------------------------------------*/
/* Usage Functions */
/*-----------------------------------------------------------------------------------*/
void SHRawAnimInspector::Open(AssetID assetId)
{
currRawAnim = SHResourceManager::LoadOrGet<SHRawAnimation>(assetId);
}
/*-----------------------------------------------------------------------------------*/
/* Helper Functions */
/*-----------------------------------------------------------------------------------*/
void SHRawAnimInspector::drawMenuBar()
{
if (ImGui::BeginMenuBar())
{
if (ImGui::Button(std::format("{} Save", ICON_MD_SAVE).data()))
{
}
const std::string& ASSET_NAME = SHResourceManager::GetAssetName<SHRawAnimation>(currRawAnim).value_or("Unnamed Asset");
ImGui::Text(ASSET_NAME.c_str());
ImGui::EndMenuBar();
}
}
}

View File

@ -0,0 +1,86 @@
/************************************************************************************//*!
\file SHRawAnimInspector.h
\author Tng Kah Wei, kahwei.tng, 390009620
\par email: kahwei.tng\@digipen.edu
\date Mar 2, 2023
\brief Contains the definition of SHRawAnimInspector.
Copyright (C) 2023 DigiPen Institute of Technology.
Reproduction or disclosure of this file or its contents without the prior written consent
of DigiPen Institute of Technology is prohibited.
*//*************************************************************************************/
#pragma once
// Project Includes
#include "Assets/SHAssetMacros.h"
#include "Editor/EditorWindow/SHEditorWindow.h"
#include "Resource/SHHandle.h"
#include "Animation/SHRawAnimation.h"
#include "Editor/EditorWindow/SHPopUpWindow.h"
namespace SHADE
{
/// <summary>
/// Prompt for creating an animation clip. Init() must be called to pass in the correct
/// SHRawAnimation that the created clip will use.
/// </summary>
class SHAnimClipCreatePrompt : public SHPopUpWindow
{
public:
/*---------------------------------------------------------------------------------*/
/* Constructors/Destructors */
/*---------------------------------------------------------------------------------*/
SHAnimClipCreatePrompt();
/*---------------------------------------------------------------------------------*/
/* Lifecycle Functions */
/*---------------------------------------------------------------------------------*/
void Init(Handle<SHRawAnimation> rawAnim);
void Draw() override;
private:
/*---------------------------------------------------------------------------------*/
/* Data Members */
/*---------------------------------------------------------------------------------*/
std::string newAssetName;
int firstIndex = 0;
int lastIndex = 0;
Handle<SHRawAnimation> rawAnimation;
};
/// <summary>
/// Editor for generating SHAnimationClips from a single SHRawAnimation object.
/// </summary>
class SHRawAnimInspector final : public SHEditorWindow
{
public:
/*---------------------------------------------------------------------------------*/
/* Constructors/Destructors */
/*---------------------------------------------------------------------------------*/
SHRawAnimInspector();
~SHRawAnimInspector() = default;
/*---------------------------------------------------------------------------------*/
/* Lifecycle Functions */
/*---------------------------------------------------------------------------------*/
void Init() override;
void Update() override;
void Exit() override;
/*---------------------------------------------------------------------------------*/
/* Usage Functions */
/*---------------------------------------------------------------------------------*/
void Open(AssetID assetId);
private:
/*---------------------------------------------------------------------------------*/
/* Data Members */
/*---------------------------------------------------------------------------------*/
Handle<SHRawAnimation> currRawAnim;
/*---------------------------------------------------------------------------------*/
/* Helper Functions */
/*---------------------------------------------------------------------------------*/
void drawMenuBar();
};
}

View File

@ -9,3 +9,4 @@
#include "ColliderTagPanel/SHColliderTagPanel.h" // Collider Tag Panel #include "ColliderTagPanel/SHColliderTagPanel.h" // Collider Tag Panel
#include "InputBindings/SHInputBindingsPanel.h" // Input Bindings #include "InputBindings/SHInputBindingsPanel.h" // Input Bindings
#include "EditorWindow/Animation/SHAnimationControllerEditor.h" // Animation Controller Editor #include "EditorWindow/Animation/SHAnimationControllerEditor.h" // Animation Controller Editor
#include "EditorWindow/RawAnimationInspector/SHRawAnimInspector.h" // Raw Animation Inspector

View File

@ -118,6 +118,7 @@ namespace SHADE
SHEditorWindowManager::CreateEditorWindow<SHEditorViewport>(); SHEditorWindowManager::CreateEditorWindow<SHEditorViewport>();
SHEditorWindowManager::CreateEditorWindow<SHAnimationControllerEditor>(); SHEditorWindowManager::CreateEditorWindow<SHAnimationControllerEditor>();
SHEditorWindowManager::CreateEditorWindow<SHRawAnimInspector>();
//Add popup windows //Add popup windows
SHEditorWindowManager::CreatePopupWindow<SHSceneSavePrompt>(); SHEditorWindowManager::CreatePopupWindow<SHSceneSavePrompt>();

View File

@ -262,7 +262,7 @@ namespace SHADE
copyRegions[i].imageSubresource.baseArrayLayer = 0; // TODO: Array textures not supported yet copyRegions[i].imageSubresource.baseArrayLayer = 0; // TODO: Array textures not supported yet
copyRegions[i].imageSubresource.layerCount = layerCount; copyRegions[i].imageSubresource.layerCount = layerCount;
copyRegions[i].imageOffset = vk::Offset3D{ 0,0,0 }; copyRegions[i].imageOffset = vk::Offset3D{ 0,0,0 };
copyRegions[i].imageExtent = vk::Extent3D{ width >> i, height >> i, 1 }; copyRegions[i].imageExtent = vk::Extent3D{ std::max (1u, width >> i), std::max (1u, height >> i), 1 };
} }
cmdBufferHdl->CopyBufferToImage(stagingBuffer, vkImage, copyRegions); cmdBufferHdl->CopyBufferToImage(stagingBuffer, vkImage, copyRegions);

View File

@ -130,7 +130,7 @@ namespace SHADE
static constexpr std::string_view GBUFFER_WRITE_VFX_SUBPASS = "G-Buffer Write With VFX"; static constexpr std::string_view GBUFFER_WRITE_VFX_SUBPASS = "G-Buffer Write With VFX";
static constexpr std::string_view UI_SUBPASS = "UI"; static constexpr std::string_view UI_SUBPASS = "UI";
static constexpr std::string_view UI_TRANSLUCENT_SUBPASS = "UI Translucent"; static constexpr std::string_view UI_TRANSLUCENT_SUBPASS = "UI Translucent";
static constexpr std::string_view VFX_SUBPASS = "VFX"; static constexpr std::string_view VFX_SUBPASS = "VFX Subpass";
static constexpr std::string_view OBJ_VFX_SUBPASS = "Object VFX Subpass No Depth"; static constexpr std::string_view OBJ_VFX_SUBPASS = "Object VFX Subpass No Depth";
static constexpr std::array USABLE_SUBPASSES = static constexpr std::array USABLE_SUBPASSES =
@ -362,6 +362,7 @@ namespace SHADE
*/ */
/***************************************************************************/ /***************************************************************************/
static constexpr uint32_t TRAJECTORY_COLOR = 2; static constexpr uint32_t TRAJECTORY_COLOR = 2;
static constexpr uint32_t TRAJECTORY_TRANSFORM = 3;
static constexpr uint32_t CALCULATED_GLYPH_POSITION = 0; static constexpr uint32_t CALCULATED_GLYPH_POSITION = 0;
static constexpr uint32_t GLYPH_INDEX = 1; static constexpr uint32_t GLYPH_INDEX = 1;

View File

@ -337,7 +337,7 @@ namespace SHADE
/* VFX PASS */ /* VFX PASS */
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
auto vfxPass = renderGraph->AddNode(SHGraphicsConstants::RenderGraphEntityNames::VFX_PASS.data(), { "Scene", "Depth Buffer" }, { SHGraphicsConstants::RenderGraphEntityNames::GBUFFER_PASS.data(), SHGraphicsConstants::RenderGraphEntityNames::DEFERRED_COMPOSITE_PASS.data() }); auto vfxPass = renderGraph->AddNode(SHGraphicsConstants::RenderGraphEntityNames::VFX_PASS.data(), { "Scene", "Depth Buffer" }, { SHGraphicsConstants::RenderGraphEntityNames::GBUFFER_PASS.data(), SHGraphicsConstants::RenderGraphEntityNames::DEFERRED_COMPOSITE_PASS.data() });
auto vfxSubpass = vfxPass->AddSubpass("Vfx Subpass", worldViewport, worldRenderer); auto vfxSubpass = vfxPass->AddSubpass(SHGraphicsConstants::RenderGraphEntityNames::VFX_SUBPASS.data(), worldViewport, worldRenderer);
vfxSubpass->AddColorOutput("Scene"); vfxSubpass->AddColorOutput("Scene");
vfxSubpass->AddDepthOutput("Depth Buffer"); vfxSubpass->AddDepthOutput("Depth Buffer");
vfxSubpass->AddExteriorDrawCalls([=](Handle<SHVkCommandBuffer> cmdBuffer, Handle<SHRenderer> renderer, uint32_t frameIndex) vfxSubpass->AddExteriorDrawCalls([=](Handle<SHVkCommandBuffer> cmdBuffer, Handle<SHRenderer> renderer, uint32_t frameIndex)
@ -485,8 +485,8 @@ namespace SHADE
trajectoryRenderingSubSystem = resourceManager.Create<SHTrajectoryRenderingSubSystem>(); trajectoryRenderingSubSystem = resourceManager.Create<SHTrajectoryRenderingSubSystem>();
auto vfxNode = renderGraph->GetNode(SHGraphicsConstants::RenderGraphEntityNames::SCREEN_SPACE_PASS.data()); auto vfxNode = renderGraph->GetNode(SHGraphicsConstants::RenderGraphEntityNames::VFX_PASS.data());
trajectoryRenderingSubSystem->Init(device, vfxNode->GetRenderpass(), vfxNode->GetSubpass(SHGraphicsConstants::RenderGraphEntityNames::UI_SUBPASS), trajectoryVS, trajectoryFS); trajectoryRenderingSubSystem->Init(device, vfxNode->GetRenderpass(), vfxNode->GetSubpass(SHGraphicsConstants::RenderGraphEntityNames::VFX_SUBPASS), trajectoryVS, trajectoryFS);
SHGlobalDescriptorSets::SetLightingSubSystem(lightingSubSystem); SHGlobalDescriptorSets::SetLightingSubSystem(lightingSubSystem);

View File

@ -29,6 +29,8 @@ namespace SHADE
// Default white color. // Default white color.
color = SHColour::WHITE; color = SHColour::WHITE;
textSize = SHVec3::One;
} }
void SHTextRenderableComponent::OnDestroy(void) void SHTextRenderableComponent::OnDestroy(void)
@ -66,6 +68,11 @@ namespace SHADE
color = newColor; color = newColor;
} }
void SHTextRenderableComponent::SetTextSize(SHVec3 const& size) noexcept
{
textSize = size;
}
/***************************************************************************/ /***************************************************************************/
/*! /*!
@ -92,6 +99,11 @@ namespace SHADE
return color; return color;
} }
SHVec3 const& SHTextRenderableComponent::GetTextSize(void) const noexcept
{
return textSize;
}
} }
namespace rttr namespace rttr

View File

@ -40,6 +40,9 @@ namespace SHADE
//! character position data for each letter in the text //! character position data for each letter in the text
Handle<SHVkBuffer> charPositionDataBuffer; Handle<SHVkBuffer> charPositionDataBuffer;
//! Text size. Multiplied to TRS.
SHVec3 textSize;
void MakeDirty (void) noexcept; void MakeDirty (void) noexcept;
void Clean (void) noexcept; void Clean (void) noexcept;
@ -53,10 +56,12 @@ namespace SHADE
void SetText (std::string_view newText) noexcept; void SetText (std::string_view newText) noexcept;
void SetFont(Handle<SHFont> font) noexcept; void SetFont(Handle<SHFont> font) noexcept;
void SetColor(SHColour const& newColor) noexcept; void SetColor(SHColour const& newColor) noexcept;
void SetTextSize (SHVec3 const& size) noexcept;
std::string const& GetText (void) const noexcept; std::string const& GetText (void) const noexcept;
Handle<SHFont> GetFont (void) const noexcept; Handle<SHFont> GetFont (void) const noexcept;
SHColour const& GetColor (void) const noexcept; SHColour const& GetColor (void) const noexcept;
SHVec3 const& GetTextSize (void) const noexcept;
friend class SHTextRenderingSubSystem; friend class SHTextRenderingSubSystem;

View File

@ -210,10 +210,13 @@ namespace SHADE
cmdBuffer->BindVertexBuffer(SHGraphicsConstants::VertexBufferBindings::CALCULATED_GLYPH_POSITION, comp.charPositionDataBuffer, 0); cmdBuffer->BindVertexBuffer(SHGraphicsConstants::VertexBufferBindings::CALCULATED_GLYPH_POSITION, comp.charPositionDataBuffer, 0);
cmdBuffer->BindVertexBuffer(SHGraphicsConstants::VertexBufferBindings::GLYPH_INDEX, comp.indexingDataBuffer, 0); cmdBuffer->BindVertexBuffer(SHGraphicsConstants::VertexBufferBindings::GLYPH_INDEX, comp.indexingDataBuffer, 0);
auto const& textSize = comp.textSize;
SHMatrix textSizeScale{textSize.x, 0.0f, 0.0f, 0.0f, 0.0f, textSize.y, 0.0f, 0.0f, 0.0f, 0.0f, textSize.z, 0.0f};
if (auto* uiComp = SHComponentManager::GetComponent_s<SHUIComponent>(comp.GetEID())) if (auto* uiComp = SHComponentManager::GetComponent_s<SHUIComponent>(comp.GetEID()))
cmdBuffer->SetPushConstantVariable("TestPushConstant.worldTransform", uiComp->GetMatrix(), SH_PIPELINE_TYPE::GRAPHICS); cmdBuffer->SetPushConstantVariable("TestPushConstant.worldTransform", textSizeScale * uiComp->GetMatrix(), SH_PIPELINE_TYPE::GRAPHICS);
else else
cmdBuffer->SetPushConstantVariable("TestPushConstant.worldTransform", transform->GetTRS(), SH_PIPELINE_TYPE::GRAPHICS); cmdBuffer->SetPushConstantVariable("TestPushConstant.worldTransform", textSizeScale * transform->GetTRS(), SH_PIPELINE_TYPE::GRAPHICS);
cmdBuffer->SetPushConstantVariable("TestPushConstant.eid", comp.GetEID(), SH_PIPELINE_TYPE::GRAPHICS); cmdBuffer->SetPushConstantVariable("TestPushConstant.eid", comp.GetEID(), SH_PIPELINE_TYPE::GRAPHICS);

View File

@ -68,6 +68,8 @@ namespace SHADE
} }
pipeline->GetPipelineState().SetColorBlenState(colorBlendState); pipeline->GetPipelineState().SetColorBlenState(colorBlendState);
pipeline->ConstructPipeline();
} }
void SHTrajectoryRenderingSubSystem::Run(uint32_t frameIndex) noexcept void SHTrajectoryRenderingSubSystem::Run(uint32_t frameIndex) noexcept
@ -75,12 +77,16 @@ namespace SHADE
auto& comps = SHComponentManager::GetDense<SHTrajectoryRenderableComponent>(); auto& comps = SHComponentManager::GetDense<SHTrajectoryRenderableComponent>();
for (auto& comp : comps) for (auto& comp : comps)
{ {
comp.SetPositions(std::vector //std::vector<SHVec3> test{};
{ //test.resize(10);
SHVec3 {}, //float x = 0.0f;
SHVec3 {} //for (auto& vec : test)
}); //{
// vec = SHVec3(x, 5.0f, 0.0f);
// x += 0.5f;
//}
//comp.SetPositions (test);
// If has positions, feed data to buffer. // If has positions, feed data to buffer.
if (comp.HasPositions()) if (comp.HasPositions())
{ {
@ -122,12 +128,13 @@ namespace SHADE
transformData.push_back(trs); transformData.push_back(trs);
colorData.push_back(currentColor); colorData.push_back(currentColor);
// evolve lerp value and clamp to 1
lerpValue = std::min (1.0f, lerpValue + colorEvolveRate);
// evolve color // evolve color
currentColor = SHVec3::Lerp(startColor, endColor, lerpValue); currentColor = SHVec3::Lerp(startColor, endColor, lerpValue);
currentColor.w = SHMath::Lerp (comp.GetStartAlpha(), comp.GetEndAlpha(), lerpValue); currentColor.w = SHMath::Lerp (comp.GetStartAlpha(), comp.GetEndAlpha(), lerpValue);
// evolve lerp value and clamp to 1
lerpValue = std::max (1.0f, lerpValue + colorEvolveRate);
} }
// add draw data for this trajectory // add draw data for this trajectory
@ -178,6 +185,9 @@ namespace SHADE
// Bind color vertex buffer // Bind color vertex buffer
cmdBuffer->BindVertexBuffer(SHGraphicsConstants::VertexBufferBindings::TRAJECTORY_COLOR, colorBuffer, 0); cmdBuffer->BindVertexBuffer(SHGraphicsConstants::VertexBufferBindings::TRAJECTORY_COLOR, colorBuffer, 0);
// Bind transform data
cmdBuffer->BindVertexBuffer(SHGraphicsConstants::VertexBufferBindings::TRAJECTORY_TRANSFORM, transformBuffer, 0);
// call draw call // call draw call
cmdBuffer->DrawMultiIndirect(drawDataBuffer, drawData.size()); cmdBuffer->DrawMultiIndirect(drawDataBuffer, drawData.size());

View File

@ -247,6 +247,7 @@ namespace SHADE
AddComponentToComponentNode<SHAnimatorComponent>(components, eid); AddComponentToComponentNode<SHAnimatorComponent>(components, eid);
AddComponentToComponentNode<SHUIComponent>(components, eid); AddComponentToComponentNode<SHUIComponent>(components, eid);
AddComponentToComponentNode<SHAudioListenerComponent>(components, eid); AddComponentToComponentNode<SHAudioListenerComponent>(components, eid);
AddComponentToComponentNode<SHTrajectoryRenderableComponent>(components, eid);
node[ComponentsNode] = components; node[ComponentsNode] = components;
@ -308,6 +309,7 @@ namespace SHADE
AddComponentID<SHAnimatorComponent>(componentIDList, componentsNode); AddComponentID<SHAnimatorComponent>(componentIDList, componentsNode);
AddComponentID<SHUIComponent>(componentIDList, componentsNode); AddComponentID<SHUIComponent>(componentIDList, componentsNode);
AddComponentID<SHAudioListenerComponent>(componentIDList, componentsNode); AddComponentID<SHAudioListenerComponent>(componentIDList, componentsNode);
AddComponentID<SHTrajectoryRenderableComponent>(componentIDList, componentsNode);
return componentIDList; return componentIDList;
} }
@ -395,5 +397,6 @@ namespace SHADE
SHSerializationHelper::InitializeComponentFromNode<SHAnimatorComponent>(componentsNode, eid); SHSerializationHelper::InitializeComponentFromNode<SHAnimatorComponent>(componentsNode, eid);
SHSerializationHelper::InitializeComponentFromNode<SHUIComponent>(componentsNode, eid); SHSerializationHelper::InitializeComponentFromNode<SHUIComponent>(componentsNode, eid);
SHSerializationHelper::InitializeComponentFromNode<SHAudioListenerComponent>(componentsNode, eid); SHSerializationHelper::InitializeComponentFromNode<SHAudioListenerComponent>(componentsNode, eid);
SHSerializationHelper::InitializeComponentFromNode<SHTrajectoryRenderableComponent>(componentsNode, eid);
} }
} }

View File

@ -207,10 +207,10 @@ namespace SHADE
if constexpr (YAML::HasYAMLConv<ComponentType>()) if constexpr (YAML::HasYAMLConv<ComponentType>())
{ {
auto component = SHComponentManager::GetComponent_s<ComponentType>(eid); auto component = SHComponentManager::GetComponent_s<ComponentType>(eid);
if (componentsNode.IsNull() || !component) if (!component)
return false; return false;
auto componentNode = GetComponentNode<ComponentType>(componentsNode, eid); auto componentNode = GetComponentNode<ComponentType>(componentsNode, eid);
if (componentNode.IsNull() || !componentNode.IsDefined()) if (!componentNode.IsDefined())
return false; return false;
if (componentNode[IsActive.data()].IsDefined()) if (componentNode[IsActive.data()].IsDefined())
component->isActive = componentNode[IsActive.data()].as<bool>(); component->isActive = componentNode[IsActive.data()].as<bool>();
@ -220,7 +220,7 @@ namespace SHADE
else else
{ {
ComponentType* component = SHComponentManager::GetComponent_s<ComponentType>(eid); ComponentType* component = SHComponentManager::GetComponent_s<ComponentType>(eid);
if (componentsNode.IsNull() && !component) if (!component)
return false; return false;
auto rttrType = rttr::type::get<ComponentType>(); auto rttrType = rttr::type::get<ComponentType>();
auto componentNode = componentsNode[rttrType.get_name().data()]; auto componentNode = componentsNode[rttrType.get_name().data()];

View File

@ -32,6 +32,8 @@ namespace YAML
struct HasYAMLConv<SHTextRenderableComponent> : std::true_type {}; struct HasYAMLConv<SHTextRenderableComponent> : std::true_type {};
template<> template<>
struct HasYAMLConv<SHAnimatorComponent> : std::true_type {}; struct HasYAMLConv<SHAnimatorComponent> : std::true_type {};
template<>
struct HasYAMLConv<SHTrajectoryRenderableComponent> : std::true_type {};
template<> template<>
struct convert<SHVec4> struct convert<SHVec4>
@ -355,6 +357,7 @@ namespace YAML
static constexpr std::string_view TEXT_YAML_TAG = "Text"; static constexpr std::string_view TEXT_YAML_TAG = "Text";
static constexpr std::string_view FONT_YAML_TAG = "Font"; static constexpr std::string_view FONT_YAML_TAG = "Font";
static constexpr std::string_view COLOR_YAML_TAG = "Color"; static constexpr std::string_view COLOR_YAML_TAG = "Color";
static constexpr std::string_view TEXT_SIZE_YAML_TAG = "Text Size";
static YAML::Node encode(SHTextRenderableComponent const& rhs) static YAML::Node encode(SHTextRenderableComponent const& rhs)
{ {
@ -370,7 +373,8 @@ namespace YAML
{ {
node[FONT_YAML_TAG.data()] = 0; node[FONT_YAML_TAG.data()] = 0;
} }
node[COLOR_YAML_TAG.data()] = SHVec4 (textColor); node[COLOR_YAML_TAG.data()] = SHVec4(textColor);
node[TEXT_SIZE_YAML_TAG.data()] = rhs.GetTextSize();
return node; return node;
} }
static bool decode(YAML::Node const& node, SHTextRenderableComponent& rhs) static bool decode(YAML::Node const& node, SHTextRenderableComponent& rhs)
@ -393,6 +397,10 @@ namespace YAML
{ {
rhs.SetColor(node[COLOR_YAML_TAG.data()].as<SHVec4>()); rhs.SetColor(node[COLOR_YAML_TAG.data()].as<SHVec4>());
} }
if (node[TEXT_SIZE_YAML_TAG.data()].IsDefined())
{
rhs.SetTextSize(node[TEXT_SIZE_YAML_TAG.data()].as<SHVec3>());
}
return true; return true;
} }
}; };
@ -431,6 +439,8 @@ namespace YAML
static constexpr std::string_view MESH_YAML_TAG = "Mesh"; static constexpr std::string_view MESH_YAML_TAG = "Mesh";
static constexpr std::string_view START_COLOR_YAML_TAG = "Start Color"; static constexpr std::string_view START_COLOR_YAML_TAG = "Start Color";
static constexpr std::string_view END_COLOR_YAML_TAG = "End Color"; static constexpr std::string_view END_COLOR_YAML_TAG = "End Color";
static constexpr std::string_view START_ALPHA_YAML_TAG = "Start Alpha";
static constexpr std::string_view END_ALPHA_YAML_TAG = "End Alpha";
static constexpr std::string_view COLOR_EVAL_RATE_YAML_TAG = "Color Eval Rate "; static constexpr std::string_view COLOR_EVAL_RATE_YAML_TAG = "Color Eval Rate ";
static YAML::Node encode(SHTrajectoryRenderableComponent const& rhs) static YAML::Node encode(SHTrajectoryRenderableComponent const& rhs)
@ -438,7 +448,9 @@ namespace YAML
YAML::Node node; YAML::Node node;
node[MESH_YAML_TAG.data()] = SHResourceManager::GetAssetID<SHMesh>(rhs.GetMesh()).value_or(0); node[MESH_YAML_TAG.data()] = SHResourceManager::GetAssetID<SHMesh>(rhs.GetMesh()).value_or(0);
node[START_COLOR_YAML_TAG.data()] = SHVec3(rhs.GetStartColor()); node[START_COLOR_YAML_TAG.data()] = SHVec3(rhs.GetStartColor());
node[START_ALPHA_YAML_TAG.data()] = rhs.GetStartAlpha();
node[END_COLOR_YAML_TAG.data()] = SHVec3(rhs.GetEndColor()); node[END_COLOR_YAML_TAG.data()] = SHVec3(rhs.GetEndColor());
node[END_ALPHA_YAML_TAG.data()] = rhs.GetEndAlpha();
node[COLOR_EVAL_RATE_YAML_TAG.data()] = rhs.GetColorEvolveRate(); node[COLOR_EVAL_RATE_YAML_TAG.data()] = rhs.GetColorEvolveRate();
return node; return node;
@ -447,10 +459,19 @@ namespace YAML
{ {
if (node[MESH_YAML_TAG.data()].IsDefined()) if (node[MESH_YAML_TAG.data()].IsDefined())
rhs.SetMesh(SHResourceManager::LoadOrGet<SHMesh>(node[MESH_YAML_TAG.data()].as<AssetID>())); rhs.SetMesh(SHResourceManager::LoadOrGet<SHMesh>(node[MESH_YAML_TAG.data()].as<AssetID>()));
if (node[START_COLOR_YAML_TAG.data()].IsDefined()) if (node[START_COLOR_YAML_TAG.data()].IsDefined())
rhs.SetStartColor(node[START_COLOR_YAML_TAG.data()].as<SHVec3>()); rhs.SetStartColor(node[START_COLOR_YAML_TAG.data()].as<SHVec3>());
if (node[START_ALPHA_YAML_TAG.data()].IsDefined())
rhs.SetStartAlpha(node[START_ALPHA_YAML_TAG.data()].as<float>());
if (node[END_COLOR_YAML_TAG.data()].IsDefined()) if (node[END_COLOR_YAML_TAG.data()].IsDefined())
rhs.SetEndColor(node[END_COLOR_YAML_TAG.data()].as<SHVec3>()); rhs.SetEndColor(node[END_COLOR_YAML_TAG.data()].as<SHVec3>());
if (node[END_ALPHA_YAML_TAG.data()].IsDefined())
rhs.SetEndAlpha(node[END_ALPHA_YAML_TAG.data()].as<float>());
if (node[COLOR_EVAL_RATE_YAML_TAG.data()].IsDefined()) if (node[COLOR_EVAL_RATE_YAML_TAG.data()].IsDefined())
rhs.SetColorEvolveRate(node[COLOR_EVAL_RATE_YAML_TAG.data()].as<float>()); rhs.SetColorEvolveRate(node[COLOR_EVAL_RATE_YAML_TAG.data()].as<float>());