Merge branch 'main' into cems-awesome-branch

This commit is contained in:
cemt1363
2026-06-06 02:43:02 +02:00
committed by GitHub
11 changed files with 387 additions and 63 deletions
+2
View File
@@ -5,6 +5,7 @@
# Recommended: add any editor/OS/tool-specific ignore rules from the Global/ templates as needed.
# See: https://github.com/github/gitignore/tree/main/Global
#
.idea/
.utmp/
/[Ll]ibrary/
/[Tt]emp/
@@ -104,3 +105,4 @@ InitTestScene*.unity*
# Auto-generated cache in Assets folder
/[Aa]ssets/[Ss]ceneDependencyCache*
.idea/
+127
View File
@@ -1,5 +1,6 @@
fileFormatVersion: 2
guid: 538f90e730a0f7546ab3734b86c40ba9
guid: 640e946956ffb084c8d0f325a978f7be
TextureImporter:
internalIDToNameTable:
- first:
@@ -132,6 +133,19 @@ TextureImporter:
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
@@ -145,6 +159,11 @@ TextureImporter:
height: 1080
alignment: 0
pivot: {x: 0.5, y: 0.5}
y: 729
width: 6
height: 13
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -167,6 +186,12 @@ TextureImporter:
height: 1080
alignment: 0
pivot: {x: 0.5, y: 0.5}
x: 11
y: 700
width: 156
height: 104
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -189,6 +214,12 @@ TextureImporter:
height: 1080
alignment: 0
pivot: {x: 0.5, y: 0.5}
x: 182
y: 702
width: 155
height: 92
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -211,6 +242,12 @@ TextureImporter:
height: 1080
alignment: 0
pivot: {x: 0.5, y: 0.5}
x: 343
y: 702
width: 155
height: 87
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -233,6 +270,12 @@ TextureImporter:
height: 1080
alignment: 0
pivot: {x: 0.5, y: 0.5}
x: 506
y: 702
width: 163
height: 84
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -255,6 +298,12 @@ TextureImporter:
height: 1080
alignment: 0
pivot: {x: 0.5, y: 0.5}
x: 674
y: 699
width: 168
height: 81
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -277,6 +326,12 @@ TextureImporter:
height: 1080
alignment: 0
pivot: {x: 0.5, y: 0.5}
x: 852
y: 699
width: 177
height: 76
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -299,6 +354,12 @@ TextureImporter:
height: 1080
alignment: 0
pivot: {x: 0.5, y: 0.5}
x: 1045
y: 704
width: 182
height: 64
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -321,6 +382,12 @@ TextureImporter:
height: 1080
alignment: 0
pivot: {x: 0.5, y: 0.5}
x: 1241
y: 706
width: 176
height: 68
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -343,6 +410,12 @@ TextureImporter:
height: 1080
alignment: 0
pivot: {x: 0.5, y: 0.5}
x: 1427
y: 703
width: 163
height: 84
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -365,6 +438,12 @@ TextureImporter:
height: 1080
alignment: 0
pivot: {x: 0.5, y: 0.5}
x: 1596
y: 706
width: 154
height: 92
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
@@ -377,11 +456,56 @@ TextureImporter:
indices:
edges: []
weights: []
- serializedVersion: 2
name: idle sprites_11
rect:
serializedVersion: 2
x: 1751
y: 728
width: 7
height: 13
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 52db9cfcc8d8672c0800000000000000
internalID: -4434201147178631899
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: idle sprites_12
rect:
serializedVersion: 2
x: 1763
y: 699
width: 156
height: 104
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 1528d6cfe630f4720800000000000000
internalID: 2832486465855652433
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 26189bb86b37500408da1f12c9a366d4
spriteID:
internalID: 0
vertices: []
indices:
@@ -392,10 +516,13 @@ TextureImporter:
entries:
- key: SpriteEditor.SliceSettings
value: '{"sliceOnImport":false,"gridCellCount":{"x":11.0,"y":1.0},"gridSpriteSize":{"x":174.0,"y":1080.0},"gridSpriteOffset":{"x":0.0,"y":0.0},"gridSpritePadding":{"x":0.0,"y":0.0},"pivot":{"x":0.5,"y":0.5},"pivotPixels":{"x":0.0,"y":0.0},"autoSlicingMethod":0,"spriteAlignment":0,"pivotUnitMode":0,"slicingType":2,"keepEmptyRects":false,"isAlternate":false}'
entries: []
nameFileIdTable:
idle sprites_0: -5254763888643210246
idle sprites_1: 6308160273899767728
idle sprites_10: -2803174831038805257
idle sprites_11: -4434201147178631899
idle sprites_12: 2832486465855652433
idle sprites_2: -8810144250521748931
idle sprites_3: 8716055518302679110
idle sprites_4: -2831101797488401219
@@ -11,8 +11,9 @@ GameObject:
- component: {fileID: 2163867978973577705}
- component: {fileID: 6893150318335556705}
- component: {fileID: 5310886650056327379}
- component: {fileID: 5321372118810808216}
m_Layer: 0
m_Name: Branches
m_Name: Branch
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -126,7 +127,7 @@ BoxCollider2D:
m_UsedByEffector: 1
m_CompositeOperation: 0
m_CompositeOrder: 0
m_Offset: {x: 0, y: 0}
m_Offset: {x: -0.000000014901161, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
@@ -138,3 +139,22 @@ BoxCollider2D:
m_AutoTiling: 0
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0
--- !u!251 &5321372118810808216
PlatformEffector2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8871780616060845038}
m_Enabled: 1
m_UseColliderMask: 0
m_ColliderMask:
serializedVersion: 2
m_Bits: 4294967295
m_RotationalOffset: 0
m_UseOneWay: 1
m_UseOneWayGrouping: 0
m_SurfaceArc: 180
m_UseSideFriction: 0
m_UseSideBounce: 0
m_SideArc: 1
+169 -56
View File
@@ -119,6 +119,63 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &274994935
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 2072448676}
m_Modifications:
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalPosition.x
value: 0.39
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalPosition.y
value: 1.94
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8871780616060845038, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_Name
value: Branch (1)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
--- !u!1001 &279662124
PrefabInstance:
m_ObjectHideFlags: 0
@@ -131,6 +188,10 @@ PrefabInstance:
propertyPath: moveSpeed
value: 10
objectReference: {fileID: 0}
- target: {fileID: -8535381027169538, guid: d56297e435f8410a584581d73d99d2e4, type: 3}
propertyPath: jumpingPower
value: 20
objectReference: {fileID: 0}
- target: {fileID: 2141180002423843430, guid: d56297e435f8410a584581d73d99d2e4, type: 3}
propertyPath: m_Name
value: PlayerDroplet
@@ -139,21 +200,29 @@ PrefabInstance:
propertyPath: m_Mass
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4266476263824402640, guid: d56297e435f8410a584581d73d99d2e4, type: 3}
propertyPath: m_Constraints
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4266476263824402640, guid: d56297e435f8410a584581d73d99d2e4, type: 3}
propertyPath: m_UseAutoMass
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4266476263824402640, guid: d56297e435f8410a584581d73d99d2e4, type: 3}
propertyPath: m_GravityScale
value: 25
value: 5
objectReference: {fileID: 0}
- target: {fileID: 6566899495513628888, guid: d56297e435f8410a584581d73d99d2e4, type: 3}
propertyPath: m_LocalScale.y
value: 0.5957
objectReference: {fileID: 0}
- target: {fileID: 6566899495513628888, guid: d56297e435f8410a584581d73d99d2e4, type: 3}
propertyPath: m_LocalPosition.x
value: 0.05
value: -4.63
objectReference: {fileID: 0}
- target: {fileID: 6566899495513628888, guid: d56297e435f8410a584581d73d99d2e4, type: 3}
propertyPath: m_LocalPosition.y
value: -0.02
value: 3.74
objectReference: {fileID: 0}
- target: {fileID: 6566899495513628888, guid: d56297e435f8410a584581d73d99d2e4, type: 3}
propertyPath: m_LocalPosition.z
@@ -190,8 +259,30 @@ PrefabInstance:
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 2141180002423843430, guid: d56297e435f8410a584581d73d99d2e4, type: 3}
insertIndex: -1
addedObject: {fileID: 279662126}
m_SourcePrefab: {fileID: 100100000, guid: d56297e435f8410a584581d73d99d2e4, type: 3}
--- !u!1 &279662125 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2141180002423843430, guid: d56297e435f8410a584581d73d99d2e4, type: 3}
m_PrefabInstance: {fileID: 279662124}
m_PrefabAsset: {fileID: 0}
--- !u!114 &279662126
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 279662125}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2b3b9fc97a2d39d2d84c4be43a79247a, type: 3}
m_Name:
m_EditorClassIdentifier: '::'
threshold: 0.05
multiplier: 5
--- !u!1 &357828117
GameObject:
m_ObjectHideFlags: 0
@@ -420,7 +511,17 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1065178480
--- !u!4 &1124127124 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
m_PrefabInstance: {fileID: 274994935}
m_PrefabAsset: {fileID: 0}
--- !u!4 &1710653547 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
m_PrefabInstance: {fileID: 1958370634}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1890470405
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
@@ -430,11 +531,11 @@ PrefabInstance:
m_Modifications:
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalPosition.x
value: -1.69
value: -3.03753
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalPosition.y
value: -1.24
value: -0.38336
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalPosition.z
@@ -468,26 +569,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5310886650056327379, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_Size.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5310886650056327379, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_Size.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5310886650056327379, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_Offset.x
value: -0.000000014901161
objectReference: {fileID: 0}
- target: {fileID: 5310886650056327379, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_AutoTiling
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5310886650056327379, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_CompositeOperation
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8871780616060845038, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_Name
value: Branch
@@ -495,40 +576,70 @@ PrefabInstance:
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 8871780616060845038, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
insertIndex: -1
addedObject: {fileID: 1065178483}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
--- !u!4 &1065178481 stripped
--- !u!4 &1944302763 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
m_PrefabInstance: {fileID: 1065178480}
m_PrefabInstance: {fileID: 1890470405}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1065178482 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 8871780616060845038, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
m_PrefabInstance: {fileID: 1065178480}
m_PrefabAsset: {fileID: 0}
--- !u!251 &1065178483
PlatformEffector2D:
--- !u!1001 &1958370634
PrefabInstance:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1065178482}
m_Enabled: 1
m_UseColliderMask: 0
m_ColliderMask:
serializedVersion: 2
m_Bits: 4294967295
m_RotationalOffset: 0
m_UseOneWay: 1
m_UseOneWayGrouping: 0
m_SurfaceArc: 180
m_UseSideFriction: 0
m_UseSideBounce: 0
m_SideArc: 1
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 2072448676}
m_Modifications:
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalPosition.x
value: -6.2
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalPosition.y
value: 2.81
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2163867978973577705, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8871780616060845038, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
propertyPath: m_Name
value: Branch (2)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2f44dc6d6adb9ae7f9b4f644da0e3485, type: 3}
--- !u!1 &2072448675
GameObject:
m_ObjectHideFlags: 0
@@ -558,7 +669,9 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1065178481}
- {fileID: 1944302763}
- {fileID: 1124127124}
- {fileID: 1710653547}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1660057539 &9223372036854775807
+14
View File
@@ -0,0 +1,14 @@
using System;
using UnityEngine;
public class DamageHandler : MonoBehaviour
{
public float threshold = 0.05f;
public float multiplier = 5f;
private void OnCollisionEnter(Collision collision)
{
throw new NotImplementedException();
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2b3b9fc97a2d39d2d84c4be43a79247a
+50 -4
View File
@@ -30,16 +30,15 @@ public class DropletMovement : MonoBehaviour
void Update()
{
//dashing
if (isDashing)
{
return;
}
movement.x = Input.GetAxisRaw("Horizontal");
if (movement.x < 0) facingDirection = -1;
if (movement.x > 0) facingDirection = 1;
if (isGrounded &&
(Input.GetKeyDown(KeyCode.Space) ||
Input.GetKeyDown(KeyCode.UpArrow) ||
@@ -47,11 +46,18 @@ public class DropletMovement : MonoBehaviour
{
rb.linearVelocity = new Vector2(rb.linearVelocity.x, jumpingPower);
}
if (Input.GetKeyDown(KeyCode.LeftShift) && canDash)
{
StartCoroutine(Dash());
}
//dropdown
if (!isGrounded){return;}
if (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.S))
{
DropDown();
}
}
private void FixedUpdate()
@@ -103,4 +109,44 @@ public class DropletMovement : MonoBehaviour
{
isGrounded = false;
}
private void DropDown()
{
//when "s" or "down key" is pressed turn of/disable collider;
//move object slowly down (1 seconds, move down the height of the collision box)
//after that enable collider again
if (isGrounded && (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow)))
{
StartCoroutine(DropRoutine());
}
}
private IEnumerator DropRoutine()
{
Collider2D playerCollider = GetComponent<Collider2D>();
rb = GetComponent<Rigidbody2D>();
playerCollider.isTrigger = true;
float duration = 1f;
float elapsed = 0f; //measure time
//move down the height of the collider
float dropDistance = playerCollider.bounds.size.y;
float speed = dropDistance/duration;
while (elapsed < duration)
{
rb.gravityScale = 0;
transform.Translate(Vector3.down * speed * Time.deltaTime);
elapsed += Time.deltaTime; //update time
yield return null;
}
//enable collider --> not a trigger anymore
rb.gravityScale = 1;
playerCollider.isTrigger = false;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB