Merge pull request 'get-tricky2' (#33) from get-tricky2 into main
Reviewed-on: admin/GGJ2026#33 Reviewed-by: Ramdar <[email protected]>
This commit is contained in:
@@ -65,6 +65,7 @@
|
|||||||
<Compile Include="Assets\Scripts\AutoSquareSprite.cs" />
|
<Compile Include="Assets\Scripts\AutoSquareSprite.cs" />
|
||||||
<Compile Include="Assets\Scripts\ScoreManager.cs" />
|
<Compile Include="Assets\Scripts\ScoreManager.cs" />
|
||||||
<Compile Include="Assets\Scripts\BasketController.cs" />
|
<Compile Include="Assets\Scripts\BasketController.cs" />
|
||||||
|
<Compile Include="Assets\Scripts\TrickCollisionManager.cs" />
|
||||||
<Compile Include="Assets\Scripts\Spawner.cs" />
|
<Compile Include="Assets\Scripts\Spawner.cs" />
|
||||||
<Compile Include="Assets\Scripts\PlayerPickupController.cs" />
|
<Compile Include="Assets\Scripts\PlayerPickupController.cs" />
|
||||||
<Compile Include="Assets\Scripts\TrickController.cs" />
|
<Compile Include="Assets\Scripts\TrickController.cs" />
|
||||||
|
|||||||
@@ -0,0 +1,185 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1fd9e2c9c5170344885cb344961b782d
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 62a9f0aa5b59740cfbadc7e5f9823bb0, type: 3}
|
||||||
|
importerVersion: 2
|
||||||
|
textureImporterSettings:
|
||||||
|
alphaSource: 1
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
convertToNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
flipGreenChannel: 0
|
||||||
|
swizzle: 50462976
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
vTOnly: 0
|
||||||
|
ignoreMipmapLimit: 0
|
||||||
|
nPOTScale: 1
|
||||||
|
sRGBTexture: 1
|
||||||
|
spriteMode: 2
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 8
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
flipbookRows: 0
|
||||||
|
flipbookColumns: 0
|
||||||
|
ignorePngGamma: 0
|
||||||
|
cookieMode: 0
|
||||||
|
filterMode: 0
|
||||||
|
aniso: 1
|
||||||
|
mipBias: 0
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
normalMap: 0
|
||||||
|
textureFormat: 0
|
||||||
|
maxTextureSize: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 0
|
||||||
|
linearTexture: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
rGBM: 0
|
||||||
|
cubemapConvolutionSteps: 0
|
||||||
|
cubemapConvolutionExponent: 0
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
previousAsepriteImporterSettings:
|
||||||
|
fileImportMode: 1
|
||||||
|
importHiddenLayers: 0
|
||||||
|
layerImportMode: 1
|
||||||
|
defaultPivotSpace: 0
|
||||||
|
defaultPivotAlignment: 7
|
||||||
|
customPivotPosition: {x: 0.5, y: 0.5}
|
||||||
|
mosaicPadding: 4
|
||||||
|
spritePadding: 0
|
||||||
|
generateModelPrefab: 1
|
||||||
|
generateAnimationClips: 1
|
||||||
|
addSortingGroup: 1
|
||||||
|
addShadowCasters: 0
|
||||||
|
generateIndividualEvents: 1
|
||||||
|
generateSpriteAtlas: 1
|
||||||
|
asepriteImporterSettings:
|
||||||
|
fileImportMode: 1
|
||||||
|
importHiddenLayers: 0
|
||||||
|
layerImportMode: 1
|
||||||
|
defaultPivotSpace: 0
|
||||||
|
defaultPivotAlignment: 7
|
||||||
|
customPivotPosition: {x: 0.5, y: 0.5}
|
||||||
|
mosaicPadding: 4
|
||||||
|
spritePadding: 0
|
||||||
|
generateModelPrefab: 1
|
||||||
|
generateAnimationClips: 1
|
||||||
|
addSortingGroup: 1
|
||||||
|
addShadowCasters: 0
|
||||||
|
generateIndividualEvents: 1
|
||||||
|
generateSpriteAtlas: 1
|
||||||
|
importFileNodeState: 1
|
||||||
|
platformSettingsDirtyTick: 0
|
||||||
|
textureAssetName:
|
||||||
|
singleSpriteImportData:
|
||||||
|
- name:
|
||||||
|
originalName:
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
alignment: 0
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
customData:
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
width: 0
|
||||||
|
height: 0
|
||||||
|
spriteID:
|
||||||
|
spriteBone: []
|
||||||
|
spriteOutline: []
|
||||||
|
vertices: []
|
||||||
|
spritePhysicsOutline: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
tessellationDetail: 0
|
||||||
|
uvTransform: {x: 0, y: 0}
|
||||||
|
animatedSpriteImportData:
|
||||||
|
- name: LeJust Border
|
||||||
|
originalName:
|
||||||
|
pivot: {x: 0.49999997, y: -0.025547445}
|
||||||
|
alignment: 9
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
customData:
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 4
|
||||||
|
y: 4
|
||||||
|
width: 486
|
||||||
|
height: 548
|
||||||
|
spriteID: 47ea8d7442aab414d9e5d842e0529355
|
||||||
|
spriteBone: []
|
||||||
|
spriteOutline: []
|
||||||
|
vertices: []
|
||||||
|
spritePhysicsOutline: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
tessellationDetail: 0
|
||||||
|
uvTransform: {x: 4, y: 4}
|
||||||
|
spriteSheetImportData: []
|
||||||
|
tileSetImportData: []
|
||||||
|
asepriteLayers:
|
||||||
|
- layerIndex: 0
|
||||||
|
uuid:
|
||||||
|
value0: 252262701
|
||||||
|
value1: 0
|
||||||
|
value2: 0
|
||||||
|
value3: 0
|
||||||
|
guid: 0
|
||||||
|
name: LeJust Border
|
||||||
|
layerFlags: 0
|
||||||
|
layerType: 0
|
||||||
|
blendMode: 0
|
||||||
|
cells:
|
||||||
|
- name: LeJust Border
|
||||||
|
frameIndex: 0
|
||||||
|
additiveSortOrder: 0
|
||||||
|
cellRect:
|
||||||
|
x: 13
|
||||||
|
y: 14
|
||||||
|
width: 486
|
||||||
|
height: 548
|
||||||
|
spriteId: 47ea8d7442aab414d9e5d842e0529355
|
||||||
|
linkedCells: []
|
||||||
|
tileCells: []
|
||||||
|
tileSetIndex: 0
|
||||||
|
parentIndex: -1
|
||||||
|
tileSets: []
|
||||||
|
platformSettings: []
|
||||||
|
generatePhysicsShape: 0
|
||||||
|
secondarySpriteTextures: []
|
||||||
|
spritePackingTag:
|
||||||
|
canvasSize: {x: 512, y: 576}
|
||||||
|
previousTextureSize: {x: 512, y: 1024}
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"path": "<Gamepad>/leftStick",
|
"path": "<Gamepad>/leftStick",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": ";Gamepad",
|
"groups": "Gamepad",
|
||||||
"action": "Move",
|
"action": "Move",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": false
|
"isPartOfComposite": false
|
||||||
@@ -214,7 +214,7 @@
|
|||||||
{
|
{
|
||||||
"name": "",
|
"name": "",
|
||||||
"id": "b3f66d0b-7751-423f-908b-a11c5bd95930",
|
"id": "b3f66d0b-7751-423f-908b-a11c5bd95930",
|
||||||
"path": "<Gamepad>/buttonNorth",
|
"path": "<Gamepad>/buttonEast",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": "Gamepad",
|
"groups": "Gamepad",
|
||||||
@@ -285,7 +285,7 @@
|
|||||||
"path": "<Gamepad>/buttonEast",
|
"path": "<Gamepad>/buttonEast",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": ";Gamepad",
|
"groups": "Gamepad",
|
||||||
"action": "Interact",
|
"action": "Interact",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": false
|
"isPartOfComposite": false
|
||||||
@@ -313,6 +313,15 @@
|
|||||||
"processors": "",
|
"processors": "",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"initialStateCheck": false
|
"initialStateCheck": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Interact",
|
||||||
|
"type": "Button",
|
||||||
|
"id": "c8a2c7b1-7c4b-4b6c-9c67-5f4a2a6f8c1c",
|
||||||
|
"expectedControlType": "",
|
||||||
|
"processors": "",
|
||||||
|
"interactions": "",
|
||||||
|
"initialStateCheck": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"bindings": [
|
"bindings": [
|
||||||
@@ -337,6 +346,17 @@
|
|||||||
"action": "Jump",
|
"action": "Jump",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": false
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "c3c7b8ad-6b3b-4a4c-9b0b-1c2f7e9a4d5e",
|
||||||
|
"path": "<Gamepad>/buttonEast",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Gamepad",
|
||||||
|
"action": "Interact",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -361,6 +381,15 @@
|
|||||||
"processors": "",
|
"processors": "",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"initialStateCheck": false
|
"initialStateCheck": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Interact",
|
||||||
|
"type": "Button",
|
||||||
|
"id": "e2e9b2d1-8f44-4a8b-b5a0-4f1d6a7c9b2a",
|
||||||
|
"expectedControlType": "",
|
||||||
|
"processors": "",
|
||||||
|
"interactions": "",
|
||||||
|
"initialStateCheck": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"bindings": [
|
"bindings": [
|
||||||
@@ -385,6 +414,17 @@
|
|||||||
"action": "Jump",
|
"action": "Jump",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": false
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "b1f0f4f1-2d7a-4c1e-9c6a-8e5b7c9d1a3f",
|
||||||
|
"path": "<Gamepad>/buttonEast",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Gamepad",
|
||||||
|
"action": "Interact",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -501,7 +541,7 @@
|
|||||||
"path": "<Gamepad>/leftStick/up",
|
"path": "<Gamepad>/leftStick/up",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": ";Gamepad",
|
"groups": "Gamepad",
|
||||||
"action": "Navigate",
|
"action": "Navigate",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@@ -512,7 +552,7 @@
|
|||||||
"path": "<Gamepad>/rightStick/up",
|
"path": "<Gamepad>/rightStick/up",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": ";Gamepad",
|
"groups": "Gamepad",
|
||||||
"action": "Navigate",
|
"action": "Navigate",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@@ -523,7 +563,7 @@
|
|||||||
"path": "<Gamepad>/leftStick/down",
|
"path": "<Gamepad>/leftStick/down",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": ";Gamepad",
|
"groups": "Gamepad",
|
||||||
"action": "Navigate",
|
"action": "Navigate",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@@ -534,7 +574,7 @@
|
|||||||
"path": "<Gamepad>/rightStick/down",
|
"path": "<Gamepad>/rightStick/down",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": ";Gamepad",
|
"groups": "Gamepad",
|
||||||
"action": "Navigate",
|
"action": "Navigate",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@@ -545,7 +585,7 @@
|
|||||||
"path": "<Gamepad>/leftStick/left",
|
"path": "<Gamepad>/leftStick/left",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": ";Gamepad",
|
"groups": "Gamepad",
|
||||||
"action": "Navigate",
|
"action": "Navigate",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@@ -556,7 +596,7 @@
|
|||||||
"path": "<Gamepad>/rightStick/left",
|
"path": "<Gamepad>/rightStick/left",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": ";Gamepad",
|
"groups": "Gamepad",
|
||||||
"action": "Navigate",
|
"action": "Navigate",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@@ -567,7 +607,7 @@
|
|||||||
"path": "<Gamepad>/leftStick/right",
|
"path": "<Gamepad>/leftStick/right",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": ";Gamepad",
|
"groups": "Gamepad",
|
||||||
"action": "Navigate",
|
"action": "Navigate",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@@ -578,7 +618,7 @@
|
|||||||
"path": "<Gamepad>/rightStick/right",
|
"path": "<Gamepad>/rightStick/right",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": ";Gamepad",
|
"groups": "Gamepad",
|
||||||
"action": "Navigate",
|
"action": "Navigate",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@@ -589,7 +629,7 @@
|
|||||||
"path": "<Gamepad>/dpad",
|
"path": "<Gamepad>/dpad",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": ";Gamepad",
|
"groups": "Gamepad",
|
||||||
"action": "Navigate",
|
"action": "Navigate",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": false
|
"isPartOfComposite": false
|
||||||
@@ -967,4 +1007,4 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 58ffb2142b4f20f4388243f51a413e0e
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!62 &6200000
|
||||||
|
PhysicsMaterial2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: TrickNoFriction
|
||||||
|
friction: 0
|
||||||
|
bounciness: 0
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 71737e52316f484b8c59e24137491385
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 6200000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -233,7 +233,7 @@ MonoBehaviour:
|
|||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 3937090937419967315}
|
m_GameObject: {fileID: 3937090937419967315}
|
||||||
m_Enabled: 1
|
m_Enabled: 0
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: b88e05c37f07ccf48bcc436a9d7def5d, type: 3}
|
m_Script: {fileID: 11500000, guid: b88e05c37f07ccf48bcc436a9d7def5d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ GameObject:
|
|||||||
- component: {fileID: 700000003}
|
- component: {fileID: 700000003}
|
||||||
- component: {fileID: 700000004}
|
- component: {fileID: 700000004}
|
||||||
- component: {fileID: 700000005}
|
- component: {fileID: 700000005}
|
||||||
m_Layer: 0
|
m_Layer: 3
|
||||||
m_Name: Trick
|
m_Name: Trick
|
||||||
m_TagString: Interactable
|
m_TagString: Interactable
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@@ -110,7 +110,7 @@ Rigidbody2D:
|
|||||||
m_LinearDamping: 0
|
m_LinearDamping: 0
|
||||||
m_AngularDamping: 0.05
|
m_AngularDamping: 0.05
|
||||||
m_GravityScale: 0
|
m_GravityScale: 0
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 6200000, guid: 71737e52316f484b8c59e24137491385, type: 2}
|
||||||
m_IncludeLayers:
|
m_IncludeLayers:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Bits: 0
|
m_Bits: 0
|
||||||
@@ -131,7 +131,7 @@ BoxCollider2D:
|
|||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Density: 1
|
m_Density: 1
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 6200000, guid: 71737e52316f484b8c59e24137491385, type: 2}
|
||||||
m_IncludeLayers:
|
m_IncludeLayers:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Bits: 0
|
m_Bits: 0
|
||||||
@@ -184,4 +184,19 @@ MonoBehaviour:
|
|||||||
targetRefreshInterval: 0.4
|
targetRefreshInterval: 0.4
|
||||||
consumeDistance: 0.35
|
consumeDistance: 0.35
|
||||||
wanderInterval: 1.2
|
wanderInterval: 1.2
|
||||||
|
consumeCooldown: 5
|
||||||
trickPrefab: {fileID: 700000005}
|
trickPrefab: {fileID: 700000005}
|
||||||
|
avoidPlayerRadius: 1.2
|
||||||
|
avoidTrickRadius: 0.8
|
||||||
|
treatSeekWeight: 1
|
||||||
|
avoidPlayerWeight: 0.25
|
||||||
|
avoidTrickWeight: 0.2
|
||||||
|
wanderWeight: 0.4
|
||||||
|
maxTricks: 50
|
||||||
|
jumpImpulse: 6
|
||||||
|
jumpCooldown: 1
|
||||||
|
jumpChancePerSecond: 0.5
|
||||||
|
groundMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
groundCheckDistance: 0.05
|
||||||
|
|||||||
+50
-237
@@ -686,84 +686,6 @@ Rigidbody2D:
|
|||||||
m_SleepingMode: 1
|
m_SleepingMode: 1
|
||||||
m_CollisionDetection: 0
|
m_CollisionDetection: 0
|
||||||
m_Constraints: 0
|
m_Constraints: 0
|
||||||
--- !u!1 &477169534
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 477169536}
|
|
||||||
- component: {fileID: 477169535}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Right Barrier
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!61 &477169535
|
|
||||||
BoxCollider2D:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 477169534}
|
|
||||||
m_Enabled: 1
|
|
||||||
serializedVersion: 3
|
|
||||||
m_Density: 1
|
|
||||||
m_Material: {fileID: 0}
|
|
||||||
m_IncludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_ExcludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_LayerOverridePriority: 0
|
|
||||||
m_ForceSendLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_ForceReceiveLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_ContactCaptureLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_CallbackLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_IsTrigger: 0
|
|
||||||
m_UsedByEffector: 0
|
|
||||||
m_CompositeOperation: 0
|
|
||||||
m_CompositeOrder: 0
|
|
||||||
m_Offset: {x: 0, y: 1.4146457}
|
|
||||||
m_SpriteTilingProperty:
|
|
||||||
border: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
pivot: {x: 0, y: 0}
|
|
||||||
oldSize: {x: 0, y: 0}
|
|
||||||
newSize: {x: 0, y: 0}
|
|
||||||
adaptiveTilingThreshold: 0
|
|
||||||
drawMode: 0
|
|
||||||
adaptiveTiling: 0
|
|
||||||
m_AutoTiling: 0
|
|
||||||
m_Size: {x: 1, y: 6.956403}
|
|
||||||
m_EdgeRadius: 0
|
|
||||||
--- !u!4 &477169536
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 477169534}
|
|
||||||
serializedVersion: 2
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: 6.8, y: 1.94, z: 0}
|
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!1 &486463122
|
--- !u!1 &486463122
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -1039,84 +961,6 @@ Transform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
|
||||||
--- !u!1 &689117238
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 689117240}
|
|
||||||
- component: {fileID: 689117239}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Left Barrier
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!61 &689117239
|
|
||||||
BoxCollider2D:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 689117238}
|
|
||||||
m_Enabled: 1
|
|
||||||
serializedVersion: 3
|
|
||||||
m_Density: 1
|
|
||||||
m_Material: {fileID: 0}
|
|
||||||
m_IncludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_ExcludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_LayerOverridePriority: 0
|
|
||||||
m_ForceSendLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_ForceReceiveLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_ContactCaptureLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_CallbackLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_IsTrigger: 0
|
|
||||||
m_UsedByEffector: 0
|
|
||||||
m_CompositeOperation: 0
|
|
||||||
m_CompositeOrder: 0
|
|
||||||
m_Offset: {x: 0, y: 1.4146457}
|
|
||||||
m_SpriteTilingProperty:
|
|
||||||
border: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
pivot: {x: 0, y: 0}
|
|
||||||
oldSize: {x: 0, y: 0}
|
|
||||||
newSize: {x: 0, y: 0}
|
|
||||||
adaptiveTilingThreshold: 0
|
|
||||||
drawMode: 0
|
|
||||||
adaptiveTiling: 0
|
|
||||||
m_AutoTiling: 0
|
|
||||||
m_Size: {x: 1, y: 6.956403}
|
|
||||||
m_EdgeRadius: 0
|
|
||||||
--- !u!4 &689117240
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 689117238}
|
|
||||||
serializedVersion: 2
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: -6.82, y: 1.25, z: 0}
|
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!1 &707098062
|
--- !u!1 &707098062
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -1621,6 +1465,7 @@ MonoBehaviour:
|
|||||||
spawnInterval: 5
|
spawnInterval: 5
|
||||||
maxAlive: 0
|
maxAlive: 0
|
||||||
spawnOnStart: 1
|
spawnOnStart: 1
|
||||||
|
repeatSpawns: 1
|
||||||
--- !u!4 &908853550
|
--- !u!4 &908853550
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -2006,6 +1851,7 @@ MonoBehaviour:
|
|||||||
spawnInterval: 5
|
spawnInterval: 5
|
||||||
maxAlive: 0
|
maxAlive: 0
|
||||||
spawnOnStart: 1
|
spawnOnStart: 1
|
||||||
|
repeatSpawns: 1
|
||||||
--- !u!4 &1466477813
|
--- !u!4 &1466477813
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -2021,84 +1867,6 @@ Transform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &1518904086
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 1518904088}
|
|
||||||
- component: {fileID: 1518904087}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Top Barrier
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!61 &1518904087
|
|
||||||
BoxCollider2D:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1518904086}
|
|
||||||
m_Enabled: 1
|
|
||||||
serializedVersion: 3
|
|
||||||
m_Density: 1
|
|
||||||
m_Material: {fileID: 0}
|
|
||||||
m_IncludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_ExcludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_LayerOverridePriority: 0
|
|
||||||
m_ForceSendLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_ForceReceiveLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_ContactCaptureLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_CallbackLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_IsTrigger: 0
|
|
||||||
m_UsedByEffector: 0
|
|
||||||
m_CompositeOperation: 0
|
|
||||||
m_CompositeOrder: 0
|
|
||||||
m_Offset: {x: 0, y: 1.4146457}
|
|
||||||
m_SpriteTilingProperty:
|
|
||||||
border: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
pivot: {x: 0, y: 0}
|
|
||||||
oldSize: {x: 0, y: 0}
|
|
||||||
newSize: {x: 0, y: 0}
|
|
||||||
adaptiveTilingThreshold: 0
|
|
||||||
drawMode: 0
|
|
||||||
adaptiveTiling: 0
|
|
||||||
m_AutoTiling: 0
|
|
||||||
m_Size: {x: 1, y: 6.956403}
|
|
||||||
m_EdgeRadius: 0
|
|
||||||
--- !u!4 &1518904088
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1518904086}
|
|
||||||
serializedVersion: 2
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068}
|
|
||||||
m_LocalPosition: {x: 4.19, y: 5.55, z: 0}
|
|
||||||
m_LocalScale: {x: 1, y: 2.94, z: 1}
|
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
|
|
||||||
--- !u!1 &1654086541
|
--- !u!1 &1654086541
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -2367,6 +2135,7 @@ MonoBehaviour:
|
|||||||
spawnInterval: 5
|
spawnInterval: 5
|
||||||
maxAlive: 0
|
maxAlive: 0
|
||||||
spawnOnStart: 1
|
spawnOnStart: 1
|
||||||
|
repeatSpawns: 1
|
||||||
--- !u!4 &1759124604
|
--- !u!4 &1759124604
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -2415,6 +2184,7 @@ MonoBehaviour:
|
|||||||
spawnInterval: 5
|
spawnInterval: 5
|
||||||
maxAlive: 0
|
maxAlive: 0
|
||||||
spawnOnStart: 1
|
spawnOnStart: 1
|
||||||
|
repeatSpawns: 1
|
||||||
--- !u!4 &1830238253
|
--- !u!4 &1830238253
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -2754,6 +2524,51 @@ MonoBehaviour:
|
|||||||
spawnInterval: 3
|
spawnInterval: 3
|
||||||
maxAlive: 1
|
maxAlive: 1
|
||||||
spawnOnStart: 1
|
spawnOnStart: 1
|
||||||
|
repeatSpawns: 0
|
||||||
|
--- !u!1 &2100000100
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 2100000101}
|
||||||
|
- component: {fileID: 2100000102}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Trick Collision Manager
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &2100000101
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2100000100}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &2100000102
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2100000100}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 44f2fea877e8498fa4898917356fb2e6, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1001 &1760117322204329348
|
--- !u!1001 &1760117322204329348
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -2842,9 +2657,6 @@ SceneRoots:
|
|||||||
- {fileID: 808792726}
|
- {fileID: 808792726}
|
||||||
- {fileID: 495541366}
|
- {fileID: 495541366}
|
||||||
- {fileID: 1118230347}
|
- {fileID: 1118230347}
|
||||||
- {fileID: 477169536}
|
|
||||||
- {fileID: 1518904088}
|
|
||||||
- {fileID: 689117240}
|
|
||||||
- {fileID: 1760117322204329348}
|
- {fileID: 1760117322204329348}
|
||||||
- {fileID: 1277412258}
|
- {fileID: 1277412258}
|
||||||
- {fileID: 1227312797}
|
- {fileID: 1227312797}
|
||||||
@@ -2858,3 +2670,4 @@ SceneRoots:
|
|||||||
- {fileID: 29258076}
|
- {fileID: 29258076}
|
||||||
- {fileID: 375061916}
|
- {fileID: 375061916}
|
||||||
- {fileID: 2100000001}
|
- {fileID: 2100000001}
|
||||||
|
- {fileID: 2100000101}
|
||||||
|
|||||||
@@ -83,31 +83,49 @@ public class PlayerPickupController : MonoBehaviour
|
|||||||
Debug.Log(colliders.Length + " colliders found in range");
|
Debug.Log(colliders.Length + " colliders found in range");
|
||||||
foreach (var col in colliders)
|
foreach (var col in colliders)
|
||||||
{
|
{
|
||||||
if (col.CompareTag("Interactable"))
|
if (col.gameObject == gameObject)
|
||||||
{
|
{
|
||||||
heldObject = col.gameObject;
|
continue;
|
||||||
|
|
||||||
// Parent the object to the HoldPoint and reset its local position
|
|
||||||
heldObject.transform.SetParent(holdPoint);
|
|
||||||
heldObject.transform.localPosition = Vector3.zero;
|
|
||||||
heldObject.transform.localRotation = Quaternion.identity;
|
|
||||||
|
|
||||||
// Disable physics so it doesn't fall or collide with the player
|
|
||||||
if (heldObject.TryGetComponent<Rigidbody2D>(out Rigidbody2D rb))
|
|
||||||
{
|
|
||||||
rb.bodyType = RigidbodyType2D.Kinematic;
|
|
||||||
rb.gravityScale = 0;
|
|
||||||
rb.mass = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (heldObject.TryGetComponent<TrickController>(out var trick))
|
|
||||||
{
|
|
||||||
trick.SetCarried(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (col != null) col.enabled = false;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var hasTrick = col.TryGetComponent<TrickController>(out var trick);
|
||||||
|
var hasPlayer = col.TryGetComponent<PlayerPlatformerController>(out var playerController);
|
||||||
|
if (!hasTrick && !hasPlayer && !col.CompareTag("Interactable"))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
heldObject = col.gameObject;
|
||||||
|
|
||||||
|
// Parent the object to the HoldPoint and reset its local position
|
||||||
|
heldObject.transform.SetParent(holdPoint);
|
||||||
|
heldObject.transform.localPosition = Vector3.zero;
|
||||||
|
heldObject.transform.localRotation = Quaternion.identity;
|
||||||
|
|
||||||
|
// Disable physics so it doesn't fall or collide with the player
|
||||||
|
if (heldObject.TryGetComponent<Rigidbody2D>(out Rigidbody2D rb))
|
||||||
|
{
|
||||||
|
rb.bodyType = RigidbodyType2D.Kinematic;
|
||||||
|
rb.gravityScale = 0;
|
||||||
|
rb.mass = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trick != null)
|
||||||
|
{
|
||||||
|
trick.SetCarried(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (playerController != null)
|
||||||
|
{
|
||||||
|
playerController.enabled = false;
|
||||||
|
if (heldObject.TryGetComponent<PlayerPickupController>(out var heldPickup))
|
||||||
|
{
|
||||||
|
heldPickup.enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (col != null) col.enabled = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,6 +141,14 @@ public class PlayerPickupController : MonoBehaviour
|
|||||||
{
|
{
|
||||||
trick.SetCarried(false);
|
trick.SetCarried(false);
|
||||||
}
|
}
|
||||||
|
if (heldObject.TryGetComponent<PlayerPlatformerController>(out var playerController))
|
||||||
|
{
|
||||||
|
playerController.enabled = true;
|
||||||
|
if (heldObject.TryGetComponent<PlayerPickupController>(out var heldPickup))
|
||||||
|
{
|
||||||
|
heldPickup.enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
Collider2D col = heldObject.GetComponent<Collider2D>();
|
Collider2D col = heldObject.GetComponent<Collider2D>();
|
||||||
if (col != null) col.enabled = true;
|
if (col != null) col.enabled = true;
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ public class Spawner : MonoBehaviour
|
|||||||
public float spawnInterval = 1f;
|
public float spawnInterval = 1f;
|
||||||
[SerializeField] private int maxAlive = 0;
|
[SerializeField] private int maxAlive = 0;
|
||||||
[SerializeField] private bool spawnOnStart = true;
|
[SerializeField] private bool spawnOnStart = true;
|
||||||
|
[SerializeField] private bool repeatSpawns = true;
|
||||||
|
|
||||||
private readonly List<GameObject> spawned = new List<GameObject>();
|
private readonly List<GameObject> spawned = new List<GameObject>();
|
||||||
|
|
||||||
@@ -23,8 +24,11 @@ public class Spawner : MonoBehaviour
|
|||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
// Start the spawning process using a Coroutine
|
if (repeatSpawns)
|
||||||
StartCoroutine(SpawnRoutine());
|
{
|
||||||
|
// Start the spawning process using a Coroutine
|
||||||
|
StartCoroutine(SpawnRoutine());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator SpawnRoutine()
|
private IEnumerator SpawnRoutine()
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class TrickCollisionManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
private bool initialized;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Initialize()
|
||||||
|
{
|
||||||
|
if (initialized)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var trickLayer = LayerMask.NameToLayer("Trick");
|
||||||
|
if (trickLayer == -1)
|
||||||
|
{
|
||||||
|
Debug.LogWarning("Trick layer not found. Create a layer named 'Trick' and assign it to Trick prefab.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Physics2D.IgnoreLayerCollision(trickLayer, trickLayer, true);
|
||||||
|
initialized = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 44f2fea877e8498fa4898917356fb2e6
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -1,16 +1,36 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
using Random = UnityEngine.Random;
|
||||||
|
|
||||||
[RequireComponent(typeof(Rigidbody2D))]
|
[RequireComponent(typeof(Rigidbody2D))]
|
||||||
[RequireComponent(typeof(Collider2D))]
|
[RequireComponent(typeof(Collider2D))]
|
||||||
public class TrickController : MonoBehaviour
|
public class TrickController : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
private static readonly List<TrickController> ActiveTricks = new List<TrickController>();
|
||||||
|
private static PlayerPlatformerController[] cachedPlayers = Array.Empty<PlayerPlatformerController>();
|
||||||
|
private static float nextPlayerCacheTime;
|
||||||
|
|
||||||
[SerializeField] private string treatTag = "Interactable";
|
[SerializeField] private string treatTag = "Interactable";
|
||||||
[SerializeField] private float moveSpeed = 3.5f;
|
[SerializeField] private float moveSpeed = 3.5f;
|
||||||
[SerializeField] private float targetRefreshInterval = 0.4f;
|
[SerializeField] private float targetRefreshInterval = 0.4f;
|
||||||
[SerializeField] private float consumeDistance = 0.35f;
|
[SerializeField] private float consumeDistance = 0.35f;
|
||||||
[SerializeField] private float wanderInterval = 1.2f;
|
[SerializeField] private float wanderInterval = 1.2f;
|
||||||
|
[SerializeField] private float consumeCooldown = 1.5f;
|
||||||
[SerializeField] private TrickController trickPrefab;
|
[SerializeField] private TrickController trickPrefab;
|
||||||
|
[SerializeField] private float avoidPlayerRadius = 1.2f;
|
||||||
|
[SerializeField] private float avoidTrickRadius = 0.8f;
|
||||||
|
[SerializeField] private float treatSeekWeight = 1f;
|
||||||
|
[SerializeField] private float avoidPlayerWeight = 0.25f;
|
||||||
|
[SerializeField] private float avoidTrickWeight = 0.2f;
|
||||||
|
[SerializeField] private float wanderWeight = 0.4f;
|
||||||
|
[SerializeField] private int maxTricks = 50;
|
||||||
|
[SerializeField] private float jumpImpulse = 6f;
|
||||||
|
[SerializeField] private float jumpCooldown = 1f;
|
||||||
|
[SerializeField] private float jumpChancePerSecond = 0.5f;
|
||||||
|
[SerializeField] private LayerMask groundMask = ~0;
|
||||||
|
[SerializeField] private float groundCheckDistance = 0.05f;
|
||||||
|
|
||||||
private Rigidbody2D body;
|
private Rigidbody2D body;
|
||||||
private Transform target;
|
private Transform target;
|
||||||
@@ -18,6 +38,9 @@ public class TrickController : MonoBehaviour
|
|||||||
private Vector2 wanderDirection;
|
private Vector2 wanderDirection;
|
||||||
private float nextWanderTime;
|
private float nextWanderTime;
|
||||||
private bool isCarried;
|
private bool isCarried;
|
||||||
|
private float nextConsumeTime;
|
||||||
|
private float desiredXVelocity;
|
||||||
|
private float nextJumpTime;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
@@ -29,6 +52,20 @@ public class TrickController : MonoBehaviour
|
|||||||
body.interpolation = RigidbodyInterpolation2D.Interpolate;
|
body.interpolation = RigidbodyInterpolation2D.Interpolate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
if (!ActiveTricks.Contains(this))
|
||||||
|
{
|
||||||
|
ActiveTricks.Add(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
ActiveTricks.Remove(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (isCarried)
|
if (isCarried)
|
||||||
@@ -52,7 +89,7 @@ public class TrickController : MonoBehaviour
|
|||||||
nextTargetTime = Time.time + targetRefreshInterval;
|
nextTargetTime = Time.time + targetRefreshInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target == null && Time.time >= nextWanderTime)
|
if (Time.time >= nextWanderTime)
|
||||||
{
|
{
|
||||||
wanderDirection = Random.insideUnitCircle.normalized;
|
wanderDirection = Random.insideUnitCircle.normalized;
|
||||||
if (wanderDirection.sqrMagnitude < 0.01f)
|
if (wanderDirection.sqrMagnitude < 0.01f)
|
||||||
@@ -72,22 +109,53 @@ public class TrickController : MonoBehaviour
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!IsGrounded())
|
||||||
|
{
|
||||||
|
var airborne = body.linearVelocity;
|
||||||
|
airborne.x = 0f;
|
||||||
|
body.linearVelocity = airborne;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Vector2 desiredVelocity;
|
Vector2 desiredVelocity;
|
||||||
var stopForTreat = false;
|
var stopForTreat = false;
|
||||||
if (target != null)
|
var avoidPlayerDirection = GetAvoidPlayerDirection();
|
||||||
|
var avoidTrickDirection = GetAvoidTrickDirection();
|
||||||
|
var hasTarget = target != null;
|
||||||
|
var canConsume = Time.time >= nextConsumeTime;
|
||||||
|
|
||||||
|
var desiredX = 0f;
|
||||||
|
if (hasTarget)
|
||||||
{
|
{
|
||||||
var direction = ((Vector2)target.position - (Vector2)transform.position).normalized;
|
var direction = ((Vector2)target.position - (Vector2)transform.position).normalized;
|
||||||
desiredVelocity = new Vector2(direction.x * moveSpeed, 0f);
|
desiredX += direction.x * treatSeekWeight;
|
||||||
stopForTreat = Vector2.Distance(transform.position, target.position) <= consumeDistance;
|
stopForTreat = Vector2.Distance(transform.position, target.position) <= consumeDistance;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
desiredVelocity = new Vector2(wanderDirection.x * (moveSpeed * 0.6f), 0f);
|
desiredX += wanderDirection.x * wanderWeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!hasTarget || !canConsume)
|
||||||
|
{
|
||||||
|
desiredX += avoidPlayerDirection * avoidPlayerWeight;
|
||||||
|
}
|
||||||
|
desiredX += avoidTrickDirection * avoidTrickWeight;
|
||||||
|
|
||||||
|
if (Mathf.Abs(desiredX) < 0.01f)
|
||||||
|
{
|
||||||
|
desiredX = wanderDirection.x * 0.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
desiredVelocity = new Vector2(Mathf.Clamp(desiredX, -1f, 1f) * moveSpeed, 0f);
|
||||||
|
|
||||||
var velocity = body.linearVelocity;
|
var velocity = body.linearVelocity;
|
||||||
velocity.x = stopForTreat ? 0f : desiredVelocity.x;
|
desiredXVelocity = stopForTreat ? 0f : desiredVelocity.x;
|
||||||
|
velocity.x = Mathf.Lerp(velocity.x, desiredXVelocity, 0.25f);
|
||||||
body.linearVelocity = velocity;
|
body.linearVelocity = velocity;
|
||||||
|
|
||||||
|
var isMoving = Mathf.Abs(desiredXVelocity) > 0.1f;
|
||||||
|
TryJump(isMoving);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Transform FindNearestTreat()
|
private Transform FindNearestTreat()
|
||||||
@@ -136,6 +204,11 @@ public class TrickController : MonoBehaviour
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Time.time < nextConsumeTime)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var hits = Physics2D.OverlapCircleAll(transform.position, consumeDistance);
|
var hits = Physics2D.OverlapCircleAll(transform.position, consumeDistance);
|
||||||
for (var i = 0; i < hits.Length; i++)
|
for (var i = 0; i < hits.Length; i++)
|
||||||
{
|
{
|
||||||
@@ -152,12 +225,18 @@ public class TrickController : MonoBehaviour
|
|||||||
target = null;
|
target = null;
|
||||||
}
|
}
|
||||||
SpawnTrick(spawnPosition);
|
SpawnTrick(spawnPosition);
|
||||||
|
nextConsumeTime = Time.time + consumeCooldown;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SpawnTrick(Vector3 position)
|
private void SpawnTrick(Vector3 position)
|
||||||
{
|
{
|
||||||
|
if (maxTricks > 0 && ActiveTricks.Count >= maxTricks)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (trickPrefab != null)
|
if (trickPrefab != null)
|
||||||
{
|
{
|
||||||
Instantiate(trickPrefab, position, Quaternion.identity);
|
Instantiate(trickPrefab, position, Quaternion.identity);
|
||||||
@@ -167,6 +246,131 @@ public class TrickController : MonoBehaviour
|
|||||||
Instantiate(gameObject, position, Quaternion.identity);
|
Instantiate(gameObject, position, Quaternion.identity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private float GetAvoidPlayerDirection()
|
||||||
|
{
|
||||||
|
if (Time.time >= nextPlayerCacheTime)
|
||||||
|
{
|
||||||
|
cachedPlayers = FindObjectsByType<PlayerPlatformerController>(FindObjectsSortMode.None);
|
||||||
|
nextPlayerCacheTime = Time.time + 0.5f;
|
||||||
|
}
|
||||||
|
|
||||||
|
var players = cachedPlayers;
|
||||||
|
if (players == null || players.Length == 0)
|
||||||
|
{
|
||||||
|
return 0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
Transform closest = null;
|
||||||
|
var closestDist = float.MaxValue;
|
||||||
|
var origin = transform.position;
|
||||||
|
for (var i = 0; i < players.Length; i++)
|
||||||
|
{
|
||||||
|
var candidate = players[i];
|
||||||
|
if (candidate == null || !candidate.gameObject.activeInHierarchy)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var dist = Vector2.Distance(origin, candidate.transform.position);
|
||||||
|
if (dist < closestDist)
|
||||||
|
{
|
||||||
|
closestDist = dist;
|
||||||
|
closest = candidate.transform;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (closest == null || closestDist > avoidPlayerRadius)
|
||||||
|
{
|
||||||
|
return 0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Mathf.Sign(origin.x - closest.position.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
private float GetAvoidTrickDirection()
|
||||||
|
{
|
||||||
|
if (ActiveTricks.Count <= 1)
|
||||||
|
{
|
||||||
|
return 0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
Transform closest = null;
|
||||||
|
var closestDist = float.MaxValue;
|
||||||
|
var origin = transform.position;
|
||||||
|
for (var i = 0; i < ActiveTricks.Count; i++)
|
||||||
|
{
|
||||||
|
var candidate = ActiveTricks[i];
|
||||||
|
if (candidate == null || candidate == this || !candidate.gameObject.activeInHierarchy)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var dist = Vector2.Distance(origin, candidate.transform.position);
|
||||||
|
if (dist < closestDist)
|
||||||
|
{
|
||||||
|
closestDist = dist;
|
||||||
|
closest = candidate.transform;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (closest == null || closestDist > avoidTrickRadius)
|
||||||
|
{
|
||||||
|
return 0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Mathf.Sign(origin.x - closest.position.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TryJump(bool isMoving)
|
||||||
|
{
|
||||||
|
if (!isMoving || Time.time < nextJumpTime)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsGrounded())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var chance = jumpChancePerSecond * Time.fixedDeltaTime;
|
||||||
|
if (Random.value > chance)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var velocity = body.linearVelocity;
|
||||||
|
velocity.y = 0f;
|
||||||
|
body.linearVelocity = velocity;
|
||||||
|
body.AddForce(Vector2.up * jumpImpulse, ForceMode2D.Impulse);
|
||||||
|
nextJumpTime = Time.time + jumpCooldown;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool IsGrounded()
|
||||||
|
{
|
||||||
|
var collider = GetComponent<Collider2D>();
|
||||||
|
if (collider == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var bounds = collider.bounds;
|
||||||
|
var checkSize = new Vector2(bounds.size.x * 0.9f, groundCheckDistance * 2f);
|
||||||
|
var checkCenter = new Vector2(bounds.center.x, bounds.min.y - groundCheckDistance);
|
||||||
|
var hits = Physics2D.OverlapBoxAll(checkCenter, checkSize, 0f, groundMask);
|
||||||
|
for (var i = 0; i < hits.Length; i++)
|
||||||
|
{
|
||||||
|
var hit = hits[i];
|
||||||
|
if (hit != null && hit != collider)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void SetCarried(bool carried)
|
public void SetCarried(bool carried)
|
||||||
{
|
{
|
||||||
isCarried = carried;
|
isCarried = carried;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ TagManager:
|
|||||||
- Default
|
- Default
|
||||||
- TransparentFX
|
- TransparentFX
|
||||||
- Ignore Raycast
|
- Ignore Raycast
|
||||||
-
|
- Trick
|
||||||
- Water
|
- Water
|
||||||
- UI
|
- UI
|
||||||
-
|
-
|
||||||
@@ -42,3 +42,5 @@ TagManager:
|
|||||||
- name: Default
|
- name: Default
|
||||||
uniqueID: 0
|
uniqueID: 0
|
||||||
locked: 0
|
locked: 0
|
||||||
|
m_RenderingLayers:
|
||||||
|
- Default
|
||||||
|
|||||||
Reference in New Issue
Block a user