diff --git a/Assets/Audio/Master.bank b/Assets/Audio/Master.bank index 21c524fe..49135fbc 100644 Binary files a/Assets/Audio/Master.bank and b/Assets/Audio/Master.bank differ diff --git a/Assets/Audio/Master.strings.bank b/Assets/Audio/Master.strings.bank index 3992afa1..b769c07f 100644 Binary files a/Assets/Audio/Master.strings.bank and b/Assets/Audio/Master.strings.bank differ diff --git a/Assets/Audio/Music.bank b/Assets/Audio/Music.bank index a7a856e5..41112f65 100644 Binary files a/Assets/Audio/Music.bank and b/Assets/Audio/Music.bank differ diff --git a/Assets/Audio/SFX.bank b/Assets/Audio/SFX.bank index d1c9cf58..acf5260a 100644 Binary files a/Assets/Audio/SFX.bank and b/Assets/Audio/SFX.bank differ diff --git a/Assets/Materials/UI/UIMat_Black.shmat b/Assets/Materials/UI/UIMat_Black.shmat index 183b5f26..8451828f 100644 --- a/Assets/Materials/UI/UIMat_Black.shmat +++ b/Assets/Materials/UI/UIMat_Black.shmat @@ -1,6 +1,6 @@ - VertexShader: 46580970 FragmentShader: 50110174 - SubPass: UI + SubPass: UI Translucent Properties: data.color: {x: 0, y: 0, z: 0, w: 1} data.textureIndex: 0 diff --git a/Assets/Scenes/Level1.shade b/Assets/Scenes/Level1.shade index 3aca2ae6..cd5ba82e 100644 --- a/Assets/Scenes/Level1.shade +++ b/Assets/Scenes/Level1.shade @@ -521,47 +521,11 @@ - Is Trigger: false Collision Tag: 0 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 Bounciness: 0 Density: 1 - Position Offset: {x: 0, y: 0.0299999993, 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} + Position Offset: {x: 0, y: 1, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} IsActive: true Scripts: ~ @@ -584,47 +548,11 @@ - Is Trigger: false Collision Tag: 0 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 Bounciness: 0 Density: 1 - Position Offset: {x: 0, y: 0.0299999993, 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} + Position Offset: {x: 0, y: 1, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} IsActive: true Scripts: ~ @@ -647,47 +575,11 @@ - Is Trigger: false Collision Tag: 0 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 Bounciness: 0 Density: 1 - Position Offset: {x: 0, y: 0.0299999993, 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} + Position Offset: {x: 0, y: 1, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} IsActive: true Scripts: ~ @@ -836,47 +728,11 @@ - Is Trigger: false Collision Tag: 0 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 Bounciness: 0 Density: 1 - Position Offset: {x: 0, y: 0.0299999993, 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} + Position Offset: {x: 0, y: 1, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} IsActive: true Scripts: ~ @@ -962,47 +818,11 @@ - Is Trigger: false Collision Tag: 0 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 Bounciness: 0 Density: 1 - Position Offset: {x: 0, y: 0.0299999993, 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} + Position Offset: {x: 0, y: 1, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} IsActive: true Scripts: ~ @@ -2583,7 +2403,7 @@ Components: Transform Component: 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} IsActive: true Renderable Component: @@ -4293,13 +4113,14 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: -800, y: 400, z: 0} + Translate: {x: -800, y: 400, z: 0.100000001} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 60, y: 60, z: 60} IsActive: true Text Renderer Component: - Text: My name is Brandon. + Text: "Score: 0" Font: 176667660 + Color: {x: 1, y: 1, z: 1, w: 1} IsActive: true Scripts: ~ - EID: 206 @@ -4308,13 +4129,14 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 500, y: 400, z: 0} + Translate: {x: 500, y: 400, z: 0.100000001} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 60, y: 60, z: 60} IsActive: true Text Renderer Component: - Text: My name is Brandon. + Text: "Time Left: 200" Font: 176667660 + Color: {x: 1, y: 1, z: 1, w: 1} IsActive: true Scripts: ~ - EID: 238 @@ -4323,13 +4145,14 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: -800, y: 300, z: 0} + Translate: {x: -800, y: 300, z: 0.100000001} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 60, y: 60, z: 60} IsActive: true Text Renderer Component: - Text: TEST + Text: "" Font: 176667660 + Color: {x: 1, y: 1, z: 1, w: 1} IsActive: true Scripts: ~ - EID: 236 @@ -4343,7 +4166,7 @@ winScene: 86098106 loseScene: 91685359 currGameState: 0 - totalItemCount: 0 + totalItemCount: 4 Score: 0 timer: 200 scoreText: 237 @@ -4352,14 +4175,20 @@ maxMultiplierDuration: 5 maxMultiplierCombo: 10 multiplierFont: 60 + - Type: PauseMenu + Enabled: true + resumeBtn: 457 + retryBtn: 455 + quitBtn: 456 + canvas: 458 - EID: 235 Name: ====AI===== IsActive: true NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 0.406909943, y: 0.100000001, z: -2} - Rotate: {x: -0, y: 0, z: -0} + Translate: {x: 2.13981342, y: 0.0490087792, z: -1.96055627} + Rotate: {x: 0, y: -1.53675354, z: 0} Scale: {x: 1, y: 1, z: 1} IsActive: true Renderable Component: @@ -4385,7 +4214,7 @@ - Is Trigger: false Collision Tag: 5 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 Bounciness: 0 Density: 1 @@ -4466,8 +4295,8 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 3.71994686, y: 1.14058578, z: -9.35119247} - Rotate: {x: -0, y: 0, z: -0} + Translate: {x: 3.71994758, y: 1.0997268, z: -9.35119152} + Rotate: {x: 4.18975469e-06, y: -1.08915871e-11, z: -5.03928231e-06} Scale: {x: 1, y: 1, z: 1} IsActive: true Renderable Component: @@ -4509,7 +4338,7 @@ dontReturn: false soundDistance: 10 highlightSpeed: 200 - highlightThickness: 600 + highlightThickness: 120 highlightLowerClamp: 0.25 - EID: 227 Name: Mesh_Cheese @@ -4517,8 +4346,8 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 3.22328258, y: 1.08429813, z: -0.57395637} - Rotate: {x: -0, y: 0, z: -0} + Translate: {x: 3.22328258, y: 1.02709854, z: -0.57395637} + Rotate: {x: 5.62993963e-09, y: -7.03049191e-17, z: -1.92319405e-08} Scale: {x: 1, y: 1, z: 1} IsActive: true Renderable Component: @@ -4530,7 +4359,7 @@ Drag: 0.00999999978 Angular Drag: 0.100000001 Use Gravity: true - Interpolate: true + Interpolate: false Sleeping Enabled: true Freeze Position X: false Freeze Position Y: false @@ -4560,7 +4389,7 @@ dontReturn: false soundDistance: 10 highlightSpeed: 200 - highlightThickness: 600 + highlightThickness: 50 highlightLowerClamp: 0.25 - EID: 65778 Name: Mesh_Apple @@ -4568,8 +4397,8 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: -2.5, y: 0.778462529, z: -5} - Rotate: {x: -0, y: 0, z: -0} + Translate: {x: -2.50000072, y: 0.799999774, z: -5.00000095} + Rotate: {x: -4.09249949e-08, y: 1.40052995e-13, z: 2.95086267e-08} Scale: {x: 1, y: 1, z: 1} IsActive: true Renderable Component: @@ -4581,7 +4410,7 @@ Drag: 0.00999999978 Angular Drag: 0.100000001 Use Gravity: true - Interpolate: true + Interpolate: false Sleeping Enabled: true Freeze Position X: false Freeze Position Y: false @@ -4611,7 +4440,7 @@ dontReturn: false soundDistance: 10 highlightSpeed: 200 - highlightThickness: 600 + highlightThickness: 60 highlightLowerClamp: 0.25 - EID: 216 Name: Mesh_Apple @@ -4619,8 +4448,8 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: -2.5, y: 0.778462529, z: -4.28408813} - Rotate: {x: -0, y: 0, z: -0} + Translate: {x: -2.50000072, y: 0.799999893, z: -4.28408909} + Rotate: {x: -5.83341553e-08, y: 7.48974247e-14, z: 1.10461471e-08} Scale: {x: 1, y: 1, z: 1} IsActive: true Renderable Component: @@ -4632,7 +4461,7 @@ Drag: 0.00999999978 Angular Drag: 0.100000001 Use Gravity: true - Interpolate: true + Interpolate: false Sleeping Enabled: true Freeze Position X: false Freeze Position Y: false @@ -4662,7 +4491,7 @@ dontReturn: false soundDistance: 10 highlightSpeed: 200 - highlightThickness: 600 + highlightThickness: 60 highlightLowerClamp: 0.25 - EID: 229 Name: ====ScoreZonePool==== @@ -4677,7 +4506,7 @@ Components: Transform Component: 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} IsActive: true RigidBody Component: @@ -4739,7 +4568,7 @@ Components: Transform Component: 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} IsActive: true RigidBody Component: @@ -4800,8 +4629,8 @@ NumberOfChildren: 1 Components: Transform Component: - Translate: {x: -5.47656059, y: 1.4327563, z: -2.44241929} - Rotate: {x: -0, y: 0, z: -0} + Translate: {x: -5.47656107, y: 1.4327563, z: -2.44241929} + Rotate: {x: -0, y: 0, z: 0} Scale: {x: 1, y: 1, z: 1} IsActive: true RigidBody Component: @@ -4863,7 +4692,7 @@ Components: Transform Component: 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} IsActive: true RigidBody Component: @@ -4925,7 +4754,7 @@ Components: Transform Component: 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} IsActive: true RigidBody Component: @@ -5075,7 +4904,7 @@ Components: Transform Component: 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} IsActive: true Renderable Component: @@ -5090,7 +4919,7 @@ Interpolate: false Sleeping Enabled: true Freeze Position X: false - Freeze Position Y: true + Freeze Position Y: false Freeze Position Z: false Freeze Rotation X: true Freeze Rotation Y: true @@ -5120,23 +4949,27 @@ maxJumpHeight: 2 maxJumpTime: 0.75 fallMultipler: 3 - jumpPadMultiplayer: 2 - lightMultiper: 0.75 - mediumMultiper: 0.5 - heavyMultiper: 0.25 + jumpPadMultiplayer: 1.20000005 + lightMultiper: 0.899999976 + mediumMultiper: 0.699999988 + heavyMultiper: 0.5 + silhouettePlayer: 462 + silhouetteBag: 465 - Type: PickAndThrow Enabled: true throwForce: [8, 10, 8] - cameraArmOffSet: [0, 0.25, 0] + cameraArmOffSet: [0.25, 0.600000024, 0.200000003] delayTimer: 1 - aimingLength: 0.899999976 + aimingLength: 1 throwItem: false - silhouettePlayer: 462 - silhouetteBag: 465 - rayDistance: 0.5 + rayDistance: 0.75 rayHeight: 0.100000001 aimingFOV: 50 defaultFOV: 45 + - Type: StateMachine + Enabled: true + currentStateName: Idle State + currentAnimName: "" - EID: 65733 Name: HoldingPoint IsActive: true @@ -5155,36 +4988,36 @@ Components: Transform Component: 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} IsActive: true Camera Component: - Position: {x: 2.12735963, y: 0.362327784, z: 7.98933029} - Pitch: 0 - Yaw: 360 + Position: {x: -8.9091711, y: 2.05214882, z: -4} + Pitch: -9.93032837 + Yaw: 270 Roll: 1.28065994e-06 Width: 1920 Near: 0.00999999978 Far: 10000 Perspective: true - FOV: 90 + FOV: 45 IsActive: true Camera Arm Component: - Arm Pitch: 0 - Arm Yaw: 0 - Arm Length: 1 + Arm Pitch: 45 + Arm Yaw: -90 + Arm Length: 3 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 IsActive: true Scripts: - Type: SHADE_Scripting.ThirdPersonCamera Enabled: true - armLength: 2 - turnSpeedPitch: 0.300000012 - turnSpeedYaw: 0.5 - inverseXControls: true - inverseYControls: true + armLength: 3 + turnSpeedPitch: 0.200000003 + turnSpeedYaw: 0.400000006 + inverseXControls: false + inverseYControls: false pitchUpperClamp: 45 pitchLowerClamp: 5 - EID: 65731 @@ -5244,7 +5077,7 @@ IsActive: true Scripts: ~ - EID: 464 - Name: Canvas + Name: StealFoodCanvas IsActive: true NumberOfChildren: 1 Components: @@ -5277,7 +5110,7 @@ - Type: SHADE_Scripting.UI.StealFoodPopUp Enabled: true popInDuration: 0.5 - popOutDuration: 0.5 + popOutDuration: 0.075000003 stayDuration: 1 rotationAmt: 1800 scaleAmtX: 538 @@ -5291,6 +5124,192 @@ - Type: SHADE_Scripting.UI.TweenManager Enabled: true - 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 IsActive: true NumberOfChildren: 1 @@ -5301,22 +5320,22 @@ Scale by canvas width: false IsActive: true Scripts: ~ -- EID: 459 +- EID: 65982 Name: Transition IsActive: true NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 0, y: 0, z: 0} + Translate: {x: 0, y: 0, z: 0.100000001} Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 1920, y: 1080, z: 1} + Scale: {x: 2500, y: 1080, z: 1} IsActive: true Renderable Component: Mesh: 141771688 Material: 120016136 IsActive: true UI Component: - Canvas ID: 461 + Canvas ID: 450 Hovered: false Clicked: false IsActive: true diff --git a/Assets/Scenes/Level2.shade b/Assets/Scenes/Level2.shade index 948964e3..78a9c37f 100644 --- a/Assets/Scenes/Level2.shade +++ b/Assets/Scenes/Level2.shade @@ -59,7 +59,7 @@ - EID: 240 Name: ====ItemPool==== IsActive: true - NumberOfChildren: 31 + NumberOfChildren: 35 Components: ~ Scripts: ~ - EID: 241 @@ -164,57 +164,6 @@ highlightSpeed: 300 highlightThickness: 250 highlightLowerClamp: 0.25 -- EID: 156 - Name: Mesh_Meat - IsActive: true - NumberOfChildren: 0 - Components: - Transform Component: - Translate: {x: 0.461924851, y: 0.988175511, z: -0.383091867} - Rotate: {x: -0, y: 0, z: -0} - Scale: {x: 1, y: 1, z: 1} - IsActive: true - Renderable Component: - Mesh: 136892700 - Material: 122370915 - IsActive: true - RigidBody Component: - Type: Dynamic - Drag: 0.00999999978 - Angular Drag: 0.100000001 - Use Gravity: true - Interpolate: false - Sleeping Enabled: true - Freeze Position X: false - Freeze Position Y: false - Freeze Position Z: false - Freeze Rotation X: false - Freeze Rotation Y: false - Freeze Rotation Z: false - IsActive: true - Collider Component: - Colliders: - - Is Trigger: false - Collision Tag: 2 - Type: Box - Half Extents: {x: 0.300000012, y: 0.300000012, z: 0.300000012} - Friction: 0.400000006 - Bounciness: 0 - Density: 1 - Position Offset: {x: 0, y: 0, z: 0} - Rotation Offset: {x: 0, y: 0, z: 0} - IsActive: true - Scripts: - - Type: Item - Enabled: true - Score: 50 - currCategory: 1 - density: 1 - dontReturn: false - soundDistance: 10 - highlightSpeed: 300 - highlightThickness: 250 - highlightLowerClamp: 0.25 - EID: 155 Name: Mesh_Cheese IsActive: true @@ -476,8 +425,8 @@ NumberOfChildren: 4 Components: Transform Component: - Translate: {x: 3.11708331, y: 0.333341181, z: 6.14019775} - Rotate: {x: 0, y: 0, z: 0} + Translate: {x: 0.199520111, y: 1.25556076, z: 1.23466492} + Rotate: {x: -0, y: 0, z: -0} Scale: {x: 0.999979734, y: 1, z: 0.999979734} IsActive: true Renderable Component: @@ -1664,8 +1613,8 @@ NumberOfChildren: 5 Components: Transform Component: - Translate: {x: 1.65356398, y: 0.333341181, z: 5.9183445} - Rotate: {x: 0, y: 0, z: 0} + Translate: {x: -3.26610065, y: 1.34320831, z: 4.47019911} + Rotate: {x: -0, y: 0, z: -0} Scale: {x: 0.999979734, y: 1, z: 0.999979734} IsActive: true Renderable Component: @@ -2070,6 +2019,1283 @@ highlightSpeed: 300 highlightThickness: 250 highlightLowerClamp: 0.25 +- EID: 522 + Name: Watermelon + IsActive: true + NumberOfChildren: 5 + Components: + Transform Component: + Translate: {x: 1.62003577, y: 0.241820931, z: 5.90758133} + Rotate: {x: -0, y: 0, z: -0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + Renderable Component: + Mesh: 134305891 + Material: 122370915 + IsActive: true + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: false + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Sphere + Radius: 0.5 + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: + - Type: Breakable + Enabled: true + threshHold: 4 + ignoreRaccoon: true + - Type: Item + Enabled: true + Score: 500 + currCategory: 2 + density: 1 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 523 + Name: Piece1 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 144023586 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: true + Sleeping Enabled: false + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.400000006, y: 0.300000012, z: 0.300000012} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0.164060935, y: 0, z: 0} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 50 + currCategory: 1 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 525 + Name: Piece3 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.0350502729, y: -0.210244894, z: -0.0336794853} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 138231239 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.200000003, y: 0.0799999982, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.261799395} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 526 + Name: Piece4 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 135293480 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: true + Sleeping Enabled: false + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.200000003, y: 0.0500000007, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -1.04719758} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 527 + Name: Piece5 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.129600644, y: 0.219047099, z: 0.0484838486} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 146157335 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.25, y: 0.0500000007, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0.436332315} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 524 + Name: Piece2 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -1.62003577, y: -0.241820931, z: -5.90758133} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 142132679 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.300000012, y: 0.200000003, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.34906584} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 50 + currCategory: 1 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 131228 + Name: Watermelon + IsActive: true + NumberOfChildren: 5 + Components: + Transform Component: + Translate: {x: 0.623170555, y: 1.0488801, z: -0.65238905} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 0.999979734, y: 1, z: 0.999979734} + IsActive: true + Renderable Component: + Mesh: 134305891 + Material: 122370915 + IsActive: true + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Sphere + Radius: 0.5 + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: + - Type: Breakable + Enabled: true + threshHold: 4 + ignoreRaccoon: true + - Type: Item + Enabled: true + Score: 500 + currCategory: 2 + density: 1 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 66068 + Name: Piece1 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.0218036175, y: 5.38527966e-05, z: 0.202852726} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 144023586 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.400000006, y: 0.300000012, z: 0.300000012} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0.164060935, y: 0, z: 0} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 50 + currCategory: 1 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 66067 + Name: Piece2 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.0812162161, y: 0.0825212598, z: -0.0991339684} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 142132679 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.300000012, y: 0.200000003, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.34906584} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 50 + currCategory: 1 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 66066 + Name: Piece3 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.0350502729, y: -0.210244894, z: -0.0336794853} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 138231239 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.200000003, y: 0.0799999982, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.261799395} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 66065 + Name: Piece4 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.230162144, y: -0.0580062866, z: -0.00789308548} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 135293480 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.200000003, y: 0.0500000007, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -1.04719758} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 66064 + Name: Piece5 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.129600644, y: 0.219047099, z: 0.0484838486} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 146157335 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.25, y: 0.0500000007, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0.436332315} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 533 + Name: Egg + IsActive: true + NumberOfChildren: 4 + Components: + Transform Component: + Translate: {x: 3.11708331, y: 0.333341181, z: 6.14019775} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 0.999979734, y: 1, z: 0.999979734} + IsActive: true + Renderable Component: + Mesh: 147457317 + Material: 122370915 + IsActive: true + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Sphere + Radius: 0.200000003 + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: + - Type: Breakable + Enabled: true + threshHold: 0.5 + ignoreRaccoon: true + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 2 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 534 + Name: Piece1 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.0224030018, y: 0.0607728958, z: -0.00627422333} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 134900190 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0.164060935, y: 0, z: 0} + IsActive: false + Scripts: ~ +- EID: 535 + Name: Piece2 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.00627422333, y: 0.0337567925, z: -0.00243234634} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 146271645 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.34906584} + IsActive: false + Scripts: ~ +- EID: 536 + Name: Piece3 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.0166685581, y: -0.0367090404, z: 0.0114421844} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 135945648 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.261799395} + IsActive: false + Scripts: ~ +- EID: 537 + Name: Piece4 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.020128727, y: -0.0155199468, z: -0.0045747757} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 141722646 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -1.04719758} + IsActive: false + Scripts: ~ +- EID: 538 + Name: Egg + IsActive: true + NumberOfChildren: 4 + Components: + Transform Component: + Translate: {x: -0.272738755, y: 1.24863148, z: -4.62824583} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 0.999979734, y: 1, z: 0.999979734} + IsActive: true + Renderable Component: + Mesh: 147457317 + Material: 122370915 + IsActive: true + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Sphere + Radius: 0.200000003 + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: + - Type: Breakable + Enabled: true + threshHold: 0.5 + ignoreRaccoon: true + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 2 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 539 + Name: Piece1 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.0224030018, y: 0.0607728958, z: -0.00627422333} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 134900190 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0.164060935, y: 0, z: 0} + IsActive: false + Scripts: ~ +- EID: 540 + Name: Piece2 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.00627422333, y: 0.0337567925, z: -0.00243234634} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 146271645 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.34906584} + IsActive: false + Scripts: ~ +- EID: 541 + Name: Piece3 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.0166685581, y: -0.0367090404, z: 0.0114421844} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 135945648 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.261799395} + IsActive: false + Scripts: ~ +- EID: 542 + Name: Piece4 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.020128727, y: -0.0155199468, z: -0.0045747757} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 141722646 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -1.04719758} + IsActive: false + Scripts: ~ +- EID: 66079 + Name: Egg + IsActive: true + NumberOfChildren: 4 + Components: + Transform Component: + Translate: {x: -1.86591768, y: 0.84575963, z: -1.40127254} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 0.999979734, y: 1, z: 0.999979734} + IsActive: true + Renderable Component: + Mesh: 147457317 + Material: 122370915 + IsActive: true + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Sphere + Radius: 0.200000003 + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: + - Type: Breakable + Enabled: true + threshHold: 0.5 + ignoreRaccoon: true + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 2 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 66083 + Name: Piece1 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.0224030018, y: 0.0607728958, z: -0.00627422333} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 134900190 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0.164060935, y: 0, z: 0} + IsActive: false + Scripts: ~ +- EID: 66082 + Name: Piece2 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.00627422333, y: 0.0337567925, z: -0.00243234634} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 146271645 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.34906584} + IsActive: false + Scripts: ~ +- EID: 66081 + Name: Piece3 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.0166685581, y: -0.0367090404, z: 0.0114421844} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 135945648 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.261799395} + IsActive: false + Scripts: ~ +- EID: 66080 + Name: Piece4 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.020128727, y: -0.0155199468, z: -0.0045747757} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 141722646 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -1.04719758} + IsActive: false + Scripts: ~ - EID: 15 Name: ====ScoreZonePool==== IsActive: true @@ -2223,9 +3449,8 @@ - Type: PauseMenu Enabled: true resumeBtn: 8 - retryBtn: 461 + retryBtn: 459 quitBtn: 0 - gamePauseText: 11 canvas: 10 - EID: 199 Name: Gameplay Canvas @@ -2251,6 +3476,8 @@ Text Renderer Component: Text: My name is Brandon. Font: 174412429 + Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true UI Component: Canvas ID: 199 @@ -2258,7 +3485,7 @@ Clicked: false IsActive: true Scripts: ~ -- EID: 522 +- EID: 521 Name: Score BG IsActive: true NumberOfChildren: 0 @@ -2291,6 +3518,8 @@ Text Renderer Component: Text: My name is Brandon. Font: 174412429 + Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true UI Component: Canvas ID: 199 @@ -2298,7 +3527,7 @@ Clicked: false IsActive: true Scripts: ~ -- EID: 526 +- EID: 520 Name: Timer BG IsActive: true NumberOfChildren: 0 @@ -2331,6 +3560,8 @@ Text Renderer Component: Text: X2 Font: 174412429 + Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: true UI Component: Canvas ID: 199 @@ -2343,7 +3574,7 @@ maxSize: 1 minSize: 0.300000012 minAlpha: 0.300000012 -- EID: 523 +- EID: 519 Name: Multiplier BG IsActive: true NumberOfChildren: 0 @@ -2375,8 +3606,8 @@ NumberOfChildren: 5 Components: Transform Component: - Translate: {x: 2.35245037, y: 0.38365531, z: 7.10571432} - Rotate: {x: 0, y: 0.326376587, z: 0.0698131472} + Translate: {x: 2.35245037, y: 0.0613552481, z: 7.10571432} + Rotate: {x: -0, y: 3.14159274, z: -0} Scale: {x: 0.999999881, y: 1, z: 0.999999881} IsActive: true Renderable Component: @@ -2391,7 +3622,7 @@ Interpolate: false Sleeping Enabled: true Freeze Position X: false - Freeze Position Y: true + Freeze Position Y: false Freeze Position Z: false Freeze Rotation X: true Freeze Rotation Y: true @@ -2425,6 +3656,8 @@ lightMultiper: 0.899999976 mediumMultiper: 0.699999988 heavyMultiper: 0.5 + silhouettePlayer: 462 + silhouetteBag: 465 - Type: PickAndThrow Enabled: true throwForce: [10, 8, 10] @@ -2432,8 +3665,6 @@ delayTimer: 1 aimingLength: 1 throwItem: false - silhouettePlayer: 462 - silhouetteBag: 465 rayDistance: 0.75 rayHeight: 0.100000001 aimingFOV: 50 @@ -2456,7 +3687,7 @@ Components: Transform Component: Translate: {x: 0, y: -5.96046448e-08, z: 0} - Rotate: {x: 0, y: 5.95680904, z: -0.0698131248} + Rotate: {x: 0, y: 3.14159274, z: 2.23517329e-08} Scale: {x: 1, y: 1, z: 1} IsActive: true Camera Component: @@ -2464,14 +3695,14 @@ Pitch: 0 Yaw: 360 Roll: 1.28065994e-06 - Width: 1055 + Width: 1920 Near: 0.00999999978 Far: 10000 Perspective: true FOV: 45 IsActive: true Camera Arm Component: - Arm Pitch: 0 + Arm Pitch: 20 Arm Yaw: 0 Arm Length: 3 Look At Camera Origin: true @@ -4517,7 +5748,7 @@ Rotation Offset: {x: 0, y: 0, z: 0} IsActive: false Scripts: ~ -- EID: 519 +- EID: 461 Name: Piece2 IsActive: false NumberOfChildren: 0 @@ -4558,7 +5789,7 @@ Rotation Offset: {x: 0, y: 0, z: 0} IsActive: false Scripts: ~ -- EID: 520 +- EID: 460 Name: Piece3 IsActive: false NumberOfChildren: 0 @@ -4599,7 +5830,7 @@ Rotation Offset: {x: 0, y: 0, z: 0} IsActive: false Scripts: ~ -- EID: 521 +- EID: 459 Name: Piece4 IsActive: false NumberOfChildren: 0 @@ -4729,7 +5960,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 0, y: 0, z: -2.61272359} + Translate: {x: 0.0576689839, y: 0, z: -2.61272359} Rotate: {x: -0, y: 0, z: -0} Scale: {x: 1, y: 1, z: 1} IsActive: true @@ -4756,7 +5987,7 @@ - Is Trigger: false Collision Tag: 5 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 Bounciness: 0 Density: 1 @@ -4902,7 +6133,7 @@ Components: Transform Component: Translate: {x: 0, y: -300, z: 0} - Rotate: {x: 724.5, y: 424.5, z: 59.9999962} + Rotate: {x: -4.5, y: 2, z: -2.5} Scale: {x: 400, y: 100, z: 500} IsActive: true Renderable Component: @@ -4928,7 +6159,7 @@ onReleaseSound: event:/Music/player_undetected hoverScale: 1.10000002 clickScale: 0.899999976 -- EID: 461 +- EID: 458 Name: RetryButton IsActive: true NumberOfChildren: 0 @@ -4974,6 +6205,8 @@ Text Renderer Component: Text: Game Pause Font: 176667660 + Color: {x: 1, y: 1, z: 1, w: 1} + Text Size: {x: 1, y: 1, z: 1} IsActive: false UI Component: Canvas ID: 10 @@ -10703,7 +11936,7 @@ Rotation Offset: {x: 0, y: 0, z: 0} IsActive: true Scripts: ~ -- EID: 460 +- EID: 457 Name: Exterior IsActive: true NumberOfChildren: 5 @@ -13367,7 +14600,7 @@ Material: 131956078 IsActive: true Scripts: ~ -- EID: 457 +- EID: 174 Name: Exterior_Bush02 IsActive: true NumberOfChildren: 0 @@ -13382,7 +14615,7 @@ Material: 131956078 IsActive: true Scripts: ~ -- EID: 458 +- EID: 173 Name: Exterior_Bush01 IsActive: true NumberOfChildren: 0 @@ -13397,7 +14630,7 @@ Material: 131956078 IsActive: true Scripts: ~ -- EID: 459 +- EID: 172 Name: Exterior_Bush02 IsActive: true NumberOfChildren: 0 @@ -13412,43 +14645,7 @@ Material: 131956078 IsActive: true Scripts: ~ -- EID: 174 - Name: TransitionCanvas - IsActive: true - NumberOfChildren: 1 - Components: - Canvas Component: - Canvas Width: 1920 - Canvas Height: 1080 - Scale by canvas width: false - IsActive: true - Scripts: ~ -- EID: 173 - Name: Transition - IsActive: true - NumberOfChildren: 0 - Components: - Transform Component: - Translate: {x: 0, y: 0, z: 0} - Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 1920, y: 1080, z: 1} - IsActive: true - Renderable Component: - Mesh: 141771688 - Material: 120016136 - IsActive: true - UI Component: - Canvas ID: 174 - Hovered: false - Clicked: false - IsActive: true - Scripts: - - Type: SHADE_Scripting.UI.SceneFadeInOut - Enabled: true - alphaValue: 1 - fadeInTime: 0.5 - fadeOutTime: 0.5 -- EID: 172 +- EID: 548 Name: TweenManager IsActive: true NumberOfChildren: 0 @@ -13456,8 +14653,8 @@ Scripts: - Type: SHADE_Scripting.UI.TweenManager Enabled: true -- EID: 524 - Name: Canvas +- EID: 549 + Name: StealFoodCanvas IsActive: true NumberOfChildren: 1 Components: @@ -13467,7 +14664,7 @@ Scale by canvas width: false IsActive: true Scripts: ~ -- EID: 525 +- EID: 550 Name: StealFoodLogo IsActive: true NumberOfChildren: 0 @@ -13482,7 +14679,7 @@ Material: 127459277 IsActive: true UI Component: - Canvas ID: 524 + Canvas ID: 549 Hovered: false Clicked: false IsActive: true @@ -13490,8 +14687,131 @@ - Type: SHADE_Scripting.UI.StealFoodPopUp Enabled: true popInDuration: 0.5 - popOutDuration: 0.5 + popOutDuration: 0.075000003 stayDuration: 1 rotationAmt: 1800 scaleAmtX: 538 - scaleAmtY: 377 \ No newline at end of file + scaleAmtY: 377 +- EID: 551 + Name: TransitionCanvas + IsActive: true + NumberOfChildren: 1 + Components: + Canvas Component: + Canvas Width: 1920 + Canvas Height: 1080 + Scale by canvas width: false + IsActive: true + Scripts: ~ +- EID: 552 + Name: Transition + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0.100000001} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 2500, y: 1080, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 120016136 + IsActive: true + UI Component: + Canvas ID: 551 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.SceneFadeInOut + Enabled: true + alphaValue: 1 + fadeInTime: 0.5 + fadeOutTime: 0.5 +- EID: 553 + Name: TweenManager + IsActive: true + NumberOfChildren: 0 + Components: ~ + Scripts: + - Type: SHADE_Scripting.UI.TweenManager + Enabled: true +- EID: 554 + Name: CameraPoints + IsActive: true + NumberOfChildren: 3 + Components: ~ + Scripts: + - Type: SHADE_Scripting.UI.PreviewLevel + Enabled: true + endPoint1: [-3.5, 1.5, -4.5] + endPoint2: [0, 2, 4.5] + endPoint3: [1.14999998, 2.20000005, 2] + playerCamera: 4 + duration: 3 +- EID: 555 + Name: PreviewLevel1 + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -5, y: 1.5, z: -3} + Rotate: {x: 0, y: -2.3561945, 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: -135 + Roll: 0 + Width: 1920 + Near: 0.00999999978 + Far: 10000 + Perspective: true + FOV: 90 + IsActive: true + Scripts: ~ +- EID: 556 + Name: PreviewLevel2 + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 3, y: 2, z: 4.5} + Rotate: {x: -0.5497787, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + Camera Component: + Position: {x: -0.24528563, y: 1.5, z: -7.5} + Pitch: -31.5 + Yaw: 0 + Roll: 0 + Width: 1920 + Near: 0.00999999978 + Far: 10000 + Perspective: true + FOV: 90 + IsActive: true + Scripts: ~ +- EID: 557 + Name: PreviewLevel3 + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 1.29999995, y: 2.20000005, z: -4} + Rotate: {x: -0.34906584, y: -1.57079637, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + Camera Component: + Position: {x: 2.5, y: 1.5, z: -7.5} + Pitch: -20 + Yaw: -90 + Roll: 0 + Width: 1920 + Near: 0.00999999978 + Far: 10000 + Perspective: true + FOV: 90 + IsActive: true + Scripts: ~ \ No newline at end of file diff --git a/Assets/Scenes/Level3.shade b/Assets/Scenes/Level3.shade index a71673a4..a13eccb7 100644 --- a/Assets/Scenes/Level3.shade +++ b/Assets/Scenes/Level3.shade @@ -4974,7 +4974,7 @@ - EID: 358 Name: Food IsActive: true - NumberOfChildren: 23 + NumberOfChildren: 20 Components: Transform Component: Translate: {x: 0, y: 0, z: 0} @@ -4997,21 +4997,6 @@ Material: 131956078 IsActive: true Scripts: ~ -- EID: 382 - Name: Food_Cheese - IsActive: true - NumberOfChildren: 0 - Components: - Transform Component: - Translate: {x: 12.1188478, y: 2.36368299, z: 0.0781341419} - Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 1, y: 1, z: 1} - IsActive: true - Renderable Component: - Mesh: 141841143 - Material: 131956078 - IsActive: true - Scripts: ~ - EID: 381 Name: Food_Apple IsActive: true @@ -5267,21 +5252,6 @@ Material: 131956078 IsActive: true Scripts: ~ -- EID: 360 - Name: Food_Apple - IsActive: true - NumberOfChildren: 0 - Components: - Transform Component: - Translate: {x: 4.25191593, y: 2.21991086, z: 10.735425} - Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 1, y: 1, z: 1} - IsActive: true - Renderable Component: - Mesh: 144128170 - Material: 131956078 - IsActive: true - Scripts: ~ - EID: 359 Name: Food_Apple IsActive: true @@ -5312,18 +5282,1371 @@ Material: 131956078 IsActive: true Scripts: ~ -- EID: 356 - Name: Food_Cheese +- EID: 383 + Name: Egg IsActive: true + NumberOfChildren: 4 + Components: + Transform Component: + Translate: {x: 4.23315954, y: 2.22085261, z: 10.7622595} + Rotate: {x: -0, y: 0, z: -0} + Scale: {x: 0.999979734, y: 1, z: 0.999979734} + IsActive: true + Renderable Component: + Mesh: 147457317 + Material: 122370915 + IsActive: true + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Sphere + Radius: 0.200000003 + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: + - Type: Breakable + Enabled: true + threshHold: 0.5 + ignoreRaccoon: true + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 2 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 380 + Name: Piece1 + IsActive: false NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 4.25000906, y: 2.28261352, z: 8.01108646} - Rotate: {x: 0, y: 0, z: 0} + Translate: {x: 0.0224030018, y: 0.0607728958, z: -0.00627422333} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 134900190 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0.164060935, y: 0, z: 0} + IsActive: false + Scripts: ~ +- EID: 375 + Name: Piece2 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.00627422333, y: 0.0337567925, z: -0.00243234634} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 146271645 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.34906584} + IsActive: false + Scripts: ~ +- EID: 367 + Name: Piece3 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.0166685581, y: -0.0367090404, z: 0.0114421844} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 135945648 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.261799395} + IsActive: false + Scripts: ~ +- EID: 361 + Name: Piece4 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.020128727, y: -0.0155199468, z: -0.0045747757} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 141722646 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -1.04719758} + IsActive: false + Scripts: ~ +- EID: 464 + Name: Watermelon + IsActive: true + NumberOfChildren: 5 + Components: + Transform Component: + Translate: {x: 5.70615864, y: 0.288550973, z: 2.10129833} + Rotate: {x: -0, y: 0, z: -0} + Scale: {x: 0.999979734, y: 1, z: 0.999979734} IsActive: true Renderable Component: - Mesh: 141841143 - Material: 131956078 + Mesh: 134305891 + Material: 122370915 IsActive: true - Scripts: ~ \ No newline at end of file + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Sphere + Radius: 0.5 + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: + - Type: Breakable + Enabled: true + threshHold: 4 + ignoreRaccoon: true + - Type: Item + Enabled: true + Score: 500 + currCategory: 2 + density: 1 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 463 + Name: Piece1 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.0218036175, y: 5.38527966e-05, z: 0.202852726} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 144023586 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.400000006, y: 0.300000012, z: 0.300000012} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0.164060935, y: 0, z: 0} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 50 + currCategory: 1 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 466 + Name: Piece2 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.0812162161, y: 0.0825212598, z: -0.0991339684} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 142132679 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.300000012, y: 0.200000003, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.34906584} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 50 + currCategory: 1 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 467 + Name: Piece3 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.0350502729, y: -0.210244894, z: -0.0336794853} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 138231239 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.200000003, y: 0.0799999982, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.261799395} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 468 + Name: Piece4 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.230162144, y: -0.0580062866, z: -0.00789308548} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 135293480 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.200000003, y: 0.0500000007, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -1.04719758} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 469 + Name: Piece5 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.129600644, y: 0.219047099, z: 0.0484838486} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 146157335 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.25, y: 0.0500000007, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0.436332315} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 65892 + Name: Watermelon + IsActive: true + NumberOfChildren: 5 + Components: + Transform Component: + Translate: {x: 4.2424674, y: 2.40468884, z: 7.96858072} + Rotate: {x: -0, y: 0, z: -0} + Scale: {x: 0.999979734, y: 1, z: 0.999979734} + IsActive: true + Renderable Component: + Mesh: 134305891 + Material: 122370915 + IsActive: true + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Sphere + Radius: 0.5 + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: + - Type: Breakable + Enabled: true + threshHold: 4 + ignoreRaccoon: true + - Type: Item + Enabled: true + Score: 500 + currCategory: 2 + density: 1 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 465 + Name: Piece1 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.0218036175, y: 5.38527966e-05, z: 0.202852726} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 144023586 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.400000006, y: 0.300000012, z: 0.300000012} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0.164060935, y: 0, z: 0} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 50 + currCategory: 1 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 462 + Name: Piece2 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.0812162161, y: 0.0825212598, z: -0.0991339684} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 142132679 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.300000012, y: 0.200000003, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.34906584} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 50 + currCategory: 1 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 461 + Name: Piece3 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.0350502729, y: -0.210244894, z: -0.0336794853} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 138231239 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.200000003, y: 0.0799999982, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.261799395} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 460 + Name: Piece4 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.230162144, y: -0.0580062866, z: -0.00789308548} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 135293480 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.200000003, y: 0.0500000007, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -1.04719758} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 459 + Name: Piece5 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.129600644, y: 0.219047099, z: 0.0484838486} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 146157335 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.25, y: 0.0500000007, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0.436332315} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 65918 + Name: Egg + IsActive: true + NumberOfChildren: 4 + Components: + Transform Component: + Translate: {x: -0.630749702, y: 1.00790954, z: 1.41826737} + Rotate: {x: -0, y: 0, z: -0} + Scale: {x: 0.999979734, y: 1, z: 0.999979734} + IsActive: true + Renderable Component: + Mesh: 147457317 + Material: 122370915 + IsActive: true + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Sphere + Radius: 0.200000003 + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: + - Type: Breakable + Enabled: true + threshHold: 0.5 + ignoreRaccoon: true + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 2 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 458 + Name: Piece1 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.0224030018, y: 0.0607728958, z: -0.00627422333} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 134900190 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0.164060935, y: 0, z: 0} + IsActive: false + Scripts: ~ +- EID: 457 + Name: Piece2 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.00627422333, y: 0.0337567925, z: -0.00243234634} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 146271645 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.34906584} + IsActive: false + Scripts: ~ +- EID: 456 + Name: Piece3 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.0166685581, y: -0.0367090404, z: 0.0114421844} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 135945648 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.261799395} + IsActive: false + Scripts: ~ +- EID: 455 + Name: Piece4 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.020128727, y: -0.0155199468, z: -0.0045747757} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 141722646 + Material: 131956078 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 3 + Type: Box + Half Extents: {x: 0.0500000007, y: 0.0500000007, z: 0.0500000007} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -1.04719758} + IsActive: false + Scripts: ~ +- EID: 65896 + Name: Watermelon + IsActive: true + NumberOfChildren: 5 + Components: + Transform Component: + Translate: {x: 12.1925201, y: 2.40468884, z: 0.196343422} + Rotate: {x: -0, y: 0, z: -0} + Scale: {x: 0.999979734, y: 1, z: 0.999979734} + IsActive: true + Renderable Component: + Mesh: 134305891 + Material: 122370915 + IsActive: true + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: true + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Sphere + Radius: 0.5 + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: + - Type: Breakable + Enabled: true + threshHold: 4 + ignoreRaccoon: true + - Type: Item + Enabled: true + Score: 500 + currCategory: 2 + density: 1 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 454 + Name: Piece1 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.0218036175, y: 5.38527966e-05, z: 0.202852726} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 144023586 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.400000006, y: 0.300000012, z: 0.300000012} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0.164060935, y: 0, z: 0} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 50 + currCategory: 1 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 453 + Name: Piece2 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0.0812162161, y: 0.0825212598, z: -0.0991339684} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 142132679 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.300000012, y: 0.200000003, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.34906584} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 50 + currCategory: 1 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 452 + Name: Piece3 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.0350502729, y: -0.210244894, z: -0.0336794853} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 138231239 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.200000003, y: 0.0799999982, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -0.261799395} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 451 + Name: Piece4 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.230162144, y: -0.0580062866, z: -0.00789308548} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 135293480 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.200000003, y: 0.0500000007, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: -1.04719758} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 +- EID: 450 + Name: Piece5 + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -0.129600644, y: 0.219047099, z: 0.0484838486} + Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} + Scale: {x: 1, y: 1, z: 1} + IsActive: false + Renderable Component: + Mesh: 146157335 + Material: 122370915 + IsActive: false + RigidBody Component: + Type: Dynamic + Drag: 0.00999999978 + Angular Drag: 0.100000001 + Use Gravity: true + Interpolate: false + Sleeping Enabled: true + Freeze Position X: false + Freeze Position Y: false + Freeze Position Z: false + Freeze Rotation X: false + Freeze Rotation Y: false + Freeze Rotation Z: false + IsActive: false + Collider Component: + Colliders: + - Is Trigger: false + Collision Tag: 2 + Type: Box + Half Extents: {x: 0.25, y: 0.0500000007, z: 0.200000003} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0.436332315} + IsActive: false + Scripts: + - Type: Item + Enabled: true + Score: 10 + currCategory: 0 + density: 3 + dontReturn: false + soundDistance: 10 + highlightSpeed: 300 + highlightThickness: 250 + highlightLowerClamp: 0.25 \ No newline at end of file diff --git a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafChase.cs b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafChase.cs index 2a3647b3..6085c974 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafChase.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafChase.cs @@ -113,7 +113,8 @@ public partial class LeafChase : BehaviourTreeNode if (GetNodeData("isAlert") != null && (bool)GetNodeData("isAlert") == true) { //AudioHandler.audioClipHandlers["BGMAdpative"].SetParameter("Detected", 0.0f); - Audio.SetParameter("Detected", 0.0f); + //Audio.SetParameter("Detected", 0.0f); + Audio.SetParameterWithLabel("PlayerDetection", "Undetected"); AudioHandler.audioClipHandlers["SFXHumming"].Play(); } SetNodeData("isAlert", false); diff --git a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafPatrol.cs b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafPatrol.cs index ba061972..6199bd19 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafPatrol.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafPatrol.cs @@ -245,7 +245,8 @@ public partial class LeafPatrol : BehaviourTreeNode AudioHandler.audioClipHandlers["SFXHumming"].Play(); //AudioHandler.audioClipHandlers["BGMUnalert"].Play(); //AudioHandler.audioClipHandlers["BGMAdaptive"].SetParameter("Detected", 0.0f); - Audio.SetParameter("Detected", 0.0f); + //Audio.SetParameter("Detected", 0.0f); + Audio.SetParameterWithLabel("PlayerDetection", "Undetected"); } SetNodeData("isAlert", false); } diff --git a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafSearch.cs b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafSearch.cs index b2760e4a..c433f912 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafSearch.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/LeafNodes/LeafSearch.cs @@ -26,6 +26,7 @@ public partial class LeafSearch : BehaviourTreeNode private Vector3 eyeOffset; private float sightDistance; private GameObject? player; //To be searched for and marked + private bool screamOnce; } //FUNCTIONS HERE @@ -67,7 +68,8 @@ public partial class LeafSearch : BehaviourTreeNode if (GetNodeData("isAlert") != null && (bool)GetNodeData("isAlert") == true) { //AudioHandler.audioClipHandlers["BGMAdaptive"].SetParameter("Detected", 0.0f); - Audio.SetParameter("Detected", 0.0f); + //Audio.SetParameter("Detected", 0.0f); + Audio.SetParameterWithLabel("PlayerDetection", "Undetected"); AudioHandler.audioClipHandlers["SFXHumming"].Play(); reevaluateWaypoint(); } @@ -97,6 +99,7 @@ public partial class LeafSearch : BehaviourTreeNode //Search for player player = GameObject.Find("Player"); + screamOnce = false; //Automatically fail if no player is found if (player == null) @@ -188,31 +191,41 @@ public partial class LeafSearch : BehaviourTreeNode if (GetNodeData("isAlert") == null) { SetNodeData("isAlert", true); + screamOnce = true; //Audio.StopAllSounds(); - AudioHandler.audioClipHandlers["SFXDetectAh"].Play(); + //AudioHandler.audioClipHandlers["SFXDetectAh"].Play(); AudioHandler.audioClipHandlers["SFXDetectSting"].Play(); //AudioHandler.audioClipHandlers["BGMAlert"].Play(); AudioHandler.audioClipHandlers["SFXHumming"].Stop(false); //AudioHandler.audioClipHandlers["BGMUnalert"].Stop(true); //AudioHandler.audioClipHandlers["BGMAdaptive"].SetParameter("Detected", 1.0f); - Audio.SetParameter("Detected", 1.0f); + //Audio.SetParameter("Detected", 1.0f); + Audio.SetParameterWithLabel("PlayerDetection", "Detected"); } else { if (GetNodeData("isAlert") != null && (bool)GetNodeData("isAlert") == false) { //Audio.StopAllSounds(); - AudioHandler.audioClipHandlers["SFXDetectAh"].Play(); + screamOnce = true; + //AudioHandler.audioClipHandlers["SFXDetectAh"].Play(); AudioHandler.audioClipHandlers["SFXDetectSting"].Play(); //AudioHandler.audioClipHandlers["BGMAlert"].Play(); AudioHandler.audioClipHandlers["SFXHumming"].Stop(false); //AudioHandler.audioClipHandlers["BGMUnalert"].Stop(true); //AudioHandler.audioClipHandlers["BGMAdaptive"].SetParameter("Detected", 1.0f); - Audio.SetParameter("Detected", 1.0f); + //Audio.SetParameter("Detected", 1.0f); + Audio.SetParameterWithLabel("PlayerDetection", "Detected"); } SetNodeData("isAlert", true); } + if (screamOnce) + { + screamOnce = false; + AudioHandler.audioClipHandlers["SFXDetectAh"].Play(); + } + status = BehaviourTreeNodeStatus.SUCCESS; onExit(BehaviourTreeNodeStatus.SUCCESS); return status; diff --git a/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs b/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs index 2de54025..e23e9ff1 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs @@ -28,11 +28,6 @@ public class PickAndThrow : Script public bool throwItem = false; private Vector3 prevTargetOffSet; - public GameObject silhouettePlayer; - public Renderable silhouettePlayerRend; - public GameObject silhouetteBag; - public Renderable silhouetteBagRend; - [Tooltip("Lenght of ray")] public float rayDistance = 1; @@ -58,41 +53,17 @@ public class PickAndThrow : Script if(!tpc) Debug.LogError("TPC EMPTY"); - if(!silhouettePlayer) - Debug.LogError("silhouettePlayer EMPTY"); - else - silhouettePlayerRend = silhouettePlayer.GetComponent(); - - if (!silhouetteBag) - Debug.LogError("silhouetteBag EMPTY"); - else - silhouetteBagRend = silhouetteBag.GetComponent(); - AudioHandler.audioClipHandlers["SFXThrow"] = Audio.CreateAudioClip("event:/Raccoon/raccoon_throw"); timer = delayTimer; } protected override void update() { - if (GameManager.Instance.GamePause) + if (GameManager.Instance.GamePause || !GameManager.Instance.stealFoodPopUpDone) { return; } - if (silhouettePlayerRend && silhouetteBagRend) - { - //wait for daniel - //0.00075f; - Vector3 dis = Camera.GetMainCamera().Position - GameObject.GetComponent().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("data.offset", temp); - silhouetteBagRend.Material.SetProperty("data.offset", temp); - } - if (timer <= delayTimer) timer += Time.DeltaTimeF; @@ -171,7 +142,7 @@ public class PickAndThrow : Script protected override void fixedUpdate() { - if (GameManager.Instance.GamePause) + if (GameManager.Instance.GamePause || !GameManager.Instance.stealFoodPopUpDone) { return; } diff --git a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs index 87e42032..d3cc3f66 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs @@ -17,15 +17,6 @@ public class PlayerController : Script TOTAL } -/* public enum WalkingState - { - CARRY, - AIMING, - THROW, - WALK, - TOTAL - }*/ - public RigidBody rb { get; set; } public Transform tranform { get; set; } public Camera cam { get; set; } @@ -85,6 +76,12 @@ public class PlayerController : Script [Tooltip("How heavy item will affect player jump")] public float heavyMultiper = 0.25f; + //silhouette===================================================================== + public GameObject silhouettePlayer; + public Renderable silhouettePlayerRend; + public GameObject silhouetteBag; + public Renderable silhouetteBagRend; + protected override void awake() { //default setup @@ -119,6 +116,21 @@ public class PlayerController : Script dictionary.Add(typeof(PlayerCaughtState), new PlayerCaughtState(stateMachine)); stateMachine.InitStateMachine(dictionary); + if (!silhouettePlayer) + Debug.LogError("silhouettePlayer EMPTY"); + else + { + silhouettePlayerRend = silhouettePlayer.GetComponent(); + silhouettePlayerRend.Material.SetProperty("data.offset", 0.1f); + } + + if (!silhouetteBag) + Debug.LogError("silhouetteBag EMPTY"); + else + { + silhouetteBagRend = silhouetteBag.GetComponent(); + silhouetteBagRend.Material.SetProperty("data.offset", 0.1f); + } } protected override void lateUpdate() @@ -127,26 +139,23 @@ public class PlayerController : Script protected override void update() { - if (GameManager.Instance.GamePause) + if (GameManager.Instance.GamePause || !GameManager.Instance.stealFoodPopUpDone) { return; } - if (delayTimer <= 1) - delayTimer += Time.DeltaTimeF; + if (silhouettePlayerRend && silhouetteBagRend) + { + Vector3 dis = Camera.GetMainCamera().Position - GameObject.GetComponent().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("data.offset", temp); + silhouetteBagRend.Material.SetProperty("data.offset", temp); + } - if (delayTimer < 1) - { - if (tranform && respawnPoint && rb) - { - rb.LinearVelocity = Vector3.Zero; - tranform.LocalPosition = respawnPoint.GetComponent().LocalPosition; - } - } - else - { - rb.FreezePositionY = false; - } //PickAndThrow check if (!pat) { @@ -156,13 +165,15 @@ public class PlayerController : Script } if (!cam) + { cam = GetComponentInChildren(); + if(pat) + cam.FOV = pat.defaultFOV; + } if(!camArm) camArm = GetComponentInChildren(); - //tempFix - if (tranform) - tranform.LocalEulerAngles = new Vector3(0.0f, tranform.LocalEulerAngles.y, 0.0f); + GotCaught(); Rotation(); @@ -178,7 +189,7 @@ public class PlayerController : Script protected override void fixedUpdate() { - if (GameManager.Instance.GamePause) + if (GameManager.Instance.GamePause || !GameManager.Instance.stealFoodPopUpDone) { return; } @@ -333,10 +344,11 @@ public class PlayerController : Script private void Rotation() { + tranform.LocalEulerAngles = new Vector3(0.0f, tranform.LocalEulerAngles.y, 0.0f); if (isMoveKeyPress && tranform && !isAiming) { 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); } 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); tranform.LocalRotation = Quaternion.Slerp(currentRotation, targetRotation, rotationFactorPerFrame * (float)Time.FixedDeltaTime); } + } private void Gravity() diff --git a/Assets/Scripts/Gameplay/Player/SC_ThirdPersonCamera.cs b/Assets/Scripts/Gameplay/Player/SC_ThirdPersonCamera.cs index b137609e..71cb31a4 100644 --- a/Assets/Scripts/Gameplay/Player/SC_ThirdPersonCamera.cs +++ b/Assets/Scripts/Gameplay/Player/SC_ThirdPersonCamera.cs @@ -41,7 +41,7 @@ namespace SHADE_Scripting protected override void update() { - if (GameManager.Instance.GamePause) + if (GameManager.Instance.GamePause || !GameManager.Instance.stealFoodPopUpDone) { return; } diff --git a/Assets/Scripts/Gameplay/SC_GameManager.cs b/Assets/Scripts/Gameplay/SC_GameManager.cs index 0ec3a4e5..9ed7c837 100644 --- a/Assets/Scripts/Gameplay/SC_GameManager.cs +++ b/Assets/Scripts/Gameplay/SC_GameManager.cs @@ -41,6 +41,8 @@ public class GameManager : Script public static GameManager Instance { get; private set; } public bool GamePause { get; set; } + public bool stealFoodPopUpDone { get; set; } + public bool PreviewLevelDone { get; set; } public bool itemShatter { get; set; } @@ -63,20 +65,28 @@ public class GameManager : Script currMultiplierDuration = 0; fontScalar = new Vector3(multiplierFont / maxMultiplierDuration, multiplierFont / maxMultiplierDuration , multiplierFont / maxMultiplierDuration); itemShatter = false; + GamePause = false; + stealFoodPopUpDone = false; + PreviewLevelDone = false; AudioHandler.audioClipHandlers["BGMWin"] = Audio.CreateAudioClip("event:/Music/stingers/game_win"); AudioHandler.audioClipHandlers["BGMLose"] = Audio.CreateAudioClip("event:/Music/stingers/game_lose"); goingToWin = false; goingToLose = false; + + if (scoreText) + scoreText.GetComponent().Text = $"{Score}"; + if (timeText) + timeText.GetComponent().Text = $"{timer.ToString("0")}"; } protected override void start() { - AudioHandler.audioClipHandlers["BGMAdaptive"] = Audio.CreateAudioClip("event:/Music/bgm_adaptive"); + AudioHandler.audioClipHandlers["BGMAdaptive"] = Audio.CreateAudioClip("event:/Music/bgm_adaptive_new"); AudioHandler.audioClipHandlers["BGMAdaptive"].Play(); - Audio.SetParameter("Detected", 0.0f); + Audio.SetParameterWithLabel("PlayerDetection", "Undetected"); AudioHandler.audioClipHandlers["KitchenAmbience"] = Audio.CreateAudioClip("event:/Ambience/roomtone_kitchen"); AudioHandler.audioClipHandlers["KitchenAmbience"].Play(); @@ -85,23 +95,24 @@ public class GameManager : Script AudioHandler.audioClipHandlers["SFXHumming"].SetVolume(0.15f); AudioHandler.audioClipHandlers["SFXHumming"].Play(); - SceneFadeInOut.Instance.CallFadeOut(); + if (SceneFadeInOut.Instance != null) + SceneFadeInOut.Instance.CallFadeOut(); + Application.IsCursorVisible = false; } protected override void update() { - if (Input.GetKeyDown(Input.KeyCode.G)) - ItemScored(); - - - - if (GamePause) + if (GamePause || !stealFoodPopUpDone) { + Input.SetMouseCentering(false); + Application.IsCursorVisible = true; return; } if (currGameState == GameState.START) { + Input.SetMouseCentering(true); + timer -= Time.DeltaTimeF; if(scoreText) scoreText.GetComponent().Text = $"{Score}"; @@ -131,7 +142,8 @@ public class GameManager : Script AudioHandler.StopAllSounds(false); AudioHandler.audioClipHandlers["BGMWin"].Play(); goingToWin = true; - SceneFadeInOut.Instance.CallFadeIn(); + if (SceneFadeInOut.Instance != null) + SceneFadeInOut.Instance.CallFadeIn(); } else if(!goingToWin && (timer < 0 || Input.GetKeyDown(Input.KeyCode.F2))) { @@ -139,12 +151,27 @@ public class GameManager : Script AudioHandler.StopAllSounds(false); AudioHandler.audioClipHandlers["BGMLose"].Play(); goingToLose = true; - SceneFadeInOut.Instance.CallFadeIn(); + if (SceneFadeInOut.Instance != null) + SceneFadeInOut.Instance.CallFadeIn(); } } //Handling transitions - if (SceneFadeInOut.Instance.FadeInFinished()) + if (SceneFadeInOut.Instance != null) + { + if (SceneFadeInOut.Instance.FadeInFinished()) + { + if (goingToWin) + { + SceneManager.ChangeScene(winScene); + } + if (goingToLose) + { + SceneManager.ChangeScene(loseScene); + } + } + } + else { if (goingToWin) { diff --git a/Assets/Scripts/Gameplay/SC_PreviewLevel.cs b/Assets/Scripts/Gameplay/SC_PreviewLevel.cs new file mode 100644 index 00000000..7efee8c9 --- /dev/null +++ b/Assets/Scripts/Gameplay/SC_PreviewLevel.cs @@ -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 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().ToList(); + + if (listOfCamera.Count == 0) + Debug.LogError("EMPTY PREVIEW POINTS"); + + listOfCamera[0].SetMainCamera(); + + moveToEndPoint1 = TweenManager.CreateTweenThreadVec3(duration, listOfCamera[0].GetComponent().LocalPosition, endPoint1, EASING_METHOD.EASE_IN_SINE); + moveToEndPoint2 = TweenManager.CreateTweenThreadVec3(duration, listOfCamera[1].GetComponent().LocalPosition, endPoint2, EASING_METHOD.EASE_IN_SINE); + moveToEndPoint3 = TweenManager.CreateTweenThreadVec3(duration, listOfCamera[2].GetComponent().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().SetMainCamera(); + SceneFadeInOut.Instance.CallFadeOut(); + } + + if (skip && SceneFadeInOut.Instance.FadeOutFinished()) + { + GameManager.Instance.PreviewLevelDone = true; + } + + + if (!skip) + { + if (!point1Done) + { + listOfCamera[0].GetComponent().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().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().LocalPosition, endPoint3, EASING_METHOD.EASE_IN_SINE); + reset3 = false; + } + listOfCamera[2].GetComponent().LocalPosition = moveToEndPoint3.GetValue(); + if (moveToEndPoint3.IsCompleted()) + { + point3Done = true; + SceneFadeInOut.Instance.CallFadeIn(); + SceneFadeInOut.Instance.alphaValue = 0.01f; + } + } + } + + if (SceneFadeInOut.Instance.FadeInFinished() && point3Done) + { + playerCamera.GetComponent().SetMainCamera(); + SceneFadeInOut.Instance.CallFadeOut(); + } + + if (SceneFadeInOut.Instance.FadeOutFinished() && point3Done) + { + GameManager.Instance.PreviewLevelDone = true; + } + } + + } + + } +} + diff --git a/Assets/Scripts/Gameplay/SC_PreviewLevel.cs.shmeta b/Assets/Scripts/Gameplay/SC_PreviewLevel.cs.shmeta new file mode 100644 index 00000000..6eb37f9a --- /dev/null +++ b/Assets/Scripts/Gameplay/SC_PreviewLevel.cs.shmeta @@ -0,0 +1,3 @@ +Name: SC_PreviewLevel +ID: 155897609 +Type: 9 diff --git a/Assets/Scripts/UI/EasingHelper.cs b/Assets/Scripts/UI/EasingHelper.cs index 37c54d06..dadae5bb 100644 --- a/Assets/Scripts/UI/EasingHelper.cs +++ b/Assets/Scripts/UI/EasingHelper.cs @@ -52,12 +52,15 @@ namespace SHADE_Scripting.UI private static float EaseInSine(float value) { + return (float)(1.0f - Math.Cos((value * Math.PI / 2.0f) )); + } private static float EaseOutSine(float value) { return (float)(Math.Sin(value * Math.PI / 2.0f) ); + } diff --git a/Assets/Scripts/UI/SC_ChangeSceneButton.cs b/Assets/Scripts/UI/SC_ChangeSceneButton.cs index 6a51716b..09e4cf5b 100644 --- a/Assets/Scripts/UI/SC_ChangeSceneButton.cs +++ b/Assets/Scripts/UI/SC_ChangeSceneButton.cs @@ -22,22 +22,19 @@ public class ChangeSceneButton : Script { ui.OnRelease.RegisterAction(() => { - if (sceneID != 0) { - Audio.PlaySFXOnce2D("event:/UI/success"); - - Audio.StopAllSounds(); - + Audio.PlaySFXOnce2D("event:/UI/success"); + Audio.StopAllSounds(); + if (SceneFadeInOut.Instance != null) SceneFadeInOut.Instance.CallFadeIn(); - clickedFlag = true; + clickedFlag = true; } }); } else { Debug.LogError("Failed to register button action for ChangeSceneButton."); - } } protected override void update() diff --git a/Assets/Scripts/UI/SC_Cutscene.cs b/Assets/Scripts/UI/SC_Cutscene.cs index 4a6b2858..e5c6ca88 100644 --- a/Assets/Scripts/UI/SC_Cutscene.cs +++ b/Assets/Scripts/UI/SC_Cutscene.cs @@ -409,7 +409,11 @@ public class Cutscene : Script private void initCutscene1() { - listOfCutscene1Points = cutscene1Points.GetComponentsInChildren().ToList(); + if(cutscene1Points) + listOfCutscene1Points = cutscene1Points.GetComponentsInChildren().ToList(); + else + Debug.LogError("Cutscene1Points Missing"); + if (listOfCutscene1Points.Count == 0) Debug.LogError("Cutscene1Points Empty"); @@ -455,7 +459,11 @@ public class Cutscene : Script private void initCutscene2() { - listOfCutscene2Points = cutscene2Points.GetComponentsInChildren().ToList(); + if(cutscene2Points) + listOfCutscene2Points = cutscene2Points.GetComponentsInChildren().ToList(); + else + Debug.LogError("cutscene2Points Missing"); + if (listOfCutscene2Points.Count == 0) Debug.LogError("Cutscene2Points Empty"); @@ -503,7 +511,11 @@ public class Cutscene : Script private void initCutscene3() { - listOfCutscene3Points = cutscene3Points.GetComponentsInChildren().ToList(); + if(cutscene3Points) + listOfCutscene3Points = cutscene3Points.GetComponentsInChildren().ToList(); + else + Debug.LogError("cutscene3Points Missing"); + if (listOfCutscene3Points.Count == 0) Debug.LogError("Cutscene3Points Empty"); diff --git a/Assets/Scripts/UI/SC_EndScene.cs b/Assets/Scripts/UI/SC_EndScene.cs index 2117b24a..9ab50f9a 100644 --- a/Assets/Scripts/UI/SC_EndScene.cs +++ b/Assets/Scripts/UI/SC_EndScene.cs @@ -1,6 +1,7 @@ using System; using SHADE; using SHADE_Scripting.Audio; +using SHADE_Scripting.UI; public class EndScene : Script { @@ -12,6 +13,15 @@ public class EndScene : Script AudioHandler.audioClipHandlers["SFXMouseDownElement"] = Audio.CreateAudioClip("event:/UI/mouse_down_element"); AudioHandler.audioClipHandlers["SFXUISuccess"] = Audio.CreateAudioClip("event:/UI/success"); } + + protected override void start() + { + Debug.Log("EndScene::Start():"); + //Input.SetMouseCentering(false); + //Application.IsCursorVisible = true; + SceneFadeInOut.Instance.CallFadeOut(); + } + protected override void update() { if (Input.GetKeyDown(Input.KeyCode.R)) diff --git a/Assets/Scripts/UI/SC_MainMenu.cs b/Assets/Scripts/UI/SC_MainMenu.cs index 59b6594e..d2caaba0 100644 --- a/Assets/Scripts/UI/SC_MainMenu.cs +++ b/Assets/Scripts/UI/SC_MainMenu.cs @@ -1,6 +1,7 @@ using System; using SHADE; using SHADE_Scripting.Audio; +using SHADE_Scripting.UI; public class MainMenu : Script { @@ -23,6 +24,9 @@ public class MainMenu : Script protected override void start() { + //Input.SetMouseCentering(false); + //Application.IsCursorVisible = true; + SceneFadeInOut.Instance.CallFadeOut(); } protected override void update() { diff --git a/Assets/Scripts/UI/SC_PauseMenu.cs b/Assets/Scripts/UI/SC_PauseMenu.cs index 71e2b8c3..a20dd586 100644 --- a/Assets/Scripts/UI/SC_PauseMenu.cs +++ b/Assets/Scripts/UI/SC_PauseMenu.cs @@ -8,16 +8,19 @@ public class PauseMenu : Script public GameObject retryBtn; public GameObject quitBtn; - public GameObject gamePauseText; + private TextRenderable gamePauseText; public GameObject canvas; protected override void awake() { - GameManager.Instance.GamePause = false; - if (gamePauseText) - gamePauseText.GetComponent().Enabled = false; + if (GameManager.Instance != null) + GameManager.Instance.GamePause = false; + if (canvas) + { + gamePauseText = canvas.GetComponentInChildren(); canvas.SetActive(false); + } if (!resumeBtn) Debug.LogError("Resume Btn missing"); @@ -39,9 +42,11 @@ public class PauseMenu : Script if (GameManager.Instance.GamePause) { GameManager.Instance.GamePause = false; + Input.SetMouseCentering(true); + Application.IsCursorVisible = false; AudioHandler.PauseAllSounds(false); if (gamePauseText) - gamePauseText.GetComponent().Enabled = false; + gamePauseText.Enabled = false; if (canvas) canvas.SetActive(false); } @@ -86,12 +91,14 @@ public class PauseMenu : Script 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; + Input.SetMouseCentering(false); + Application.IsCursorVisible = true; AudioHandler.PauseAllSounds(true); if (gamePauseText) - gamePauseText.GetComponent().Enabled = true; + gamePauseText.Enabled = true; if (canvas) canvas.SetActive(true); } diff --git a/Assets/Scripts/UI/SC_SceneFadeInOut.cs b/Assets/Scripts/UI/SC_SceneFadeInOut.cs index 4224474b..c426f8a6 100644 --- a/Assets/Scripts/UI/SC_SceneFadeInOut.cs +++ b/Assets/Scripts/UI/SC_SceneFadeInOut.cs @@ -43,7 +43,6 @@ namespace SHADE_Scripting.UI protected override void start() { - } protected override void update() @@ -56,7 +55,6 @@ namespace SHADE_Scripting.UI if (fadeInTime == 0.0f) { alphaValue = 1.0f; - } else { @@ -64,8 +62,8 @@ namespace SHADE_Scripting.UI } if (alphaValue >= 1.0f) { - alphaValue = 1.0f; - GameObject.Parent.SetActive(false); + alphaValue = 1.0f; + //GameObject.Parent.SetActive(false); } } @@ -83,8 +81,10 @@ namespace SHADE_Scripting.UI } if (alphaValue <= 0.0f) { - alphaValue = 0.0f; - GameObject.Parent.SetActive(false); + alphaValue = 0.0f; + //This line is to be added so that (because the fade in and out item is usually the front-most UI element) + //the fade in and out UI element does not block functionality of other UI elements + GameObject.Parent.SetActive(false); } } diff --git a/Assets/Scripts/UI/SC_ScrollingCredits.cs.shmeta b/Assets/Scripts/UI/SC_ScrollingCredits.cs.shmeta new file mode 100644 index 00000000..df5d7056 --- /dev/null +++ b/Assets/Scripts/UI/SC_ScrollingCredits.cs.shmeta @@ -0,0 +1,3 @@ +Name: SC_ScrollingCredits +ID: 159139676 +Type: 9 diff --git a/Assets/Scripts/UI/SC_StealFoodPopUp.cs b/Assets/Scripts/UI/SC_StealFoodPopUp.cs index 59b97e7d..6991ed32 100644 --- a/Assets/Scripts/UI/SC_StealFoodPopUp.cs +++ b/Assets/Scripts/UI/SC_StealFoodPopUp.cs @@ -51,6 +51,13 @@ namespace SHADE_Scripting.UI //538x377 protected override void update() { + if (!GameManager.Instance.PreviewLevelDone) + { + rot.Reset(); + scaleX.Reset(); + scaleY.Reset(); + return; + } if (!popInDone) { @@ -79,11 +86,11 @@ namespace SHADE_Scripting.UI if (scaleOutX.IsCompleted() && scaleOutY.IsCompleted()) { GameObject.SetActive(false); + GameManager.Instance.stealFoodPopUpDone = true; } } } - } } diff --git a/Assets/Shaders/ParticleEmit_CS.glsl b/Assets/Shaders/ParticleEmit_CS.glsl new file mode 100644 index 00000000..421e2ce1 --- /dev/null +++ b/Assets/Shaders/ParticleEmit_CS.glsl @@ -0,0 +1,117 @@ +#version 450 + +layout(local_size_x = 128) in; + +struct EmitterParameters +{ + vec4 angularMin; + vec4 angularMax; + vec4 lifeAndSizeRange; // min life, max life, min size, max size +} + +struct ParticleData +{ + vec4 position; + vec4 rotation; + vec4 velocity; + vec4 acceleration; + vec4 scaleAndDecay; + 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 = 0, binding = 0) uniform GenericDataBuffer +{ + GenericData data; +} genericDataBuffer; + +layout (std430, set = 2, binding = 0) readonly buffer EmitterBuffer +{ + EmitterParameters data; +} emitterParams; + +layout (std430, set = 2, binding = 1) coherent restrict 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; + + +// 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 emitterInvocationIndex = gl_GlobalInvocationID.x; + + if (emitterInvocationIndex >= emitterPushConstant.emissionCount) + return; + + int freelistIndex = atomicAdd (freelist.freeCount, -1) - 1; + if (freelistIndex < 0) + atomicAdd (freelist.freeCount, 1); + + ParticleData particle; + + int index = freelist.freeIndices[freelistIndex]; + particle.position = emitterPosition; + particle.life = emitterParams.10.0f; + + particles[index] = particle; +} \ No newline at end of file diff --git a/Assets/Shaders/ParticleUpdate_CS.glsl b/Assets/Shaders/ParticleUpdate_CS.glsl new file mode 100644 index 00000000..7649ee63 --- /dev/null +++ b/Assets/Shaders/ParticleUpdate_CS.glsl @@ -0,0 +1,141 @@ +#version 450 + +layout(local_size_x = 128) in; + +struct DrawArraysIndirectArgs +{ + uint count; + uint instanceCount; + uint first; + uint baseInstance; +}; + +struct ParticleData +{ + vec4 position; + vec4 rotation; + vec4 velocity; + vec4 acceleration; + vec4 scaleAndDecay; + 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 uniform 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.lifetime > 0.0f) + { + // particle.position += particle.velocity * dt; + + // particle.lifetime -= dt; + // particle.size -= 1.2f * dt; + // particle.color += 1.0f * dt; + + if (particle.lifetime < 0.0f || particle.size < 0.0f) + { + particle.lifetime = 0.0f; + particle.position.x = 99999.0f; + + outputParticles.data[index] = particle; + freelist.freeIndices[atomicAdd(freelist.freeCount, 1)] = int (index); + return; + } + + outputParticles.data[index] = particle; + uint drawIndex = atomicAdd (indirectArgs.instanceCount, 1); + indices[drawIndex] = index; + } +} \ No newline at end of file diff --git a/Assets/Shaders/Trajectory_VS.glsl b/Assets/Shaders/Trajectory_VS.glsl index 86be6b7e..1b4de7f7 100644 --- a/Assets/Shaders/Trajectory_VS.glsl +++ b/Assets/Shaders/Trajectory_VS.glsl @@ -32,5 +32,5 @@ void main() Out.uv = aUV; Out.color = aColor; - gl_Position = cameraData.projMat * aTransform * vec4(aPos, 1.0f); + gl_Position = cameraData.vpMat * aTransform * vec4(aPos, 1.0f); } \ No newline at end of file diff --git a/Assets/Shaders/Trajectory_VS.shshaderb b/Assets/Shaders/Trajectory_VS.shshaderb index 6f509f5c..b7a0f9fb 100644 Binary files a/Assets/Shaders/Trajectory_VS.shshaderb and b/Assets/Shaders/Trajectory_VS.shshaderb differ diff --git a/Assets/Shaders/UI_FS.glsl b/Assets/Shaders/UI_FS.glsl index 30b59e48..3c66891b 100644 --- a/Assets/Shaders/UI_FS.glsl +++ b/Assets/Shaders/UI_FS.glsl @@ -37,7 +37,7 @@ layout(location = 1) out uint outEntityID; void main() { fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv); - if (fragColor.a < 0.01f) + if (fragColor.a < 0.1f) { discard; } diff --git a/Assets/Shaders/UI_FS.shshaderb b/Assets/Shaders/UI_FS.shshaderb index 92f4ed4e..d734949d 100644 Binary files a/Assets/Shaders/UI_FS.shshaderb and b/Assets/Shaders/UI_FS.shshaderb differ diff --git a/SHADE_Engine/src/AudioSystem/SHAudioSystem.cpp b/SHADE_Engine/src/AudioSystem/SHAudioSystem.cpp index e02eac50..60b709c2 100644 --- a/SHADE_Engine/src/AudioSystem/SHAudioSystem.cpp +++ b/SHADE_Engine/src/AudioSystem/SHAudioSystem.cpp @@ -656,6 +656,15 @@ namespace SHADE } } + void SHAudioSystem::SetParameterWithLabel(const char* path, const char* label) + { + result = fmodStudioSystem->setParameterByNameWithLabel(path, label); + if (result != FMOD_OK) + { + ErrorCheck(); + } + } + void AudioClip::Play() { if(!instance) @@ -734,12 +743,16 @@ namespace SHADE } } - //void AudioClip::SetParameterLabel(const char* paramName, const char* label) - //{ - // if (!instance) - // return; - // instance->setParameterByNameWithLabel(paramName, label); - //} + void AudioClip::SetParameterWithLabel(const char* paramName, const char* label) + { + if (!instance) + return; + FMOD_RESULT result = instance->setParameterByNameWithLabel(paramName, label); + if (result != FMOD_OK) + { + SHLOG_ERROR("Audio system error: {}", FMOD_ErrorString(result)) + } + } float AudioClip::GetParameterValue(const char* paramName) { diff --git a/SHADE_Engine/src/AudioSystem/SHAudioSystem.h b/SHADE_Engine/src/AudioSystem/SHAudioSystem.h index 68942a8e..99ff7953 100644 --- a/SHADE_Engine/src/AudioSystem/SHAudioSystem.h +++ b/SHADE_Engine/src/AudioSystem/SHAudioSystem.h @@ -33,7 +33,7 @@ namespace SHADE void SetPause(bool pause); bool IsPaused(); void SetParameter(const char* paramName, float value); - //void SetParameterLabel(const char* paramName, const char* label); + void SetParameterWithLabel(const char* paramName, const char* label); float GetParameterValue(const char* paramName); float GetVolume(); void SetVolume(float volume); @@ -94,6 +94,7 @@ namespace SHADE float GetParameterValue(const char* path); void SetParameter(const char* path, float value); + void SetParameterWithLabel(const char* path, const char* label); private: FMOD::Studio::System* fmodStudioSystem; diff --git a/SHADE_Engine/src/Camera/SHCameraArmComponent.cpp b/SHADE_Engine/src/Camera/SHCameraArmComponent.cpp index ed24e6a7..c560a1b0 100644 --- a/SHADE_Engine/src/Camera/SHCameraArmComponent.cpp +++ b/SHADE_Engine/src/Camera/SHCameraArmComponent.cpp @@ -1,6 +1,6 @@ #include "SHpch.h" #include "SHCameraArmComponent.h" - +#include "Math/SHMathHelpers.h" namespace SHADE @@ -16,6 +16,11 @@ namespace SHADE SHVec3 const& SHCameraArmComponent::GetOffset() const noexcept { + SHVec3 result = offset; + + result = SHVec3::RotateX(offset, -(SHMath::DegreesToRadians(GetPitch()))); + result = SHVec3::RotateY(offset, (SHMath::DegreesToRadians(GetYaw()))); + return offset; } diff --git a/SHADE_Engine/src/Camera/SHCameraSystem.cpp b/SHADE_Engine/src/Camera/SHCameraSystem.cpp index 95a461f8..85f3b1b1 100644 --- a/SHADE_Engine/src/Camera/SHCameraSystem.cpp +++ b/SHADE_Engine/src/Camera/SHCameraSystem.cpp @@ -172,11 +172,6 @@ namespace SHADE void SHCameraSystem::UpdateCameraArmComponent(SHCameraArmComponent& pivot) noexcept { - - - - - SHVec3 offset{ 0.0f,0.0f, 1.0f }; offset = SHVec3::RotateX(offset, -(SHMath::DegreesToRadians(pivot.GetPitch()))); offset = SHVec3::RotateY(offset, (SHMath::DegreesToRadians(pivot.GetYaw()))); @@ -212,12 +207,18 @@ namespace SHADE } + + + + + //Camera Collision stuff + SHVec3 cameraPos = camera->position + pivot.offset; SHVec3 cameraTarget = camera->position; - //SHLOG_INFO("Ray position: {},{},{} direction:{},{},{}",pivot.ray.position.x, pivot.ray.position.y, pivot.ray.position.z,pivot.ray.direction.x, pivot.ray.direction.y, pivot.ray.direction.z) + SHRaycaster::RaycastInfo info; - //info.layers = (SHCollisionTagMatrix::GetTag("7")->GetMask()); + info.layers = (uint16_t)(SHCollisionTagMatrix::GetTag("Camera")->GetMask()); info.distance = pivot.armLength; info.continuous = false; @@ -235,38 +236,10 @@ namespace SHADE newOffset = SHVec3::RotateY(newOffset, (SHMath::DegreesToRadians(pivot.GetYaw()))); newOffset = SHVec3::Normalise(newOffset) * (hitResult.distance * 0.95f); pivot.offset = newOffset; - //cameraPos = camera->position + pivot.offset; - //SHLOG_INFO("CAMERA COLLISION HIT, {} armlength: {}, true armlength: {}", hitResult.distance, hitResult.distance, (cameraPos - camera->position).Length()); - //SHLOG_INFO("Racoon Position {}, {}, {}, Camera Position: {}, {}, {}, Distance {}", cameraTarget.x, cameraTarget.y, cameraTarget.z, cameraPos.x, cameraPos.y, cameraPos.z, SHVec3::Distance(cameraTarget, cameraPos)); - //SHLOG_INFO("Camera Position: {}, {}, {}", cameraPos.x, cameraPos.y, cameraPos.z); - //auto otherTransform = SHComponentManager::GetComponent_s(hitResult.entityHit); - //SHVec3 otherPos = hitResult.position; - - - //SHLOG_INFO("hit distance{} other pos: {},{},{}, distance between: {}", hitResult.distance, otherPos.x, otherPos.y, otherPos.z, SHVec3::Distance(cameraTarget,otherPos)); break; } } - - ////auto result = physicsSystem->Raycast(pivot.ray); - //if (result && result.distance < pivot.GetArmLength()) - //{ - // - // SHVec3 newOffset = SHVec3{ 0.0f,0.0f, result.distance * 0.8f }; - // newOffset = SHVec3::RotateX(newOffset, -(SHMath::DegreesToRadians(pivot.GetPitch()))); - // newOffset = SHVec3::RotateY(newOffset, (SHMath::DegreesToRadians(pivot.GetYaw()))); - // pivot.offset = newOffset; - // //SHLOG_INFO("CAMERA COLLISION HIT, {}", result.distance); - //} - //else - //{ - // //SHLOG_INFO("CAMERA COLLISION CANT HIT CAMERA"); - //} - - - // pivot.rtMatrix = SHMatrix::Inverse(pivot.rtMatrix); - } diff --git a/SHADE_Engine/src/Common/SHAllComponents.h b/SHADE_Engine/src/Common/SHAllComponents.h index 36b74853..ee900736 100644 --- a/SHADE_Engine/src/Common/SHAllComponents.h +++ b/SHADE_Engine/src/Common/SHAllComponents.h @@ -13,4 +13,5 @@ #include "Graphics/MiddleEnd/Interface/SHRenderable.h" #include "Physics/Interface/SHColliderComponent.h" #include "Graphics/MiddleEnd/TextRendering/SHTextRenderableComponent.h" -#include "AudioSystem/SHAudioListenerComponent.h" \ No newline at end of file +#include "AudioSystem/SHAudioListenerComponent.h" +#include "Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.h" diff --git a/SHADE_Engine/src/Editor/EditorWindow/AssetBrowser/SHAssetBrowser.cpp b/SHADE_Engine/src/Editor/EditorWindow/AssetBrowser/SHAssetBrowser.cpp index a0aaf0fa..a6e506b5 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/AssetBrowser/SHAssetBrowser.cpp +++ b/SHADE_Engine/src/Editor/EditorWindow/AssetBrowser/SHAssetBrowser.cpp @@ -376,7 +376,9 @@ namespace SHADE { if(editor->LoadScene(asset->id)) { +#ifdef SHEDITOR editor->editorConfig->workingSceneID = asset->id; +#endif } } break; diff --git a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp index 9e86f7bf..8adb45b5 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp +++ b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp @@ -27,6 +27,8 @@ #include "Physics/Collision/Shapes/SHSphere.h" #include "../SHEditorWindowManager.h" #include "../AssetBrowser/SHAssetBrowser.h" +#include "Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.h" + namespace SHADE { template @@ -599,8 +601,8 @@ namespace SHADE component->SetText(val); } ); - - SHEditorWidgets::ColorPicker("Color", [&textComp = component]() {return textComp->GetColour(); }, [&textComp = component](SHVec4 const& newColor) {textComp->SetColour(newColor); }); + 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); }); } else { @@ -679,4 +681,95 @@ namespace SHADE ImGui::PopID(); } + template<> + static void DrawComponent(SHTrajectoryRenderableComponent* component) + { + if (!component) + return; + + ImGui::PushID(SHFamilyID::GetID()); + + 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 const& mesh = component->GetMesh(); + const auto MESH_NAME = SHResourceManager::GetAssetName(mesh).value_or(""); + SHEditorWidgets::DragDropReadOnlyField("Mesh", MESH_NAME, [component]() + { + Handle const& mesh = component->GetMesh(); + return SHResourceManager::GetAssetID(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(id)); + SHResourceManager::FinaliseChanges(); + }, SHDragDrop::DRAG_RESOURCE); + + if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) + { + if (Handle const& mesh = component->GetMesh()) + { + AssetID assetID = SHResourceManager::GetAssetID(mesh).value_or(0); + SHEditorWindowManager::GetEditorWindow()->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(); + } + } diff --git a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorInspector.cpp b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorInspector.cpp index c95221ec..faede2bd 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorInspector.cpp +++ b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorInspector.cpp @@ -180,6 +180,10 @@ namespace SHADE { DrawComponent(listenerComponent); } + if (auto trajectoryComponent = SHComponentManager::GetComponent_s(eid)) + { + DrawComponent(trajectoryComponent); + } ImGui::Separator(); // Render Scripts SHScriptEngine* scriptEngine = static_cast(SHSystemManager::GetSystem()); @@ -195,6 +199,7 @@ namespace SHADE DrawAddComponentButton(eid); DrawAddComponentButton(eid); DrawAddComponentButton(eid); + DrawAddComponentButton(eid); // Components that require Transforms diff --git a/SHADE_Engine/src/Editor/SHEditor.cpp b/SHADE_Engine/src/Editor/SHEditor.cpp index 346bfbed..6d71f98d 100644 --- a/SHADE_Engine/src/Editor/SHEditor.cpp +++ b/SHADE_Engine/src/Editor/SHEditor.cpp @@ -592,8 +592,10 @@ namespace SHADE { //Load the scene sceneToLoad = 0; +#ifdef SHEDITOR editorConfig->workingSceneID = assetID; SHConfigurationManager::SaveEditorConfig(); +#endif SHSceneManager::RestartScene(assetID); return true; } diff --git a/SHADE_Engine/src/Graphics/Images/SHVkImage.cpp b/SHADE_Engine/src/Graphics/Images/SHVkImage.cpp index 53703924..28870797 100644 --- a/SHADE_Engine/src/Graphics/Images/SHVkImage.cpp +++ b/SHADE_Engine/src/Graphics/Images/SHVkImage.cpp @@ -262,7 +262,7 @@ namespace SHADE copyRegions[i].imageSubresource.baseArrayLayer = 0; // TODO: Array textures not supported yet copyRegions[i].imageSubresource.layerCount = layerCount; 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); diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/GlobalData/SHGraphicsPredefinedData.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/GlobalData/SHGraphicsPredefinedData.cpp index 85559bc7..a15687cb 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/GlobalData/SHGraphicsPredefinedData.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/GlobalData/SHGraphicsPredefinedData.cpp @@ -59,6 +59,13 @@ namespace SHADE {SHPredefinedDescriptorTypes::STATIC_DATA, 0}, {SHPredefinedDescriptorTypes::CAMERA, 1}, }); + + perSystemData[SHUtilities::ConvertEnum(SystemType::PARTICLE_RENEDERING)].descMappings.AddMappings + ({ + {SHPredefinedDescriptorTypes::STATIC_DATA, 0}, + {SHPredefinedDescriptorTypes::CAMERA, 1}, + {SHPredefinedDescriptorTypes::PARTICLES, 2}, + }); } void SHGraphicsPredefinedData::InitDummyPipelineLayouts(Handle logicalDevice) noexcept @@ -194,6 +201,73 @@ namespace SHADE Handle materialBoneDataPerInstanceLayout = logicalDevice->CreateDescriptorSetLayout({ materialDataBinding, boneDataBinding }); SET_VK_OBJ_NAME(logicalDevice, vk::ObjectType::eDescriptorSetLayout, materialBoneDataPerInstanceLayout->GetVkHandle(), "[Descriptor Set Layout] Material and Bone Globals"); + // particle emitter binding + SHVkDescriptorSetLayout::Binding emitterDataBinding + { + .Type = vk::DescriptorType::eStorageBufferDynamic, + .Stage = vk::ShaderStageFlagBits::eCompute, + .BindPoint = SHGraphicsConstants::DescriptorSetBindings::PARTICLE_EMITTER_DATA, + .DescriptorCount = 1, + }; + + // particle input binding + SHVkDescriptorSetLayout::Binding particleInputDataBinding + { + .Type = vk::DescriptorType::eStorageBufferDynamic, + .Stage = vk::ShaderStageFlagBits::eCompute, + .BindPoint = SHGraphicsConstants::DescriptorSetBindings::PARTICLE_INPUT_DATA, + .DescriptorCount = 1, + }; + + // particle output binding + SHVkDescriptorSetLayout::Binding particleOutputDataBinding + { + .Type = vk::DescriptorType::eStorageBufferDynamic, + .Stage = vk::ShaderStageFlagBits::eCompute | vk::ShaderStageFlagBits::eVertex, + .BindPoint = SHGraphicsConstants::DescriptorSetBindings::PARTICLE_OUTPUT_DATA, + .DescriptorCount = 1, + }; + + // particle freelist binding + SHVkDescriptorSetLayout::Binding particleFreelistBinding + { + .Type = vk::DescriptorType::eStorageBuffer, // non dynamic because we only need 1 copy for all frames + .Stage = vk::ShaderStageFlagBits::eCompute, + .BindPoint = SHGraphicsConstants::DescriptorSetBindings::PARTICLE_FREELIST_DATA, + .DescriptorCount = 1, + }; + + // particle indices binding + SHVkDescriptorSetLayout::Binding particleIndicesBinding + { + .Type = vk::DescriptorType::eStorageBufferDynamic, // dynamic because we have multiple copies. + .Stage = vk::ShaderStageFlagBits::eCompute | vk::ShaderStageFlagBits::eVertex, + .BindPoint = SHGraphicsConstants::DescriptorSetBindings::PARTICLE_INDICES_DATA, + .DescriptorCount = 1, + }; + + // particle draw call binding + SHVkDescriptorSetLayout::Binding particleDrawDataBinding + { + .Type = vk::DescriptorType::eUniformBufferDynamic, // UBO (Because lesser data), dynamic (1 set for each frame) + .Stage = vk::ShaderStageFlagBits::eCompute, + .BindPoint = SHGraphicsConstants::DescriptorSetBindings::PARTICLE_DRAW_DATA, + .DescriptorCount = 1, + }; + + Handle particleDescSetLayout = logicalDevice->CreateDescriptorSetLayout( + { + emitterDataBinding, + particleInputDataBinding, + particleOutputDataBinding, + particleFreelistBinding, + particleIndicesBinding, + particleDrawDataBinding + }); + SET_VK_OBJ_NAME(logicalDevice, vk::ObjectType::eDescriptorSetLayout, particleDescSetLayout->GetVkHandle(), "[Descriptor Set Layout] Particle System Data"); + + + predefinedLayouts.push_back(staticGlobalLayout); predefinedLayouts.push_back(lightDataDescSetLayout); predefinedLayouts.push_back(cameraDataGlobalLayout); @@ -201,6 +275,7 @@ namespace SHADE predefinedLayouts.push_back(fontDataDescSetLayout); predefinedLayouts.push_back(shadowMapDescLayout); predefinedLayouts.push_back(materialBoneDataPerInstanceLayout); + predefinedLayouts.push_back(particleDescSetLayout); perSystemData[SHUtilities::ConvertEnum(SystemType::BATCHING)].descSetLayouts = GetPredefinedDescSetLayouts ( @@ -235,6 +310,13 @@ namespace SHADE SHGraphicsPredefinedData::PredefinedDescSetLayoutTypes::STATIC_DATA | SHGraphicsPredefinedData::PredefinedDescSetLayoutTypes::CAMERA ); + + perSystemData[SHUtilities::ConvertEnum(SystemType::PARTICLE_RENEDERING)].descSetLayouts = GetPredefinedDescSetLayouts + ( + SHGraphicsPredefinedData::PredefinedDescSetLayoutTypes::STATIC_DATA | + SHGraphicsPredefinedData::PredefinedDescSetLayoutTypes::CAMERA | + SHGraphicsPredefinedData::PredefinedDescSetLayoutTypes::PARTICLES + ); } void SHGraphicsPredefinedData::InitPredefinedVertexInputState(void) noexcept diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/GlobalData/SHGraphicsPredefinedData.h b/SHADE_Engine/src/Graphics/MiddleEnd/GlobalData/SHGraphicsPredefinedData.h index 77307f57..4fbf06c1 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/GlobalData/SHGraphicsPredefinedData.h +++ b/SHADE_Engine/src/Graphics/MiddleEnd/GlobalData/SHGraphicsPredefinedData.h @@ -29,7 +29,8 @@ namespace SHADE MATERIALS = 0b00001000, FONT = 0b00010000, SHADOW = 0b00100000, - MATERIAL_AND_BONES = 0b01000000 + MATERIAL_AND_BONES = 0b01000000, + PARTICLES = 0b10000000 }; enum class SystemType @@ -39,6 +40,7 @@ namespace SHADE TEXT_RENDERING, RENDER_GRAPH_NODE_COMPUTE, TRAJECTORY_RENDERING, + PARTICLE_RENEDERING, NUM_TYPES }; static constexpr int SYSTEM_TYPE_COUNT = static_cast(SystemType::NUM_TYPES); diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/GlobalData/SHPredefinedDescriptorTypes.h b/SHADE_Engine/src/Graphics/MiddleEnd/GlobalData/SHPredefinedDescriptorTypes.h index 723a3c5a..0b6f0c2f 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/GlobalData/SHPredefinedDescriptorTypes.h +++ b/SHADE_Engine/src/Graphics/MiddleEnd/GlobalData/SHPredefinedDescriptorTypes.h @@ -16,5 +16,6 @@ namespace SHADE FONT, RENDER_GRAPH_NODE_COMPUTE_RESOURCE, RENDER_GRAPH_RESOURCE, + PARTICLES, }; } diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsConstants.h b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsConstants.h index 71d77e2d..d2fcb77e 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsConstants.h +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsConstants.h @@ -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 UI_SUBPASS = "UI"; 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::array USABLE_SUBPASSES = @@ -233,6 +233,61 @@ namespace SHADE */ /***************************************************************************/ static constexpr uint32_t BONE_MATRIX_DATA = 1; + + /***************************************************************************/ + /*! + \brief + Descriptor set binding for particle emitter data. + + */ + /***************************************************************************/ + static constexpr uint32_t PARTICLE_EMITTER_DATA = 0; + + /***************************************************************************/ + /*! + \brief + Descriptor set binding for input particle data. + + */ + /***************************************************************************/ + static constexpr uint32_t PARTICLE_INPUT_DATA = 1; + + /***************************************************************************/ + /*! + \brief + Descriptor set binding for output particle data. + + */ + /***************************************************************************/ + static constexpr uint32_t PARTICLE_OUTPUT_DATA = 2; + + /***************************************************************************/ + /*! + \brief + Descriptor set binding for particle freelist data. + + */ + /***************************************************************************/ + static constexpr uint32_t PARTICLE_FREELIST_DATA = 3; + + /***************************************************************************/ + /*! + \brief + Descriptor set binding for particle indices data. + + */ + /***************************************************************************/ + static constexpr uint32_t PARTICLE_INDICES_DATA = 4; + + /***************************************************************************/ + /*! + \brief + Descriptor set binding for bone matrix data. + + */ + /***************************************************************************/ + static constexpr uint32_t PARTICLE_DRAW_DATA = 5; + }; struct VertexBufferBindings @@ -307,6 +362,7 @@ namespace SHADE */ /***************************************************************************/ 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 GLYPH_INDEX = 1; diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp index 4681c4ae..e7f1ae68 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp @@ -337,7 +337,7 @@ namespace SHADE /* 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 vfxSubpass = vfxPass->AddSubpass("Vfx Subpass", worldViewport, worldRenderer); + auto vfxSubpass = vfxPass->AddSubpass(SHGraphicsConstants::RenderGraphEntityNames::VFX_SUBPASS.data(), worldViewport, worldRenderer); vfxSubpass->AddColorOutput("Scene"); vfxSubpass->AddDepthOutput("Depth Buffer"); vfxSubpass->AddExteriorDrawCalls([=](Handle cmdBuffer, Handle renderer, uint32_t frameIndex) @@ -485,8 +485,8 @@ namespace SHADE trajectoryRenderingSubSystem = resourceManager.Create(); - auto vfxNode = renderGraph->GetNode(SHGraphicsConstants::RenderGraphEntityNames::SCREEN_SPACE_PASS.data()); - trajectoryRenderingSubSystem->Init(device, vfxNode->GetRenderpass(), vfxNode->GetSubpass(SHGraphicsConstants::RenderGraphEntityNames::UI_SUBPASS), trajectoryVS, trajectoryFS); + auto vfxNode = renderGraph->GetNode(SHGraphicsConstants::RenderGraphEntityNames::VFX_PASS.data()); + trajectoryRenderingSubSystem->Init(device, vfxNode->GetRenderpass(), vfxNode->GetSubpass(SHGraphicsConstants::RenderGraphEntityNames::VFX_SUBPASS), trajectoryVS, trajectoryFS); SHGlobalDescriptorSets::SetLightingSubSystem(lightingSubSystem); diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleEmitterComponent.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleEmitterComponent.cpp new file mode 100644 index 00000000..12690ece --- /dev/null +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleEmitterComponent.cpp @@ -0,0 +1,23 @@ +#include "SHpch.h" +#include "SHParticleEmitterComponent.h" + +namespace SHADE +{ + + void SHParticleEmitterComponent::OnCreate(void) + { + timeBeforeEmission = emissionInterval; + + } + + void SHParticleEmitterComponent::OnDestroy(void) + { + + } + + void SHParticleEmitterComponent::Emit(void) noexcept + { + toEmit = true; + } + +} \ No newline at end of file diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleEmitterComponent.h b/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleEmitterComponent.h new file mode 100644 index 00000000..30f7f107 --- /dev/null +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleEmitterComponent.h @@ -0,0 +1,111 @@ +#pragma once + +#include "Resource/SHHandle.h" +#include "Math/Vector/SHVec4.h" +#include "ECS_Base/Components/SHComponent.h" +#include "Graphics/MiddleEnd/Interface/SHGraphicsConstants.h" + +namespace SHADE +{ + class SHVkBuffer; + class SHVkDescriptorSetGroup; + class SHVkDescriptorSetLayout; + + class SHParticleEmitterComponent : public SHComponent + { + private: + struct GPUEmitterStruct + { + //! Minimum emitting angular range + SHVec4 angularMin; + + //! Maximum emitting angular range + SHVec4 angularMax; + + //! Spawn lifetime and size range (min and max) + SHVec4 lifeAndSizeRange; + }; + + struct GPUParticleStruct + { + //! Position of the particle + SHVec4 position; + + //! Rotation of the particle + SHVec4 rotation; + + //! Velocity of the particle + SHVec4 velocity; + + //! Acceleration of the particle + SHVec4 acceleration; + + //! x scale, x scale decay, y scale and y scale decay + SHVec4 scaleAndDecay; + + //! Life of the particle + float life; + + //! Texture into the desc array that the particle is using + uint32_t textureIndex; + }; + + //! Max number of particles of this emitter + uint32_t maxParticles; + + //! num bytes of all particles in 1 chunk (1 frame) + uint32_t chunkSize; + + //! emission count per emit + uint32_t emissionCount; + + //! emission interval of the emitter + float emissionInterval; + + //! Counter that decreases to 0 from emissionInterval. When 0, emit particles. + float timeBeforeEmission; + + //! Data for the emitter + Handle emitterData; + + //! GPU Particle data + Handle particleData; + + //! Freelist data + Handle freelistData; + + //! Indices data + Handle indicesData; + + //! draw call data + Handle drawCallData; + + //! We need more descriptor sets because the operations on a frame's particle data needs to rely on the previous frame's. Each set + //! will contain 2 bindings that point to 2 buffers (input and output). + Handle particleDescriptorSet; + + //! Emitter's data on the CPU side. To be copied to GPU. + GPUEmitterStruct cpuEmitterData; + + //! If passive, emitter emits particles based on timer above. + bool isPassive; + + //! Have the particle system initialize variables in this component when this is false + bool initialized; + + //! If true, particle system will emit particles in Run function. Sets to false every frame. + bool toEmit; + + //! For all the dynamic SSBOs in the descriptor set + std::array, SHGraphicsConstants::NUM_FRAME_BUFFERS> dynamicOffsets{}; + + public: + void OnCreate(void) override final; + void OnDestroy(void) override final; + + void Emit (void) noexcept; + + friend class SHParticleSubSystem; + + }; +} diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleSubSustem.h b/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleSubSustem.h deleted file mode 100644 index da806480..00000000 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleSubSustem.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include "Resource/SHHandle.h" -#include "Graphics/Pipeline/SHPipelineState.h" -#include "Math/SHMatrix.h" - -namespace SHADE -{ - class SHVkLogicalDevice; - class SHVkDescriptorPool; - class SHVkDescriptorSetGroup; - class SHVkDescriptorSetLayout; - class SHVkBuffer; - class SHLightComponent; - class SHVkCommandBuffer; - class SHVkPipeline; - class SHVkPipelineLayout; - class SHVkRenderpass; - class SHSubpass; - class SHVkShaderModule; - class SHRenderer; - - - - class SHParticleSubSystem - { - private: - - Handle logicalDevice; - - - public: - void Init(Handle device, Handle compatibleRenderpass, Handle subpass) noexcept; - - void Run(uint32_t frameIndex) noexcept; - - void Render(Handle cmdBuffer, Handle renderer, uint32_t frameIndex) noexcept; - void Exit(void) noexcept; - - }; -} diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleSubSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleSubSystem.cpp index eb3c4f1a..7c3d9c74 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleSubSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleSubSystem.cpp @@ -1,7 +1,309 @@ #include "SHpch.h" -#include "SHParticleSubSustem.h" +#include "SHParticleSubSystem.h" +#include "Graphics/Pipeline/SHPipelineLayoutParams.h" +#include "Graphics/MiddleEnd/GlobalData/SHGraphicsPredefinedData.h" +#include "Graphics/Devices/SHVkLogicalDevice.h" +#include "Graphics/MiddleEnd/Particles/SHParticleEmitterComponent.h" +#include "ECS_Base/Managers/SHComponentManager.h" +#include "Graphics/Descriptors/SHVkDescriptorSetGroup.h" +#include "Graphics/Descriptors/SHVkDescriptorSetLayout.h" +#include "Graphics/MiddleEnd/GlobalData/SHGlobalDescriptorSets.h" +#include "Math/Transform/SHTransformComponent.h" +#include "Graphics/Buffers/SHVkBuffer.h" namespace SHADE { - + + void SHParticleSubSystem::InitializeComponent(SHParticleEmitterComponent& comp) noexcept + { + uint32_t emitterStructAligned = logicalDevice->PadSSBOSize(sizeof (SHParticleEmitterComponent::GPUEmitterStruct)); + uint32_t particleStructAligned = logicalDevice->PadUBOSize(sizeof (SHParticleEmitterComponent::GPUParticleStruct)); + uint32_t sizeofIndirectCmd = static_cast(sizeof(vk::DrawIndirectCommand)); + uint32_t sizeofUint = static_cast(sizeof(uint32_t)); + + // TODO: temporary only. + static constexpr uint32_t NUM_PARTICLES = 500; + comp.maxParticles = NUM_PARTICLES; + + // offset into the buffer for input and output + uint32_t const PARTICLE_FRAME_CHUNK_SIZE = (particleStructAligned * comp.maxParticles); + + // Buffer Initialization + { + // count, value + std::vector freelistInit(comp.maxParticles + 1, 0); + freelistInit[0] = comp.maxParticles; + + // Particle emitter buffer. Multiple copies, Host-visible mapped. We want multiple copies because we'll be writing to it from the CPU. We don't want to do that while the GPU + // is using it during compute operations so we write to another portion. + comp.emitterData = logicalDevice->CreateBuffer(SHGraphicsConstants::NUM_FRAME_BUFFERS * emitterStructAligned, nullptr, 0, vk::BufferUsageFlagBits::eStorageBuffer, VMA_MEMORY_USAGE_AUTO, VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_MAPPED_BIT); + + // buffer for particle data: pure GPU memory, no transfers, no flags. We want to triple buffer this so that we can submit work to the GPU + // without having to wait for rendering to finish reading the data + comp.particleData = logicalDevice->CreateBuffer(SHGraphicsConstants::NUM_FRAME_BUFFERS * particleStructAligned * NUM_PARTICLES, nullptr, 0, vk::BufferUsageFlagBits::eStorageBuffer, VMA_MEMORY_USAGE_AUTO, {}); + + // Buffer for freelist data. 1 copy only, host-visible mapped. We only need 1 copy because it is only required in compute. If it was used or read in another + // stage we would need more copies. + comp.freelistData = logicalDevice->CreateBuffer(sizeofUint * (comp.maxParticles + 1), freelistInit.data(), sizeofUint * (comp.maxParticles + 1), vk::BufferUsageFlagBits::eStorageBuffer, VMA_MEMORY_USAGE_AUTO, VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_MAPPED_BIT); + + // Buffer for indices. NUM_FRAME_BUFFERS copies since it's used in rendering. host-visible mapped. + comp.indicesData = logicalDevice->CreateBuffer(sizeofUint * comp.maxParticles, nullptr, 0, vk::BufferUsageFlagBits::eStorageBuffer, VMA_MEMORY_USAGE_AUTO, VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_MAPPED_BIT); + + // Draw call data will not be tampered with after this initialization except for one variable: instanceCount, which will be modified from compute shader + std::array indirectCommands{}; + for (auto& cmd : indirectCommands) + { + cmd.vertexCount = 4; + cmd.firstVertex = 0; + cmd.firstInstance = 0; + cmd.instanceCount = 0; + } + + // buffer to store draw call data. Non-indexed, host-visible mapped, triple buffered. + comp.drawCallData = logicalDevice->CreateBuffer(SHGraphicsConstants::NUM_FRAME_BUFFERS * sizeofIndirectCmd, indirectCommands.data(), SHGraphicsConstants::NUM_FRAME_BUFFERS * sizeofIndirectCmd, vk::BufferUsageFlagBits::eUniformBuffer | vk::BufferUsageFlagBits::eIndirectBuffer, VMA_MEMORY_USAGE_AUTO, VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_MAPPED_BIT); + + } + + // Descriptor set initialization + { + // Get particle desc set layout + auto descSetLayout = SHGraphicsPredefinedData::GetPredefinedDescSetLayouts(SHGraphicsPredefinedData::PredefinedDescSetLayoutTypes::PARTICLES); + + // Since we are populating the set as is, the set index will be 0 + static constexpr uint32_t PARTICLE_DATA_SET_INDEX = 0; + + // Variable desc counts, all ignored anyway (This is required but its a dumb interface. You can only blame yourself, Brandon. ) + std::vector const VARIABLE_COUNTS = {0u,0u,0u,0u,0u}; + + // allocate new desc set + comp.particleDescriptorSet = descPool->Allocate(descSetLayout, VARIABLE_COUNTS); + + // convenience handle + auto set = comp.particleDescriptorSet; + + // After buffers are created, we want to populate all bindings(6) with the buffers + set->ModifyWriteDescBuffer(PARTICLE_DATA_SET_INDEX, SHGraphicsConstants::DescriptorSetBindings::PARTICLE_EMITTER_DATA, { &comp.emitterData, 1 }, 0, emitterStructAligned); + set->ModifyWriteDescBuffer(PARTICLE_DATA_SET_INDEX, SHGraphicsConstants::DescriptorSetBindings::PARTICLE_INPUT_DATA, { &comp.particleData, 1 }, 0, PARTICLE_FRAME_CHUNK_SIZE); // input and output will be th same until we bind using dynamic offsets + set->ModifyWriteDescBuffer(PARTICLE_DATA_SET_INDEX, SHGraphicsConstants::DescriptorSetBindings::PARTICLE_OUTPUT_DATA, { &comp.particleData, 1 }, 0, PARTICLE_FRAME_CHUNK_SIZE); + set->ModifyWriteDescBuffer(PARTICLE_DATA_SET_INDEX, SHGraphicsConstants::DescriptorSetBindings::PARTICLE_FREELIST_DATA, { &comp.freelistData, 1 }, 0, sizeofUint * (comp.maxParticles + 1)); + set->ModifyWriteDescBuffer(PARTICLE_DATA_SET_INDEX, SHGraphicsConstants::DescriptorSetBindings::PARTICLE_INDICES_DATA, { &comp.indicesData, 1 }, 0, sizeofUint * (comp.maxParticles)); + set->ModifyWriteDescBuffer(PARTICLE_DATA_SET_INDEX, SHGraphicsConstants::DescriptorSetBindings::PARTICLE_DRAW_DATA, { &comp.drawCallData, 1 }, 0, sizeofIndirectCmd); + } + + comp.initialized = true; + comp.timeBeforeEmission = comp.emissionInterval; + comp.toEmit = false; + comp.chunkSize = PARTICLE_FRAME_CHUNK_SIZE; + + for (uint32_t i = 0; i < SHGraphicsConstants::NUM_FRAME_BUFFERS; ++i) + { + auto& offsets = comp.dynamicOffsets[i]; + + uint32_t inputOffset = PARTICLE_FRAME_CHUNK_SIZE * ((i + SHGraphicsConstants::NUM_FRAME_BUFFERS - 1) % SHGraphicsConstants::NUM_FRAME_BUFFERS); // take previous frame's data + uint32_t outputOffset = PARTICLE_FRAME_CHUNK_SIZE * i; + + // In the order of: + // 1. Emitter data + // 2. Particle input + // 3. Particle output + // 4. Particle draw data + offsets[DYOFF_INDEX_EMITTER] = i * emitterStructAligned; + offsets[DYOFF_INDEX_PARTICLE_INPUT] = inputOffset; + offsets[DYOFF_INDEX_PARTICLE_OUTPUT] = outputOffset; + offsets[DYOFF_INDEX_INDICES_DATA] = i * sizeofUint * comp.maxParticles; + offsets[DYOFF_INDEX_DRAW_DATA] = i * sizeofIndirectCmd; + } + } + + void SHParticleSubSystem::EmitComponent(Handle cmdBuffer, SHParticleEmitterComponent& comp, uint32_t frameIndex) noexcept + { + auto const& mappings = SHGraphicsPredefinedData::GetMappings(SHGraphicsPredefinedData::SystemType::PARTICLE_RENEDERING); + auto* transform = SHComponentManager::GetComponent(comp.GetEID()); + + // bind the descriptor sets required for emitting particles + cmdBuffer->BindDescriptorSet(comp.particleDescriptorSet, SH_PIPELINE_TYPE::COMPUTE, mappings.at(SHPredefinedDescriptorTypes::PARTICLES), comp.dynamicOffsets[frameIndex]); + + cmdBuffer->SetPushConstantVariable("EmitterPushConstant.emitterPosition", transform->GetWorldPosition(), SH_PIPELINE_TYPE::COMPUTE); + cmdBuffer->SetPushConstantVariable("EmitterPushConstant.emissionCount", comp.emissionCount, SH_PIPELINE_TYPE::COMPUTE); + + // emit particles + cmdBuffer->ComputeDispatch((comp.emissionCount / EMITTER_WORKGROUP_SIZE) + 1, 1, 1); + } + + void SHParticleSubSystem::UpdateCompoennt(Handle cmdBuffer, SHParticleEmitterComponent& comp, uint32_t frameIndex) noexcept + { + auto const& mappings = SHGraphicsPredefinedData::GetMappings(SHGraphicsPredefinedData::SystemType::PARTICLE_RENEDERING); + + uint32_t instanceCountOffset = sizeof (vk::DrawIndirectCommand) * frameIndex + offsetof(vk::DrawIndirectCommand, instanceCount); + uint32_t ZERO = 0; + + // reset instance count to 0 + comp.drawCallData->WriteToMemory (&ZERO, sizeof(uint32_t), 0, instanceCountOffset); + + + // bind the descriptor sets required for emitting particles + cmdBuffer->BindDescriptorSet(comp.particleDescriptorSet, SH_PIPELINE_TYPE::COMPUTE, mappings.at(SHPredefinedDescriptorTypes::PARTICLES), comp.dynamicOffsets[frameIndex]); + + // dispatch the compute shaders to update particles + cmdBuffer->ComputeDispatch((comp.maxParticles / EMITTER_WORKGROUP_SIZE) + 1, 1, 1); + } + + void SHParticleSubSystem::RenderComponent(Handle cmdBuffer, SHParticleEmitterComponent& comp, uint32_t frameIndex) noexcept + { + + } + + void SHParticleSubSystem::Init(Handle device, Handle inDescPool, Handle compatibleRenderpass, Handle subpass, Handle VS, Handle FS, Handle emitCS, Handle defaultUpdateCS) noexcept + { + descPool = inDescPool; + logicalDevice = device; + + /*-----------------------------------------------------------------------*/ + /* INITIALIZE ALL PIPELINES */ + /*-----------------------------------------------------------------------*/ + SHPipelineLayoutParams plParams + { + .shaderModules = {VS, FS}, + .predefinedDescSetLayouts = SHGraphicsPredefinedData::GetSystemData(SHGraphicsPredefinedData::SystemType::PARTICLE_RENEDERING).descSetLayouts + }; + + renderingPipelineData.pipelineLayout = logicalDevice->CreatePipelineLayout(plParams); + renderingPipelineData.pipeline = logicalDevice->CreateGraphicsPipeline(renderingPipelineData.pipelineLayout, nullptr, compatibleRenderpass, subpass); + + SHPipelineLayoutParams emitPlParams + { + .shaderModules = {emitCS}, + .predefinedDescSetLayouts = SHGraphicsPredefinedData::GetSystemData(SHGraphicsPredefinedData::SystemType::PARTICLE_RENEDERING).descSetLayouts + }; + + emittingPipelineData.pipelineLayout = logicalDevice->CreatePipelineLayout(emitPlParams); + emittingPipelineData.pipeline = logicalDevice->CreateComputePipeline(emittingPipelineData.pipelineLayout); + + SHPipelineLayoutParams defaultUpdatePlParams + { + .shaderModules = {defaultUpdateCS}, + .predefinedDescSetLayouts = SHGraphicsPredefinedData::GetSystemData(SHGraphicsPredefinedData::SystemType::PARTICLE_RENEDERING).descSetLayouts + }; + + defaultUpdatePipelineData.pipelineLayout = logicalDevice->CreatePipelineLayout(defaultUpdatePlParams); + defaultUpdatePipelineData.pipeline = logicalDevice->CreateComputePipeline(defaultUpdatePipelineData.pipelineLayout); + + + /*-----------------------------------------------------------------------*/ + /* OTHER INITIALIZATION */ + /*-----------------------------------------------------------------------*/ + SHComponentManager::CreateComponentSparseSet(); + } + + void SHParticleSubSystem::Run(Handle cmdBuffer, uint32_t frameIndex, float dt) noexcept + { + auto& emitters = SHComponentManager::GetDense(); + auto const& mappings = SHGraphicsPredefinedData::GetMappings(SHGraphicsPredefinedData::SystemType::PARTICLE_RENEDERING); + + // Get offset into GPU emitter data (for updating) + uint32_t emitterDataOffset = frameIndex * sizeof (SHParticleEmitterComponent::GPUEmitterStruct); + + // Barriers to make sure emitting shader is done completely before update is run. + // Every emitter will have its own barrier. + std::vector preUpdateBarriers{}; + preUpdateBarriers.resize(emitters.size()); + + // If we wanted to be VERY safe, a barrier would be good here to make sure output particles have finish reading input particles in + // the update compute. HOWEVER since a NUM_FRAME_BUFFERS frames would have passed by then, we will not insert 1 here. + + /*-----------------------------------------------------------------------*/ + /* BEGIN EMITTING PARTICES */ + /*-----------------------------------------------------------------------*/ + + // TODO: Might need to issue a barrier here for input particle data + + // bind the pipeline for emitting particles + cmdBuffer->BindPipeline(emittingPipelineData.pipeline); + + // Generic data + SHGlobalDescriptorSets::BindGenericAndTextureData(logicalDevice, cmdBuffer, SH_PIPELINE_TYPE::COMPUTE, mappings.at(SHPredefinedDescriptorTypes::STATIC_DATA), frameIndex); + + uint32_t i = 0; + for (auto& emitter : emitters) + { + if (!emitter.initialized) + InitializeComponent(emitter); + + // Set emitter emit flag to true here if there are ready to be emitted + if (emitter.isPassive) + { + // decrement emission timer + emitter.timeBeforeEmission -= dt; + + // Check if time to emit + if (emitter.timeBeforeEmission <= 0.0f) + { + // reset timer + emitter.timeBeforeEmission = emitter.emissionInterval; + + // Emit later + emitter.toEmit = true; + } + } + + if (emitter.toEmit) // take note that if emitter is not passive, this can also be set to true outside of this function + { + // Copy data to host visible buffer of emitter + emitter.emitterData->WriteToMemory (&emitter.cpuEmitterData, sizeof (SHParticleEmitterComponent::GPUEmitterStruct), 0, emitterDataOffset); + + // Call emit function here + EmitComponent(cmdBuffer, emitter, frameIndex); + } + + // make new barrier on stack... + vk::BufferMemoryBarrier barrier + { + .srcAccessMask = vk::AccessFlagBits::eShaderWrite, + .dstAccessMask = vk::AccessFlagBits::eShaderRead, + .buffer = emitter.particleData->GetVkBuffer(), + .offset = emitter.dynamicOffsets[frameIndex][DYOFF_INDEX_PARTICLE_INPUT], + .size = emitter.chunkSize + }; + + // ...copy assign barrier on heap + preUpdateBarriers[i] = barrier; + + emitter.toEmit = false; + ++i; + } + + // issue the barrier to wait + cmdBuffer->PipelineBarrier(vk::PipelineStageFlagBits::eComputeShader, vk::PipelineStageFlagBits::eComputeShader, {}, {}, preUpdateBarriers, {}); + + /*-----------------------------------------------------------------------*/ + /* EMITTING PARTICLES DONE, BEGIN UPDATES.... */ + /*-----------------------------------------------------------------------*/ + + // bind the pipeline for updating + cmdBuffer->BindPipeline(defaultUpdatePipelineData.pipeline); + + for (auto& emitter : emitters) + { + UpdateCompoennt(cmdBuffer, emitter, frameIndex); + } + + + } + + void SHParticleSubSystem::Render(Handle cmdBuffer, Handle renderer, uint32_t frameIndex) noexcept + { + auto& emitters = SHComponentManager::GetDense(); + + // TODO: Issue barrier for output particle data. Semaphore should also be issued outside in SHGraphicsSystem + for (auto& emitter : emitters) + { + + } + } + + void SHParticleSubSystem::Exit(void) noexcept + { + + } + } \ No newline at end of file diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleSubSystem.h b/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleSubSystem.h new file mode 100644 index 00000000..ed697a59 --- /dev/null +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Particles/SHParticleSubSystem.h @@ -0,0 +1,93 @@ +#pragma once + +#include "Resource/SHHandle.h" +#include "Graphics/Pipeline/SHPipelineState.h" +#include "Math/SHMatrix.h" + +namespace SHADE +{ + class SHVkLogicalDevice; + class SHVkDescriptorPool; + class SHVkDescriptorSetGroup; + class SHVkDescriptorSetLayout; + class SHVkBuffer; + class SHLightComponent; + class SHVkCommandBuffer; + class SHVkPipeline; + class SHVkPipelineLayout; + class SHVkRenderpass; + class SHSubpass; + class SHVkShaderModule; + class SHRenderer; + class SHParticleEmitterComponent; + + + + class SHParticleSubSystem + { + private: + static constexpr uint32_t EMITTER_WORKGROUP_SIZE = 128; + static constexpr uint32_t DYOFF_INDEX_EMITTER = 0; + static constexpr uint32_t DYOFF_INDEX_PARTICLE_INPUT = 1; + static constexpr uint32_t DYOFF_INDEX_PARTICLE_OUTPUT = 2; + static constexpr uint32_t DYOFF_INDEX_INDICES_DATA = 3; + static constexpr uint32_t DYOFF_INDEX_DRAW_DATA = 4; + + + // To hold data for a pipeline and pipeline layout. + // We want this here because particles require 3 pipeline sets: + // - Rendering + // - Emit Compute + // - Update Compute + struct PipelineData + { + //! Pipeline + Handle pipeline; + + //! Pipeline layout for pipeline creation + Handle pipelineLayout; + }; + +#if 0 // not used, mainly for convenience to show what shaders use + // Push constant data for emitters + struct EmitterShaderPC + { + //! Emitter position + SHVec4 emitterPosition; + + //! emission count for 1 single emission + uint32_t emissionCount; + }; +#endif + + //! Logical device for creation and destruction + Handle logicalDevice; + + //! Pipeline data for rendering particles + PipelineData renderingPipelineData; + + //! Pipeline data for emitting particles + PipelineData emittingPipelineData; + + //! Pipeline data for updating particles + PipelineData defaultUpdatePipelineData; + + //! Desc pool for particle component desc set allocation + Handle descPool; + + + void InitializeComponent (SHParticleEmitterComponent& comp) noexcept; + void EmitComponent (Handle cmdBuffer, SHParticleEmitterComponent& comp, uint32_t frameIndex) noexcept; + void UpdateCompoennt(Handle cmdBuffer, SHParticleEmitterComponent& comp, uint32_t frameIndex) noexcept; + void RenderComponent(Handle cmdBuffer, SHParticleEmitterComponent& comp, uint32_t frameIndex) noexcept; + + public: + void Init(Handle device, Handle inDescPool, Handle compatibleRenderpass, Handle subpass, Handle VS, Handle FS, Handle emitCS, Handle defaultUpdateCS) noexcept; + + void Run(Handle cmdBuffer, uint32_t frameIndex, float dt) noexcept; + + void Render(Handle cmdBuffer, Handle renderer, uint32_t frameIndex) noexcept; + void Exit(void) noexcept; + + }; +} diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHTextRenderableComponent.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHTextRenderableComponent.cpp index a7a3d2ed..5703a9c1 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHTextRenderableComponent.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHTextRenderableComponent.cpp @@ -29,6 +29,8 @@ namespace SHADE // Default white color. color = SHColour::WHITE; + + textSize = SHVec3::One; } void SHTextRenderableComponent::OnDestroy(void) @@ -61,11 +63,16 @@ namespace SHADE MakeDirty(); } - void SHTextRenderableComponent::SetColour(SHColour const& newColor) noexcept + void SHTextRenderableComponent::SetColor(SHColour const& newColor) noexcept { color = newColor; } + void SHTextRenderableComponent::SetTextSize(SHVec3 const& size) noexcept + { + textSize = size; + } + /***************************************************************************/ /*! @@ -87,11 +94,16 @@ namespace SHADE return fontHandle; } - SHADE::SHColour const& SHTextRenderableComponent::GetColour(void) const noexcept + SHADE::SHColour const& SHTextRenderableComponent::GetColor(void) const noexcept { return color; } + SHVec3 const& SHTextRenderableComponent::GetTextSize(void) const noexcept + { + return textSize; + } + } namespace rttr diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHTextRenderableComponent.h b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHTextRenderableComponent.h index d34e7c38..81d3a85f 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHTextRenderableComponent.h +++ b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHTextRenderableComponent.h @@ -40,6 +40,9 @@ namespace SHADE //! character position data for each letter in the text Handle charPositionDataBuffer; + //! Text size. Multiplied to TRS. + SHVec3 textSize; + void MakeDirty (void) noexcept; void Clean (void) noexcept; @@ -52,11 +55,13 @@ namespace SHADE /*-----------------------------------------------------------------------*/ void SetText (std::string_view newText) noexcept; void SetFont(Handle font) noexcept; - void SetColour(SHColour const& newColor) noexcept; + void SetColor(SHColour const& newColor) noexcept; + void SetTextSize (SHVec3 const& size) noexcept; std::string const& GetText (void) const noexcept; Handle GetFont (void) const noexcept; - SHColour const& GetColour (void) const noexcept; + SHColour const& GetColor (void) const noexcept; + SHVec3 const& GetTextSize (void) const noexcept; friend class SHTextRenderingSubSystem; diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHTextRenderingSubSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHTextRenderingSubSystem.cpp index 9ab6106d..ff9168c9 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHTextRenderingSubSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHTextRenderingSubSystem.cpp @@ -210,10 +210,13 @@ namespace SHADE cmdBuffer->BindVertexBuffer(SHGraphicsConstants::VertexBufferBindings::CALCULATED_GLYPH_POSITION, comp.charPositionDataBuffer, 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(comp.GetEID())) - cmdBuffer->SetPushConstantVariable("TestPushConstant.worldTransform", uiComp->GetMatrix(), SH_PIPELINE_TYPE::GRAPHICS); + cmdBuffer->SetPushConstantVariable("TestPushConstant.worldTransform", textSizeScale * uiComp->GetMatrix(), SH_PIPELINE_TYPE::GRAPHICS); 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); diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Textures/SHTextureLibrary.h b/SHADE_Engine/src/Graphics/MiddleEnd/Textures/SHTextureLibrary.h index bbc72a1a..e1c93349 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Textures/SHTextureLibrary.h +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Textures/SHTextureLibrary.h @@ -71,7 +71,7 @@ namespace SHADE //! of the texture library would mean the recreation of the desc set that also //! involves the generic data, which is bad bad bad. Solution is to separate the //! 2 desc sets. - static constexpr uint32_t DEFAULT_MAX_TEXTURES = 2000; + static constexpr uint32_t DEFAULT_MAX_TEXTURES = 1000; /*-----------------------------------------------------------------------------*/ /* Usage Functions */ diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.cpp index 77dd66c8..91c11e60 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.cpp @@ -42,16 +42,26 @@ namespace SHADE return mesh; } - SHVec4 const& SHTrajectoryRenderableComponent::GetStartColor(void) const noexcept + SHVec3 const& SHTrajectoryRenderableComponent::GetStartColor(void) const noexcept { return startColor; } - SHVec4 const& SHTrajectoryRenderableComponent::GetEndColor(void) const noexcept + SHVec3 const& SHTrajectoryRenderableComponent::GetEndColor(void) const noexcept { return endColor; } + float SHTrajectoryRenderableComponent::GetStartAlpha(void) const noexcept + { + return startAlpha; + } + + float SHTrajectoryRenderableComponent::GetEndAlpha(void) const noexcept + { + return endAlpha; + } + float SHTrajectoryRenderableComponent::GetColorEvolveRate(void) const noexcept { return colorEvolveRate; @@ -67,17 +77,27 @@ namespace SHADE positions = inPositions; } - void SHTrajectoryRenderableComponent::SetStartColor(SHVec4 color) noexcept + void SHTrajectoryRenderableComponent::SetStartColor(SHVec3 color) noexcept { startColor = color; } - void SHTrajectoryRenderableComponent::SetEndColor(SHVec4 color) noexcept + void SHTrajectoryRenderableComponent::SetEndColor(SHVec3 color) noexcept { endColor = color; } + void SHTrajectoryRenderableComponent::SetStartAlpha(float a) noexcept + { + startAlpha = a; + } + + void SHTrajectoryRenderableComponent::SetEndAlpha(float a) noexcept + { + endAlpha = a; + } + void SHTrajectoryRenderableComponent::SetColorEvolveRate(float rate) noexcept { colorEvolveRate = rate; diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.h b/SHADE_Engine/src/Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.h index d6f7be12..f3744d83 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.h +++ b/SHADE_Engine/src/Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.h @@ -10,7 +10,7 @@ namespace SHADE { class SHMesh; - class SHTrajectoryRenderableComponent : public SHComponent + class SH_API SHTrajectoryRenderableComponent : public SHComponent { private: @@ -21,10 +21,16 @@ namespace SHADE std::vector positions; //! Starting color of the trajectory - SHVec4 startColor; + SHVec3 startColor; //! Color the trajectory should evolve to the longer it is - SHVec4 endColor; + SHVec3 endColor; + + //! Starting alpha of the trajectory + float startAlpha; + + //! end alpha of the trajectory + float endAlpha; //! evolving rate of the color float colorEvolveRate; @@ -35,14 +41,18 @@ namespace SHADE /*-----------------------------------------------------------------------*/ void SetMesh(Handle newMesh) noexcept; void SetPositions (std::vector const& inPositions) noexcept; - void SetStartColor(SHVec4 startColor) noexcept; - void SetEndColor (SHVec4 endColor) noexcept; - void SetColorEvolveRate (float rate) noexcept; + void SetStartColor(SHVec3 startColor) noexcept; + void SetEndColor (SHVec3 endColor) noexcept; + void SetStartAlpha(float a) noexcept; + void SetEndAlpha (float a) noexcept; + void SetColorEvolveRate(float rate) noexcept; std::vector GetPositions (void) const noexcept; Handle GetMesh (void) const noexcept; - SHVec4 const& GetStartColor (void) const noexcept; - SHVec4 const& GetEndColor (void) const noexcept; + SHVec3 const& GetStartColor (void) const noexcept; + SHVec3 const& GetEndColor (void) const noexcept; + float GetStartAlpha (void) const noexcept; + float GetEndAlpha (void) const noexcept; float GetColorEvolveRate (void) const noexcept; void OnCreate(void) override final; diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderingSubSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderingSubSystem.cpp index 802d085d..cbf593d4 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderingSubSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderingSubSystem.cpp @@ -59,8 +59,8 @@ namespace SHADE .srcColorBlendFactor = vk::BlendFactor::eSrcAlpha, .dstColorBlendFactor = vk::BlendFactor::eOneMinusSrcAlpha, .colorBlendOp = vk::BlendOp::eAdd, - .srcAlphaBlendFactor = vk::BlendFactor::eOne, - .dstAlphaBlendFactor = vk::BlendFactor::eZero, + .srcAlphaBlendFactor = vk::BlendFactor::eSrcAlpha, + .dstAlphaBlendFactor = vk::BlendFactor::eOneMinusSrcAlpha, .alphaBlendOp = vk::BlendOp::eAdd, .colorWriteMask = vk::ColorComponentFlagBits::eR | vk::ColorComponentFlagBits::eG | vk::ColorComponentFlagBits::eB | vk::ColorComponentFlagBits::eA, } @@ -68,6 +68,8 @@ namespace SHADE } pipeline->GetPipelineState().SetColorBlenState(colorBlendState); + + pipeline->ConstructPipeline(); } void SHTrajectoryRenderingSubSystem::Run(uint32_t frameIndex) noexcept @@ -75,21 +77,31 @@ namespace SHADE auto& comps = SHComponentManager::GetDense(); for (auto& comp : comps) { - comp.SetPositions(std::vector - { - SHVec3 {}, - SHVec3 {} - }); + //std::vector test{}; + //test.resize(10); + //float x = 0.0f; + //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 (comp.HasPositions()) { + auto meshHandle = comp.GetMesh(); + + // dont do anything if no mesh + if (!meshHandle) + continue; + SHTransformComponent* transform = SHComponentManager::GetComponent_s(comp.GetEID()); if (transform) { // convenient variable - SHVec4 const& startColor = comp.GetStartColor(); - SHVec4 const& endColor = comp.GetEndColor(); + SHVec3 const& startColor = comp.GetStartColor(); + SHVec3 const& endColor = comp.GetEndColor(); float colorEvolveRate = comp.GetColorEvolveRate(); // trs to be reused @@ -104,7 +116,6 @@ namespace SHADE // Will be used for baseInstance later uint32_t oldTransformDataSize = transformData.size(); - auto meshHandle = comp.GetMesh(); auto const& positions = comp.GetPositions(); for (auto& pos : positions) @@ -117,11 +128,13 @@ namespace SHADE transformData.push_back(trs); colorData.push_back(currentColor); - // evolve color - currentColor = SHVec4::Lerp(startColor, endColor, lerpValue); - // evolve lerp value and clamp to 1 - lerpValue = std::max (1.0f, lerpValue + colorEvolveRate); + lerpValue = std::min (1.0f, lerpValue + colorEvolveRate); + + // evolve color + currentColor = SHVec3::Lerp(startColor, endColor, lerpValue); + currentColor.w = SHMath::Lerp (comp.GetStartAlpha(), comp.GetEndAlpha(), lerpValue); + } // add draw data for this trajectory @@ -172,6 +185,9 @@ namespace SHADE // Bind color vertex buffer cmdBuffer->BindVertexBuffer(SHGraphicsConstants::VertexBufferBindings::TRAJECTORY_COLOR, colorBuffer, 0); + // Bind transform data + cmdBuffer->BindVertexBuffer(SHGraphicsConstants::VertexBufferBindings::TRAJECTORY_TRANSFORM, transformBuffer, 0); + // call draw call cmdBuffer->DrawMultiIndirect(drawDataBuffer, drawData.size()); diff --git a/SHADE_Engine/src/Graphics/Windowing/SHWindow.cpp b/SHADE_Engine/src/Graphics/Windowing/SHWindow.cpp index 078d9fc8..84df5f88 100644 --- a/SHADE_Engine/src/Graphics/Windowing/SHWindow.cpp +++ b/SHADE_Engine/src/Graphics/Windowing/SHWindow.cpp @@ -198,7 +198,8 @@ namespace SHADE void SHWindow::SetMouseVisible(bool show) { - ShowCursor(show); + while(GetMouseVisible() != show) + ShowCursor(show); } void SHWindow::SetMousePosition(int x, int y) diff --git a/SHADE_Engine/src/Serialization/SHSerialization.cpp b/SHADE_Engine/src/Serialization/SHSerialization.cpp index 13f5e36e..b6455935 100644 --- a/SHADE_Engine/src/Serialization/SHSerialization.cpp +++ b/SHADE_Engine/src/Serialization/SHSerialization.cpp @@ -247,6 +247,7 @@ namespace SHADE AddComponentToComponentNode(components, eid); AddComponentToComponentNode(components, eid); AddComponentToComponentNode(components, eid); + AddComponentToComponentNode(components, eid); node[ComponentsNode] = components; @@ -308,6 +309,7 @@ namespace SHADE AddComponentID(componentIDList, componentsNode); AddComponentID(componentIDList, componentsNode); AddComponentID(componentIDList, componentsNode); + AddComponentID(componentIDList, componentsNode); return componentIDList; } @@ -395,5 +397,6 @@ namespace SHADE SHSerializationHelper::InitializeComponentFromNode(componentsNode, eid); SHSerializationHelper::InitializeComponentFromNode(componentsNode, eid); SHSerializationHelper::InitializeComponentFromNode(componentsNode, eid); + SHSerializationHelper::InitializeComponentFromNode(componentsNode, eid); } } diff --git a/SHADE_Engine/src/Serialization/SHSerializationHelper.hpp b/SHADE_Engine/src/Serialization/SHSerializationHelper.hpp index a4936528..35e27132 100644 --- a/SHADE_Engine/src/Serialization/SHSerializationHelper.hpp +++ b/SHADE_Engine/src/Serialization/SHSerializationHelper.hpp @@ -207,10 +207,10 @@ namespace SHADE if constexpr (YAML::HasYAMLConv()) { auto component = SHComponentManager::GetComponent_s(eid); - if (componentsNode.IsNull() || !component) + if (!component) return false; auto componentNode = GetComponentNode(componentsNode, eid); - if (componentNode.IsNull() || !componentNode.IsDefined()) + if (!componentNode.IsDefined()) return false; if (componentNode[IsActive.data()].IsDefined()) component->isActive = componentNode[IsActive.data()].as(); @@ -220,7 +220,7 @@ namespace SHADE else { ComponentType* component = SHComponentManager::GetComponent_s(eid); - if (componentsNode.IsNull() && !component) + if (!component) return false; auto rttrType = rttr::type::get(); auto componentNode = componentsNode[rttrType.get_name().data()]; diff --git a/SHADE_Engine/src/Serialization/SHYAMLConverters.h b/SHADE_Engine/src/Serialization/SHYAMLConverters.h index 9fceb10d..bd714fd3 100644 --- a/SHADE_Engine/src/Serialization/SHYAMLConverters.h +++ b/SHADE_Engine/src/Serialization/SHYAMLConverters.h @@ -15,6 +15,7 @@ #include "Graphics/MiddleEnd/TextRendering/SHFont.h" #include "Animation/SHAnimatorComponent.h" #include "Physics/Collision/CollisionTags/SHCollisionTagMatrix.h" +#include "Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.h" namespace YAML { @@ -31,6 +32,8 @@ namespace YAML struct HasYAMLConv : std::true_type {}; template<> struct HasYAMLConv : std::true_type {}; + template<> + struct HasYAMLConv : std::true_type {}; template<> struct convert @@ -353,12 +356,15 @@ namespace YAML { static constexpr std::string_view TEXT_YAML_TAG = "Text"; static constexpr std::string_view FONT_YAML_TAG = "Font"; + 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) { YAML::Node node; node[TEXT_YAML_TAG.data()] = rhs.GetText(); auto font = rhs.GetFont(); + SHColour const& textColor = rhs.GetColor(); if (font) { node[FONT_YAML_TAG.data()] = SHResourceManager::GetAssetID(rhs.GetFont()).value_or(0); @@ -367,6 +373,8 @@ namespace YAML { node[FONT_YAML_TAG.data()] = 0; } + node[COLOR_YAML_TAG.data()] = SHVec4(textColor); + node[TEXT_SIZE_YAML_TAG.data()] = rhs.GetTextSize(); return node; } static bool decode(YAML::Node const& node, SHTextRenderableComponent& rhs) @@ -385,11 +393,19 @@ namespace YAML rhs.SetFont(SHResourceManager::LoadOrGet(node[FONT_YAML_TAG.data()].as())); } + if (node[COLOR_YAML_TAG.data()].IsDefined()) + { + rhs.SetColor(node[COLOR_YAML_TAG.data()].as()); + } + if (node[TEXT_SIZE_YAML_TAG.data()].IsDefined()) + { + rhs.SetTextSize(node[TEXT_SIZE_YAML_TAG.data()].as()); + } return true; } }; - + template<> struct convert { @@ -417,4 +433,50 @@ namespace YAML } }; + template<> + struct convert + { + 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 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 YAML::Node encode(SHTrajectoryRenderableComponent const& rhs) + { + YAML::Node node; + node[MESH_YAML_TAG.data()] = SHResourceManager::GetAssetID(rhs.GetMesh()).value_or(0); + 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_ALPHA_YAML_TAG.data()] = rhs.GetEndAlpha(); + node[COLOR_EVAL_RATE_YAML_TAG.data()] = rhs.GetColorEvolveRate(); + + return node; + } + static bool decode(YAML::Node const& node, SHTrajectoryRenderableComponent& rhs) + { + if (node[MESH_YAML_TAG.data()].IsDefined()) + rhs.SetMesh(SHResourceManager::LoadOrGet(node[MESH_YAML_TAG.data()].as())); + + if (node[START_COLOR_YAML_TAG.data()].IsDefined()) + rhs.SetStartColor(node[START_COLOR_YAML_TAG.data()].as()); + + if (node[START_ALPHA_YAML_TAG.data()].IsDefined()) + rhs.SetStartAlpha(node[START_ALPHA_YAML_TAG.data()].as()); + + if (node[END_COLOR_YAML_TAG.data()].IsDefined()) + rhs.SetEndColor(node[END_COLOR_YAML_TAG.data()].as()); + + if (node[END_ALPHA_YAML_TAG.data()].IsDefined()) + rhs.SetEndAlpha(node[END_ALPHA_YAML_TAG.data()].as()); + + if (node[COLOR_EVAL_RATE_YAML_TAG.data()].IsDefined()) + rhs.SetColorEvolveRate(node[COLOR_EVAL_RATE_YAML_TAG.data()].as()); + + return true; + } + }; + } diff --git a/SHADE_Managed/src/Audio/Audio.cxx b/SHADE_Managed/src/Audio/Audio.cxx index c3994cd4..33cfdd83 100644 --- a/SHADE_Managed/src/Audio/Audio.cxx +++ b/SHADE_Managed/src/Audio/Audio.cxx @@ -124,6 +124,12 @@ namespace SHADE audioSys->SetParameter(Convert::ToNative(path).data(), value); } + void Audio::SetParameterWithLabel(System::String^ path, System::String^ label) + { + auto audioSys = SHSystemManager::GetSystem(); + audioSys->SetParameterWithLabel(Convert::ToNative(path).data(), Convert::ToNative(label).data()); + } + AudioClipHandler Audio::CreateAudioClip(System::String^ path) { auto audioSys = SHSystemManager::GetSystem(); diff --git a/SHADE_Managed/src/Audio/Audio.hxx b/SHADE_Managed/src/Audio/Audio.hxx index 179a3eb7..fa1e97de 100644 --- a/SHADE_Managed/src/Audio/Audio.hxx +++ b/SHADE_Managed/src/Audio/Audio.hxx @@ -105,6 +105,7 @@ namespace SHADE static void SetVCAVolume(System::String^ path, float volume); static float GetParameterValue(System::String^ path); static void SetParameter(System::String^ path, float value); + static void SetParameterWithLabel(System::String^ path, System::String^ label); //to comment ltr static AudioClipHandler CreateAudioClip(System::String^ path); diff --git a/SHADE_Managed/src/Audio/AudioClip.cxx b/SHADE_Managed/src/Audio/AudioClip.cxx index 7ed58714..062b543e 100644 --- a/SHADE_Managed/src/Audio/AudioClip.cxx +++ b/SHADE_Managed/src/Audio/AudioClip.cxx @@ -79,6 +79,11 @@ namespace SHADE NativeObject->SetParameter(Convert::ToNative(paramName).data(), value); } + void AudioClipHandler::SetParameterWithLabel(System::String^ paramName, System::String^ label) + { + NativeObject->SetParameterWithLabel(Convert::ToNative(paramName).data(), Convert::ToNative(label).data()); + } + float AudioClipHandler::GetParameterValue(System::String^ paramName) { return NativeObject->GetParameterValue(Convert::ToNative(paramName).data()); diff --git a/SHADE_Managed/src/Audio/AudioClip.hxx b/SHADE_Managed/src/Audio/AudioClip.hxx index 34e9b4a5..317c5bad 100644 --- a/SHADE_Managed/src/Audio/AudioClip.hxx +++ b/SHADE_Managed/src/Audio/AudioClip.hxx @@ -71,6 +71,7 @@ namespace SHADE void SetPause(bool pause); bool IsPaused(); void SetParameter(System::String^ paramName, float value); + void SetParameterWithLabel(System::String^ paramName, System::String^ label); float GetParameterValue(System::String^ paramName); float GetVolume(); void SetVolume(float volume); diff --git a/SHADE_Managed/src/Components/TextRenderable.cxx b/SHADE_Managed/src/Components/TextRenderable.cxx index 93d80b65..c75d4556 100644 --- a/SHADE_Managed/src/Components/TextRenderable.cxx +++ b/SHADE_Managed/src/Components/TextRenderable.cxx @@ -59,12 +59,12 @@ namespace SHADE Color TextRenderable::TextColor::get() { - return Convert::ToCLI(GetNativeComponent()->GetColour()); + return Convert::ToCLI(GetNativeComponent()->GetColor()); } void TextRenderable::TextColor::set(Color value) { - GetNativeComponent()->SetColour(Convert::ToNative(value)); + GetNativeComponent()->SetColor(Convert::ToNative(value)); } diff --git a/SHADE_Managed/src/Components/TrajectoryRenderable.cxx b/SHADE_Managed/src/Components/TrajectoryRenderable.cxx new file mode 100644 index 00000000..4b762338 --- /dev/null +++ b/SHADE_Managed/src/Components/TrajectoryRenderable.cxx @@ -0,0 +1,83 @@ +#include "SHpch.h" + +#include "TrajectoryRenderable.hxx" +#include "Assets/NativeAsset.hxx" +#include "Utility/Convert.hxx" + + +namespace SHADE +{ + TrajectoryRenderable::TrajectoryRenderable(Entity entity) + :Component(entity) + { + + } + + MeshAsset TrajectoryRenderable::Mesh::get() + { + auto mesh = GetNativeComponent()->GetMesh(); + return mesh ? MeshAsset(mesh) : MeshAsset(); + } + void TrajectoryRenderable::Mesh::set(MeshAsset value) + { + if (value) + { + GetNativeComponent()->SetMesh(Handle()); + } + else + { + GetNativeComponent()->SetMesh(value.NativeObject); + } + } + + + void TrajectoryRenderable::StartColor::set(Vector3 val) + { + GetNativeComponent()->SetStartColor(Convert::ToNative(val)); + } + + Vector3 TrajectoryRenderable::StartColor::get() + { + return Convert::ToCLI(GetNativeComponent()->GetStartColor()); + } + + void TrajectoryRenderable::EndColor::set(Vector3 val) + { + GetNativeComponent()->SetEndColor(Convert::ToNative(val)); + } + + Vector3 TrajectoryRenderable::EndColor::get() + { + return Convert::ToCLI(GetNativeComponent()->GetEndColor()); + } + + void TrajectoryRenderable::StartAlpha::set(float val) + { + GetNativeComponent()->SetStartAlpha(val); + } + + float TrajectoryRenderable::StartAlpha::get() + { + return GetNativeComponent()->GetStartAlpha(); + } + + void TrajectoryRenderable::EndAlpha::set(float val) + { + GetNativeComponent()->SetEndAlpha(val); + } + + float TrajectoryRenderable::EndAlpha::get() + { + return GetNativeComponent()->GetEndAlpha(); + } + + void TrajectoryRenderable::ColorEvolveRate::set(float val) + { + GetNativeComponent()->SetColorEvolveRate(val); + } + + float TrajectoryRenderable::ColorEvolveRate::get() + { + return GetNativeComponent()->GetColorEvolveRate(); + } +} \ No newline at end of file diff --git a/SHADE_Managed/src/Components/TrajectoryRenderable.hxx b/SHADE_Managed/src/Components/TrajectoryRenderable.hxx new file mode 100644 index 00000000..37a350ad --- /dev/null +++ b/SHADE_Managed/src/Components/TrajectoryRenderable.hxx @@ -0,0 +1,87 @@ +/************************************************************************************//*! +\file TrajectoryRenderable.hxx +\author Brandon Mak, brandon.hao, +\par email: brandon.hao\@digipen.edu +\date 1st March, 2023 +\brief Contains the definition of the managed Renderable class with the + declaration of functions for working with it. + + Note: This file is written in C++17/CLI. + +Copyright (C) 2022 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 "Components/Component.hxx" +#include "Math/Quaternion.hxx" +// External Dependencies +#include "Graphics/MiddleEnd/TrajectoryRendering/SHTrajectoryRenderableComponent.h" +#include "Graphics/Color.hxx" +#include "Assets/MeshAsset.hxx" + +namespace SHADE +{ + /// + /// CLR version of the SHADE Engine's SHRenderableComponent. + /// + public ref class TrajectoryRenderable : public Component + { + internal: + /*-----------------------------------------------------------------------------*/ + /* Constructors */ + /*-----------------------------------------------------------------------------*/ + /// + /// Constructs a Trajectory Renderable Component that represents a native Trajectory Renderable + /// component tied to the specified Entity. + /// + /// Entity that this Component will be tied to. + TrajectoryRenderable(Entity entity); + + public: + /*-----------------------------------------------------------------------------*/ + /* Properties */ + /*-----------------------------------------------------------------------------*/ + /// + /// Mesh used to render this Renderable. + /// + property MeshAsset Mesh + { + MeshAsset get(); + void set(MeshAsset value); + } + + property Vector3 StartColor + { + Vector3 get(); + void set (Vector3 val); + } + + property Vector3 EndColor + { + Vector3 get(); + void set(Vector3 val); + } + + property float StartAlpha + { + float get(); + void set (float val); + } + + property float EndAlpha + { + float get(); + void set(float val); + } + + property float ColorEvolveRate + { + float get(); + void set(float val); + } + }; +} + diff --git a/SHADE_Managed/src/Engine/Application.cxx b/SHADE_Managed/src/Engine/Application.cxx index ba0cb592..e5aeeb9d 100644 --- a/SHADE_Managed/src/Engine/Application.cxx +++ b/SHADE_Managed/src/Engine/Application.cxx @@ -77,7 +77,7 @@ namespace SHADE } void Application::IsCursorVisible::set(bool value) { - SHWindow::SetMouseVisible(value); + //SHWindow::SetMouseVisible(value); } /*---------------------------------------------------------------------------------*/ /* Usage Functions */ diff --git a/SHADE_Managed/src/Engine/ECS.cxx b/SHADE_Managed/src/Engine/ECS.cxx index 38596010..5b73b64e 100644 --- a/SHADE_Managed/src/Engine/ECS.cxx +++ b/SHADE_Managed/src/Engine/ECS.cxx @@ -46,6 +46,8 @@ of DigiPen Institute of Technology is prohibited. #include "Components\UIElement.hxx" #include "Components\Canvas.hxx" #include "Components\Slider.hxx" +#include "Components\TrajectoryRenderable.hxx" +#include "Graphics\MiddleEnd\TrajectoryRendering\SHTrajectoryRenderableComponent.h" @@ -335,6 +337,7 @@ namespace SHADE componentMap.Add(createComponentSet()); componentMap.Add(createComponentSet()); componentMap.Add(createComponentSet()); + componentMap.Add(createComponentSet()); } /*---------------------------------------------------------------------------------*/ diff --git a/SHADE_Managed/src/Input/Input.cxx b/SHADE_Managed/src/Input/Input.cxx index ee628523..5b76392b 100644 --- a/SHADE_Managed/src/Input/Input.cxx +++ b/SHADE_Managed/src/Input/Input.cxx @@ -149,7 +149,7 @@ namespace SHADE void Input::SetMouseCentering(bool state) { - SHInputManager::SetMouseCentering(state); + //SHInputManager::SetMouseCentering(state); } bool Input::GetMouseCentering()