TO SQUASH: Jesus!!
This commit is contained in:
@@ -15,7 +15,7 @@ GameObject:
|
||||
- component: {fileID: 7615983206007795092}
|
||||
m_Layer: 0
|
||||
m_Name: Multiplier
|
||||
m_TagString: Untagged
|
||||
m_TagString: Multiplier
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
||||
@@ -15,7 +15,7 @@ GameObject:
|
||||
- component: {fileID: 9009920913057869968}
|
||||
m_Layer: 0
|
||||
m_Name: Yummy Cake
|
||||
m_TagString: Untagged
|
||||
m_TagString: Cake
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
||||
@@ -17,7 +17,7 @@ GameObject:
|
||||
- component: {fileID: 4454036095454607731}
|
||||
m_Layer: 0
|
||||
m_Name: Yummy Key
|
||||
m_TagString: Untagged
|
||||
m_TagString: Yummy
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
||||
@@ -17,7 +17,7 @@ GameObject:
|
||||
- component: {fileID: 73796386522735159}
|
||||
m_Layer: 0
|
||||
m_Name: Yummy Laser
|
||||
m_TagString: Untagged
|
||||
m_TagString: Yummy
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
||||
@@ -17,7 +17,7 @@ GameObject:
|
||||
- component: {fileID: 2335857606835315079}
|
||||
m_Layer: 0
|
||||
m_Name: Yummy Lighting
|
||||
m_TagString: Untagged
|
||||
m_TagString: Yummy
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
||||
@@ -17,7 +17,7 @@ GameObject:
|
||||
- component: {fileID: 6803592096152538444}
|
||||
m_Layer: 0
|
||||
m_Name: Yummy Magnet
|
||||
m_TagString: Untagged
|
||||
m_TagString: Yummy
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
||||
+79
-292
@@ -479,76 +479,11 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 2fc998065c092c32ba2452cd6a674a11, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::GameBoard
|
||||
--- !u!1001 &158295601
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 470931998}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2488006274611708423, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Right Wall
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 0.4711937
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 5.684477
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
--- !u!4 &158295602
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 158295601}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1574878631}
|
||||
serializedVersion: 2
|
||||
@@ -562,8 +497,8 @@ Transform:
|
||||
--- !u!1 &165746693
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 2488006274611708423, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 211439207}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
@@ -706,76 +641,11 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::PlayerGun
|
||||
player: {fileID: 1002905792}
|
||||
--- !u!1001 &211439207
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 470931998}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2488006274611708423, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Left Wall
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 0.4711937
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 5.684477
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -5.2159
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -0.020399999
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
--- !u!4 &211439208
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 211439207}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 165746693}
|
||||
serializedVersion: 2
|
||||
@@ -789,8 +659,8 @@ Transform:
|
||||
--- !u!61 &211439209
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 8285901344894209984, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 211439207}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 165746693}
|
||||
m_Enabled: 1
|
||||
@@ -836,8 +706,8 @@ BoxCollider2D:
|
||||
SpriteRenderer:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 4404011415574388754, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 211439207}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 165746693}
|
||||
m_Enabled: 1
|
||||
@@ -1347,8 +1217,8 @@ Transform:
|
||||
--- !u!1 &520286537
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 2488006274611708423, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 2046728457}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
@@ -1362,6 +1232,50 @@ GameObject:
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &683765007
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 683765008}
|
||||
- component: {fileID: 683765009}
|
||||
m_Layer: 0
|
||||
m_Name: WallResetter
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &683765008
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 683765007}
|
||||
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: 2111939185}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &683765009
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 683765007}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1e92faff401e6e3e692af8d2386af093, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::WallResetter
|
||||
--- !u!1 &739145244
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1986,6 +1900,8 @@ MonoBehaviour:
|
||||
magnetTop: {fileID: 797752166}
|
||||
magnetBottom: {fileID: 1573512371}
|
||||
ballSpawner: {fileID: 240489636}
|
||||
percentCovered: 0
|
||||
multiplier: 1
|
||||
--- !u!50 &1002905794
|
||||
Rigidbody2D:
|
||||
serializedVersion: 5
|
||||
@@ -2511,8 +2427,8 @@ Transform:
|
||||
--- !u!1 &1574878631
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 2488006274611708423, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 158295601}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
@@ -2529,8 +2445,8 @@ GameObject:
|
||||
--- !u!61 &1574878632
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 8285901344894209984, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 158295601}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1574878631}
|
||||
m_Enabled: 1
|
||||
@@ -2576,8 +2492,8 @@ BoxCollider2D:
|
||||
SpriteRenderer:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 4404011415574388754, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 158295601}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1574878631}
|
||||
m_Enabled: 1
|
||||
@@ -2737,76 +2653,11 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 83f9939f8fdda54efa78f609f9bceff5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Foreground
|
||||
--- !u!1001 &2046728457
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 470931998}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2488006274611708423, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Bottom Wall
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 5.988229
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 0.1811
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -2.62
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -2.5106
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
--- !u!4 &2046728458
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 2046728457}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 520286537}
|
||||
serializedVersion: 2
|
||||
@@ -2820,8 +2671,8 @@ Transform:
|
||||
--- !u!61 &2046728459
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 8285901344894209984, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 2046728457}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 520286537}
|
||||
m_Enabled: 1
|
||||
@@ -2867,8 +2718,8 @@ BoxCollider2D:
|
||||
SpriteRenderer:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 4404011415574388754, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 2046728457}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 520286537}
|
||||
m_Enabled: 1
|
||||
@@ -2926,8 +2777,8 @@ SpriteRenderer:
|
||||
--- !u!1 &2050805086
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 2488006274611708423, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 6411489164306657136}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
@@ -2945,8 +2796,8 @@ GameObject:
|
||||
SpriteRenderer:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 4404011415574388754, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 6411489164306657136}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2050805086}
|
||||
m_Enabled: 1
|
||||
@@ -3004,8 +2855,8 @@ SpriteRenderer:
|
||||
--- !u!4 &2050805088
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 6411489164306657136}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2050805086}
|
||||
serializedVersion: 2
|
||||
@@ -3019,8 +2870,8 @@ Transform:
|
||||
--- !u!61 &2050805089
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 8285901344894209984, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
m_PrefabInstance: {fileID: 6411489164306657136}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2050805086}
|
||||
m_Enabled: 1
|
||||
@@ -3203,6 +3054,7 @@ Transform:
|
||||
- {fileID: 933658175}
|
||||
- {fileID: 2071167547}
|
||||
- {fileID: 449049743}
|
||||
- {fileID: 683765008}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &6303327586367475970
|
||||
@@ -3262,71 +3114,6 @@ PrefabInstance:
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: fbe1d443766d4188baad245008533051, type: 3}
|
||||
--- !u!1001 &6411489164306657136
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 470931998}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2488006274611708423, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Top Wall
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 6.2875
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 0.175
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -1.9705
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 2.481
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6675538070334790218, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 17457027881e49da796223e4ed876a56, type: 3}
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -33,7 +33,7 @@ public class BasicBall : BallBase
|
||||
|
||||
// Update is called once per frame
|
||||
void FixedUpdate()
|
||||
{
|
||||
{
|
||||
AnimatorStateInfo stateInfo = animator.GetCurrentAnimatorStateInfo(0);
|
||||
|
||||
if (stateInfo.IsName("BasicBallMove")) {
|
||||
@@ -77,6 +77,8 @@ public class BasicBall : BallBase
|
||||
collision.gameObject.CompareTag("FruitBall") ||
|
||||
collision.gameObject.CompareTag("Shark"))
|
||||
{
|
||||
// Force reset the rotation.
|
||||
transform.rotation = Quaternion.identity;
|
||||
ContactPoint2D contact = collision.GetContact(0);
|
||||
speed = Vector2.Reflect(speed, contact.normal);
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class Multiplier : MonoBehaviour
|
||||
if (stateTimer >= stateDuration)
|
||||
{
|
||||
stateTimer = 0f;
|
||||
multiplierValue = ((multiplierValue + 1) % 4);
|
||||
multiplierValue = (multiplierValue + 1) % 4;
|
||||
multiplierAnimator.SetInteger("bonus", multiplierValue + 1);
|
||||
}
|
||||
|
||||
@@ -66,4 +66,25 @@ public class Multiplier : MonoBehaviour
|
||||
yield return new WaitForSeconds(1.5f);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
public void AwardToPlayer(Player player)
|
||||
{
|
||||
if (isActive)
|
||||
{
|
||||
isActive = false;
|
||||
if (multiplierValue == 0)
|
||||
{
|
||||
audioSource.PlayOneShot(gotHalfSound);
|
||||
player.multiplier = 0.5f;
|
||||
}
|
||||
else
|
||||
{
|
||||
audioSource.PlayOneShot(gotItSound);
|
||||
player.multiplier = (float)(multiplierValue + 1);
|
||||
}
|
||||
|
||||
multiplierSpriteRenderer.enabled = false;
|
||||
StartCoroutine(DestroyAfterDelay());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@ public class Player : MonoBehaviour
|
||||
|
||||
public int percentCovered = 0;
|
||||
|
||||
public float multiplier = 1.0f;
|
||||
|
||||
private bool flipped = false;
|
||||
|
||||
private bool gameOver = false;
|
||||
@@ -517,4 +519,10 @@ public class Player : MonoBehaviour
|
||||
Physics2D.IgnoreCollision(collision.collider, GetComponent<Collider2D>(), true);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnWallSpawned(int areaPercentage)
|
||||
{
|
||||
canFire = true;
|
||||
// TODO: Award points based on the area of the spawned wall.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,8 @@ public class Shark : MonoBehaviour
|
||||
|
||||
private float currentTargetTimer = 0f;
|
||||
|
||||
private bool killed = false;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
@@ -154,11 +156,9 @@ public class Shark : MonoBehaviour
|
||||
// Do stuff only if the spawn animation has finished.
|
||||
if (spawnFinished)
|
||||
{
|
||||
// TODO: Check if the shark was killed.
|
||||
|
||||
|
||||
if (isDead)
|
||||
if (killed && !isDead)
|
||||
{
|
||||
isDead = true;
|
||||
animator.SetTrigger("killed");
|
||||
audioSource.PlayOneShot(deathSound);
|
||||
player.score += sharkKillPoints;
|
||||
@@ -288,6 +288,15 @@ public class Shark : MonoBehaviour
|
||||
);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
void OnCollisionEnter2D(Collision2D collision)
|
||||
{
|
||||
if (collision.gameObject.CompareTag("Wall"))
|
||||
{
|
||||
Physics2D.IgnoreCollision(collision.collider, GetComponent<Collider2D>());
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
if(other.gameObject.CompareTag("Bar"))
|
||||
@@ -314,4 +323,9 @@ public class Shark : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void KillShark()
|
||||
{
|
||||
killed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class WallResetter : MonoBehaviour
|
||||
{
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
var walls = GameObject.FindGameObjectsWithTag("Wall");
|
||||
|
||||
foreach (var wall in walls)
|
||||
{
|
||||
wall.transform.rotation = Quaternion.identity;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1e92faff401e6e3e692af8d2386af093
|
||||
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class WorldFiller : MonoBehaviour
|
||||
{
|
||||
@@ -8,16 +9,27 @@ public class WorldFiller : MonoBehaviour
|
||||
|
||||
public GameObject wallPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private float fallbackBarThicknessWorldUnits = 0.08f;
|
||||
|
||||
[SerializeField]
|
||||
private float geometryEpsilon = 0.0001f;
|
||||
|
||||
private Bounds gameBoardBounds;
|
||||
|
||||
private Vector2?[] wallPositions;
|
||||
|
||||
private int wallCount = 0;
|
||||
|
||||
private List<Rect> freeAreas = new List<Rect>();
|
||||
|
||||
private float boardArea;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
gameBoardBounds = gameBoardSpriteRenderer.bounds;
|
||||
InitializeFreeAreas();
|
||||
ClearWalls();
|
||||
}
|
||||
|
||||
@@ -50,15 +62,159 @@ public class WorldFiller : MonoBehaviour
|
||||
{
|
||||
Debug.Log($"Spawning wall with wall line: ({wallPositions[0]}, {wallPositions[1]})");
|
||||
|
||||
Vector2 wallPointA = wallPositions[0].Value;
|
||||
Vector2 wallPointB = wallPositions[1].Value;
|
||||
|
||||
if (Vector2.Distance(wallPointA, wallPointB) <= geometryEpsilon)
|
||||
{
|
||||
Debug.LogWarning("Wall points are too close. Skipping wall spawn.");
|
||||
ClearWalls();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get all the balls in the scene.
|
||||
var ballSpawner = FindAnyObjectByType<BallSpawner>();
|
||||
var balls = ballSpawner.GetBalls();
|
||||
var balls = ballSpawner != null ? ballSpawner.GetBalls() : null;
|
||||
|
||||
// There are three possible scenarios for the wall positions:
|
||||
// 1. Only one side of the wall line is empty (either left or right).
|
||||
// 2. All sides of the wall line are occupied.
|
||||
// 3. All sides of the wall line are empty.
|
||||
bool isVerticalLine = Mathf.Abs(wallPointA.x - wallPointB.x) <= Mathf.Abs(wallPointA.y - wallPointB.y);
|
||||
float lineCenter = isVerticalLine ? (wallPointA.x + wallPointB.x) * 0.5f : (wallPointA.y + wallPointB.y) * 0.5f;
|
||||
float lineMin = isVerticalLine ? Mathf.Min(wallPointA.y, wallPointB.y) : Mathf.Min(wallPointA.x, wallPointB.x);
|
||||
float lineMax = isVerticalLine ? Mathf.Max(wallPointA.y, wallPointB.y) : Mathf.Max(wallPointA.x, wallPointB.x);
|
||||
|
||||
float barThickness = GetCurrentBarThickness(isVerticalLine);
|
||||
float halfBarThickness = barThickness * 0.5f;
|
||||
|
||||
Rect activeArea = FindActiveArea((wallPointA + wallPointB) * 0.5f, isVerticalLine, lineCenter, lineMin, lineMax);
|
||||
DetermineSideOccupancy(
|
||||
balls,
|
||||
activeArea,
|
||||
isVerticalLine,
|
||||
lineCenter,
|
||||
halfBarThickness,
|
||||
out bool sideAHasBall,
|
||||
out bool sideBHasBall
|
||||
);
|
||||
|
||||
Rect targetWallRect;
|
||||
|
||||
// Spawn scenarios:
|
||||
// 1) Both sides empty => fill the whole available region.
|
||||
// 2) Only one side empty => fill that free side plus the bar strip.
|
||||
// 3) Both sides occupied => spawn only along the wall line, with bar thickness.
|
||||
if (!sideAHasBall && !sideBHasBall)
|
||||
{
|
||||
targetWallRect = activeArea;
|
||||
}
|
||||
else if (sideAHasBall && sideBHasBall)
|
||||
{
|
||||
if (isVerticalLine)
|
||||
{
|
||||
targetWallRect = Rect.MinMaxRect(
|
||||
lineCenter - halfBarThickness,
|
||||
lineMin,
|
||||
lineCenter + halfBarThickness,
|
||||
lineMax
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetWallRect = Rect.MinMaxRect(
|
||||
lineMin,
|
||||
lineCenter - halfBarThickness,
|
||||
lineMax,
|
||||
lineCenter + halfBarThickness
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isVerticalLine)
|
||||
{
|
||||
// Side A is left, side B is right for vertical lines.
|
||||
targetWallRect = !sideAHasBall
|
||||
? Rect.MinMaxRect(activeArea.xMin, activeArea.yMin, lineCenter + halfBarThickness, activeArea.yMax)
|
||||
: Rect.MinMaxRect(lineCenter - halfBarThickness, activeArea.yMin, activeArea.xMax, activeArea.yMax);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Side A is bottom, side B is top for horizontal lines.
|
||||
targetWallRect = !sideAHasBall
|
||||
? Rect.MinMaxRect(activeArea.xMin, activeArea.yMin, activeArea.xMax, lineCenter + halfBarThickness)
|
||||
: Rect.MinMaxRect(activeArea.xMin, lineCenter - halfBarThickness, activeArea.xMax, activeArea.yMax);
|
||||
}
|
||||
}
|
||||
|
||||
if (!TryGetRectIntersection(targetWallRect, activeArea, out Rect clampedWallRect))
|
||||
{
|
||||
Debug.LogWarning("Could not create a valid wall rectangle inside the active free area.");
|
||||
ClearWalls();
|
||||
return;
|
||||
}
|
||||
|
||||
GameObject wall = Instantiate(wallPrefab, Vector3.zero, Quaternion.identity);
|
||||
var wallRenderer = wall.GetComponentInChildren<SpriteRenderer>();
|
||||
|
||||
if (wallRenderer == null)
|
||||
{
|
||||
Debug.LogError("Wall prefab is missing a SpriteRenderer in children.");
|
||||
Destroy(wall);
|
||||
ClearWalls();
|
||||
return;
|
||||
}
|
||||
|
||||
ApplyWallTransform(wall.transform, wallRenderer, clampedWallRect);
|
||||
var wallBounds = wallRenderer.bounds;
|
||||
|
||||
UpdateFreeAreas(clampedWallRect);
|
||||
|
||||
// Check if there are yummies, multipliers or the shark intersecting the spawned wall.
|
||||
// Yummies and multipliers are awarded to the player if they are intersected by the wall.
|
||||
// The shark is killed if it is intersected by the wall.
|
||||
var yummies = GameObject.FindGameObjectsWithTag("Yummy");
|
||||
var multipliers = GameObject.FindGameObjectsWithTag("Multiplier");
|
||||
var shark = GameObject.FindGameObjectWithTag("Shark");
|
||||
|
||||
foreach (var yummy in yummies)
|
||||
{
|
||||
if (yummy != null && wallBounds.Intersects(yummy.GetComponent<SpriteRenderer>().bounds))
|
||||
{
|
||||
// Award the yummy to the player.
|
||||
YummyBase yummyBase = yummy.GetComponent<YummyBase>();
|
||||
|
||||
if (yummyBase != null)
|
||||
{
|
||||
yummyBase.AwardToPlayer(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("YummyBase component not found on yummy object.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var multiplier in multipliers)
|
||||
{
|
||||
if (multiplier != null && wallBounds.Intersects(multiplier.GetComponent<SpriteRenderer>().bounds))
|
||||
{
|
||||
// Award the multiplier to the player.
|
||||
Multiplier multiplierComponent = multiplier.GetComponent<Multiplier>();
|
||||
|
||||
if (multiplierComponent != null)
|
||||
{
|
||||
multiplierComponent.AwardToPlayer(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Multiplier component not found on multiplier object.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shark != null && wallBounds.Intersects(shark.GetComponent<SpriteRenderer>().bounds))
|
||||
{
|
||||
// Kill the shark.
|
||||
shark.GetComponent<Shark>().KillShark();
|
||||
}
|
||||
|
||||
// Destroy all bar segments after we are done.
|
||||
GameObject[] barSegments = GameObject.FindGameObjectsWithTag("Bar");
|
||||
@@ -68,8 +224,271 @@ public class WorldFiller : MonoBehaviour
|
||||
Destroy(barSegment);
|
||||
}
|
||||
|
||||
// Let the player know that the wall has been spawned.
|
||||
int areaPercentage = boardArea > geometryEpsilon
|
||||
? Mathf.RoundToInt((clampedWallRect.width * clampedWallRect.height / boardArea) * 100.0f)
|
||||
: 0;
|
||||
player.OnWallSpawned(areaPercentage);
|
||||
|
||||
// Clear the pending wall line.
|
||||
ClearWalls();
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeFreeAreas()
|
||||
{
|
||||
gameBoardBounds = gameBoardSpriteRenderer.bounds;
|
||||
|
||||
Rect boardRect = Rect.MinMaxRect(
|
||||
gameBoardBounds.min.x,
|
||||
gameBoardBounds.min.y,
|
||||
gameBoardBounds.max.x,
|
||||
gameBoardBounds.max.y
|
||||
);
|
||||
|
||||
freeAreas.Clear();
|
||||
freeAreas.Add(boardRect);
|
||||
boardArea = boardRect.width * boardRect.height;
|
||||
}
|
||||
|
||||
private float GetCurrentBarThickness(bool isVerticalLine)
|
||||
{
|
||||
var barSegments = GameObject.FindGameObjectsWithTag("Bar");
|
||||
|
||||
foreach (var barSegment in barSegments)
|
||||
{
|
||||
if (barSegment == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var spriteRenderer = barSegment.GetComponent<SpriteRenderer>();
|
||||
if (spriteRenderer == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
float thickness = isVerticalLine
|
||||
? spriteRenderer.bounds.size.x
|
||||
: spriteRenderer.bounds.size.y;
|
||||
|
||||
if (thickness > geometryEpsilon)
|
||||
{
|
||||
return thickness;
|
||||
}
|
||||
}
|
||||
|
||||
return fallbackBarThicknessWorldUnits;
|
||||
}
|
||||
|
||||
private Rect FindActiveArea(
|
||||
Vector2 lineMidpoint,
|
||||
bool isVerticalLine,
|
||||
float lineCenter,
|
||||
float lineMin,
|
||||
float lineMax)
|
||||
{
|
||||
if (freeAreas.Count == 0)
|
||||
{
|
||||
InitializeFreeAreas();
|
||||
}
|
||||
|
||||
for (int i = 0; i < freeAreas.Count; i++)
|
||||
{
|
||||
if (RectContainsWithTolerance(freeAreas[i], lineMidpoint))
|
||||
{
|
||||
return freeAreas[i];
|
||||
}
|
||||
}
|
||||
|
||||
Rect lineRect = isVerticalLine
|
||||
? Rect.MinMaxRect(lineCenter - geometryEpsilon, lineMin, lineCenter + geometryEpsilon, lineMax)
|
||||
: Rect.MinMaxRect(lineMin, lineCenter - geometryEpsilon, lineMax, lineCenter + geometryEpsilon);
|
||||
|
||||
float bestOverlap = -1.0f;
|
||||
Rect fallback = freeAreas[0];
|
||||
|
||||
for (int i = 0; i < freeAreas.Count; i++)
|
||||
{
|
||||
if (!TryGetRectIntersection(freeAreas[i], lineRect, out Rect overlap))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
float overlapArea = overlap.width * overlap.height;
|
||||
if (overlapArea > bestOverlap)
|
||||
{
|
||||
bestOverlap = overlapArea;
|
||||
fallback = freeAreas[i];
|
||||
}
|
||||
}
|
||||
|
||||
return fallback;
|
||||
}
|
||||
|
||||
private void DetermineSideOccupancy(
|
||||
Queue<GameObject> balls,
|
||||
Rect activeArea,
|
||||
bool isVerticalLine,
|
||||
float lineCenter,
|
||||
float halfBarThickness,
|
||||
out bool sideAHasBall,
|
||||
out bool sideBHasBall)
|
||||
{
|
||||
sideAHasBall = false;
|
||||
sideBHasBall = false;
|
||||
|
||||
if (balls == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var ball in balls)
|
||||
{
|
||||
if (ball == null || !ball.activeInHierarchy)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Vector2 ballPosition = ball.transform.position;
|
||||
|
||||
if (!RectContainsWithTolerance(activeArea, ballPosition))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isVerticalLine)
|
||||
{
|
||||
if (ballPosition.x < lineCenter - halfBarThickness)
|
||||
{
|
||||
sideAHasBall = true;
|
||||
}
|
||||
else if (ballPosition.x > lineCenter + halfBarThickness)
|
||||
{
|
||||
sideBHasBall = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ballPosition.x <= lineCenter)
|
||||
{
|
||||
sideAHasBall = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
sideBHasBall = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ballPosition.y < lineCenter - halfBarThickness)
|
||||
{
|
||||
sideAHasBall = true;
|
||||
}
|
||||
else if (ballPosition.y > lineCenter + halfBarThickness)
|
||||
{
|
||||
sideBHasBall = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ballPosition.y <= lineCenter)
|
||||
{
|
||||
sideAHasBall = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
sideBHasBall = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sideAHasBall && sideBHasBall)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyWallTransform(Transform wallTransform, SpriteRenderer wallRenderer, Rect targetRect)
|
||||
{
|
||||
Vector2 baseSize = wallRenderer.bounds.size;
|
||||
|
||||
if (baseSize.x <= geometryEpsilon || baseSize.y <= geometryEpsilon)
|
||||
{
|
||||
Debug.LogError("Cannot scale wall: base sprite size is invalid.");
|
||||
return;
|
||||
}
|
||||
|
||||
Vector3 currentScale = wallTransform.localScale;
|
||||
float scaleX = currentScale.x * (targetRect.width / baseSize.x);
|
||||
float scaleY = currentScale.y * (targetRect.height / baseSize.y);
|
||||
|
||||
wallTransform.localScale = new Vector3(scaleX, scaleY, currentScale.z);
|
||||
wallTransform.position = new Vector3(targetRect.center.x, targetRect.center.y, wallTransform.position.z);
|
||||
}
|
||||
|
||||
private void UpdateFreeAreas(Rect occupiedArea)
|
||||
{
|
||||
List<Rect> updatedAreas = new List<Rect>();
|
||||
|
||||
for (int i = 0; i < freeAreas.Count; i++)
|
||||
{
|
||||
Rect freeArea = freeAreas[i];
|
||||
|
||||
if (!TryGetRectIntersection(freeArea, occupiedArea, out Rect overlap))
|
||||
{
|
||||
updatedAreas.Add(freeArea);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Left remainder.
|
||||
AddValidRect(updatedAreas, Rect.MinMaxRect(freeArea.xMin, freeArea.yMin, overlap.xMin, freeArea.yMax));
|
||||
|
||||
// Right remainder.
|
||||
AddValidRect(updatedAreas, Rect.MinMaxRect(overlap.xMax, freeArea.yMin, freeArea.xMax, freeArea.yMax));
|
||||
|
||||
// Bottom remainder.
|
||||
AddValidRect(updatedAreas, Rect.MinMaxRect(overlap.xMin, freeArea.yMin, overlap.xMax, overlap.yMin));
|
||||
|
||||
// Top remainder.
|
||||
AddValidRect(updatedAreas, Rect.MinMaxRect(overlap.xMin, overlap.yMax, overlap.xMax, freeArea.yMax));
|
||||
}
|
||||
|
||||
freeAreas = updatedAreas;
|
||||
}
|
||||
|
||||
private void AddValidRect(List<Rect> target, Rect candidate)
|
||||
{
|
||||
if (candidate.width <= geometryEpsilon || candidate.height <= geometryEpsilon)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
target.Add(candidate);
|
||||
}
|
||||
|
||||
private bool TryGetRectIntersection(Rect a, Rect b, out Rect intersection)
|
||||
{
|
||||
float xMin = Mathf.Max(a.xMin, b.xMin);
|
||||
float xMax = Mathf.Min(a.xMax, b.xMax);
|
||||
float yMin = Mathf.Max(a.yMin, b.yMin);
|
||||
float yMax = Mathf.Min(a.yMax, b.yMax);
|
||||
|
||||
if (xMax - xMin <= geometryEpsilon || yMax - yMin <= geometryEpsilon)
|
||||
{
|
||||
intersection = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
intersection = Rect.MinMaxRect(xMin, yMin, xMax, yMax);
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool RectContainsWithTolerance(Rect rect, Vector2 point)
|
||||
{
|
||||
return point.x >= rect.xMin - geometryEpsilon
|
||||
&& point.x <= rect.xMax + geometryEpsilon
|
||||
&& point.y >= rect.yMin - geometryEpsilon
|
||||
&& point.y <= rect.yMax + geometryEpsilon;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,9 @@ public abstract class YummyBase : MonoBehaviour
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Force reset the rotation.
|
||||
transform.rotation = Quaternion.identity;
|
||||
transform.Translate(speed);
|
||||
|
||||
missedTimer += Time.fixedDeltaTime;
|
||||
@@ -62,17 +64,8 @@ public abstract class YummyBase : MonoBehaviour
|
||||
|
||||
if(other.gameObject.CompareTag("Bar"))
|
||||
{
|
||||
audioSource.PlayOneShot(obtainedSound);
|
||||
|
||||
var player = GameObject.FindGameObjectWithTag("Player");
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
ObtainedCallback(player.GetComponent<Player>());
|
||||
}
|
||||
|
||||
isObtained = true;
|
||||
spriteRenderer.enabled = false;
|
||||
Obtain(player.GetComponent<Player>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,5 +89,28 @@ public abstract class YummyBase : MonoBehaviour
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
public void AwardToPlayer(Player player)
|
||||
{
|
||||
Obtain(player);
|
||||
}
|
||||
|
||||
private void Obtain(Player player)
|
||||
{
|
||||
if (isObtained || isMissed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
audioSource.PlayOneShot(obtainedSound);
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
ObtainedCallback(player);
|
||||
}
|
||||
|
||||
isObtained = true;
|
||||
spriteRenderer.enabled = false;
|
||||
}
|
||||
|
||||
protected abstract void ObtainedCallback(Player player);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,9 @@ TagManager:
|
||||
- EyeBall
|
||||
- Bar
|
||||
- Shark
|
||||
- Multiplier
|
||||
- Yummy
|
||||
- Cake
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
|
||||
Reference in New Issue
Block a user