From 42fa9de511b2774abdfd53559e5585789a020baa Mon Sep 17 00:00:00 2001 From: Sveske Juice Date: Sat, 3 Feb 2024 11:32:15 -0800 Subject: [PATCH 1/3] Add players and rope to game scene --- Assets/Resources/Player1.prefab | 5 +- Assets/Resources/Player2.prefab | 2 +- Assets/Scenes/GameScene.unity | 501 +++++++++++++++++++++++++++----- 3 files changed, 426 insertions(+), 82 deletions(-) diff --git a/Assets/Resources/Player1.prefab b/Assets/Resources/Player1.prefab index 31e9dce..27feb4a 100644 --- a/Assets/Resources/Player1.prefab +++ b/Assets/Resources/Player1.prefab @@ -167,7 +167,7 @@ Transform: m_GameObject: {fileID: 3096169748286405671} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.59, y: -0.42, z: 0} + m_LocalPosition: {x: 0.05, y: -0.42, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -339,6 +339,5 @@ MonoBehaviour: m_EditorClassIdentifier: playerNumber: 0 movement: {x: 0, y: 0} + look: {x: 0, y: 0} whipAttack: 0 - ropeLengthShrinken: 0 - ropeLengthExtend: 0 diff --git a/Assets/Resources/Player2.prefab b/Assets/Resources/Player2.prefab index d77701a..2c95419 100644 --- a/Assets/Resources/Player2.prefab +++ b/Assets/Resources/Player2.prefab @@ -167,7 +167,7 @@ Transform: m_GameObject: {fileID: 3096169748286405671} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.59, y: -0.42, z: 0} + m_LocalPosition: {x: 0.13, y: -0.42, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index ad7c425..b0638f4 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -1603,6 +1603,50 @@ MonoBehaviour: m_Area: 1 m_IgnoreFromBuild: 0 m_AffectedAgents: ffffffff +--- !u!1 &147729521 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 147729522} + - component: {fileID: 147729523} + m_Layer: 0 + m_Name: Rumble + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &147729522 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 147729521} + 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: 483723115} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &147729523 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 147729521} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 89c1239a77bb4cc43b1a1552d271ab99, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &150061134 GameObject: m_ObjectHideFlags: 0 @@ -4205,7 +4249,6 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 1484404091} - {fileID: 2041669625} - {fileID: 659231496} m_Father: {fileID: 0} @@ -4311,6 +4354,38 @@ MonoBehaviour: m_Area: 1 m_IgnoreFromBuild: 0 m_AffectedAgents: ffffffff +--- !u!1 &483723114 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 483723115} + m_Layer: 0 + m_Name: References + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &483723115 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 483723114} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.7082175, y: -0.44170734, z: -0.09089095} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 147729522} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &508853267 GameObject: m_ObjectHideFlags: 0 @@ -5884,6 +5959,93 @@ MonoBehaviour: m_Area: 1 m_IgnoreFromBuild: 0 m_AffectedAgents: ffffffff +--- !u!1001 &869964773 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + propertyPath: m_LocalPosition.x + value: -2.71 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + propertyPath: m_LocalPosition.y + value: -19.97 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 651446758998956252, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + propertyPath: rumble + value: + objectReference: {fileID: 147729521} + - target: {fileID: 3120938410244321186, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + propertyPath: m_Name + value: Player2 + objectReference: {fileID: 0} + - target: {fileID: 7071433868121438663, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + propertyPath: otherPlayerAttack + value: + objectReference: {fileID: 1232208433} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} +--- !u!114 &869964774 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 7071433868121438663, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + m_PrefabInstance: {fileID: 869964773} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b69b92d72c7244443854899c4b700d9c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &869964775 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5467488512035376674, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + m_PrefabInstance: {fileID: 869964773} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4aabce12c1341ff488ee4dc806fd80e8, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &874595494 GameObject: m_ObjectHideFlags: 0 @@ -8645,6 +8807,93 @@ MonoBehaviour: m_Area: 1 m_IgnoreFromBuild: 0 m_AffectedAgents: ffffffff +--- !u!1001 &1232208432 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + propertyPath: m_LocalPosition.x + value: -20.81614 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + propertyPath: m_LocalPosition.y + value: -19.089561 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 651446758998956252, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + propertyPath: rumble + value: + objectReference: {fileID: 147729521} + - target: {fileID: 1749848915408613053, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + propertyPath: otherPlayerAttack + value: + objectReference: {fileID: 869964774} + - target: {fileID: 3120938410244321186, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + propertyPath: m_Name + value: Player1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} +--- !u!114 &1232208433 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1749848915408613053, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + m_PrefabInstance: {fileID: 1232208432} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b69b92d72c7244443854899c4b700d9c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1232208436 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5467488512035376674, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} + m_PrefabInstance: {fileID: 1232208432} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4aabce12c1341ff488ee4dc806fd80e8, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1241700200 GameObject: m_ObjectHideFlags: 0 @@ -10160,83 +10409,6 @@ MonoBehaviour: m_Area: 1 m_IgnoreFromBuild: 0 m_AffectedAgents: ffffffff ---- !u!1 &1484404090 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1484404091} - - component: {fileID: 1484404092} - m_Layer: 0 - m_Name: Area 100 x 100 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1484404091 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1484404090} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 100, y: 100, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 480860136} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!61 &1484404092 -BoxCollider2D: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1484404090} - m_Enabled: 1 - 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_UsedByComposite: 0 - m_Offset: {x: 0, y: 0} - 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 - serializedVersion: 2 - m_Size: {x: 1, y: 1} - m_EdgeRadius: 0 --- !u!1 &1496921090 GameObject: m_ObjectHideFlags: 0 @@ -14030,6 +14202,175 @@ MonoBehaviour: m_Area: 1 m_IgnoreFromBuild: 0 m_AffectedAgents: ffffffff +--- !u!1 &1920006246 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1920006249} + - component: {fileID: 1920006248} + - component: {fileID: 1920006247} + m_Layer: 0 + m_Name: Rope + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!120 &1920006247 +LineRenderer: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1920006246} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 62e10f2f26f232f49affb7663a8064fb, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Positions: [] + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.2280693 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 1 + textureScale: {x: 1, y: -1} + shadowBias: 0.5 + generateLightingData: 0 + m_MaskInteraction: 0 + m_UseWorldSpace: 1 + m_Loop: 0 + m_ApplyActiveColorSpace: 1 +--- !u!114 &1920006248 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1920006246} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 27ac133d9e10e544ba603e07122e3359, type: 3} + m_Name: + m_EditorClassIdentifier: + gravity: 15 + solveIterations: 10 + constrainStickMinLength: 0 + start: {fileID: 1232208436} + end: {fileID: 869964775} + subDivision: 50 + collisionCheckDist: 0.1 + distBetweenRopePoints: 0.35 + ropeRadius: 0.171 + ignoreResolveThreshold: 0 + ropeCollidersParent: {fileID: 1920006249} + staticColliderMask: + serializedVersion: 2 + m_Bits: 1 + pullForce: 65 + xyGravityDampScalor: 1 + ropeExtendSpeed: 10 + ropeShrinkSpeed: 15 + squezeDamage: 1 + ropeMaxLength: 50 + ropeMinLength: 20 + lineRenderer: {fileID: 1920006247} +--- !u!4 &1920006249 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1920006246} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -14.24, y: -21.93, 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 &1935640707 GameObject: m_ObjectHideFlags: 0 @@ -15692,3 +16033,7 @@ SceneRoots: - {fileID: 1600052934} - {fileID: 480860136} - {fileID: 150061137} + - {fileID: 1232208432} + - {fileID: 869964773} + - {fileID: 483723115} + - {fileID: 1920006249} From 325cf8e7bc044a5e97a02728fa7ed238f400a825 Mon Sep 17 00:00:00 2001 From: SpoodyTheOne Date: Sat, 3 Feb 2024 20:43:17 +0100 Subject: [PATCH 2/3] Finished upgrader --- Assets/Scenes/Bloody Mary.unity | 22 +++++----- Assets/Scripts/Upgrader.cs | 74 ++++++++++++++++++++++++++++++--- 2 files changed, 79 insertions(+), 17 deletions(-) diff --git a/Assets/Scenes/Bloody Mary.unity b/Assets/Scenes/Bloody Mary.unity index d40129c..1a3523c 100644 --- a/Assets/Scenes/Bloody Mary.unity +++ b/Assets/Scenes/Bloody Mary.unity @@ -181,7 +181,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 0 + m_Type: 3 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -256,7 +256,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 0 + m_Type: 3 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -741,7 +741,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 0 + m_Type: 3 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -1031,7 +1031,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 0 + m_Type: 3 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -1278,7 +1278,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 0 + m_Type: 3 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -1479,7 +1479,7 @@ GameObject: - component: {fileID: 1197965564} - component: {fileID: 1197965566} m_Layer: 5 - m_Name: UpgradeMenu + m_Name: MenuForUpgrades m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1527,7 +1527,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.392} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -1535,7 +1535,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 0 + m_Type: 3 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -1942,7 +1942,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 0 + m_Type: 3 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -2117,7 +2117,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 0 + m_Type: 3 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -2236,7 +2236,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 0 + m_Type: 3 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 diff --git a/Assets/Scripts/Upgrader.cs b/Assets/Scripts/Upgrader.cs index 272421f..15f6bc4 100644 --- a/Assets/Scripts/Upgrader.cs +++ b/Assets/Scripts/Upgrader.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using UnityEngine.UI; using UnityEngine; public class Upgrade @@ -35,10 +36,11 @@ public class Upgrader : MonoBehaviour public float mopSizeIncrease = 1.1f; public float speedIncrease = 1.1f; - public int ropeIncrease = 2; + public float ropeIncrease = 1.1f; public float healthIncrease = 1.1f; public float damageIncrease = 1.1f; public float bloodIncrease = 1.1f; + public float reelIncrease = 1.1f; public int upgradeCost = 10000; @@ -50,6 +52,10 @@ public class Upgrader : MonoBehaviour private float acceptTime = 0f; + private Image background; + + private Image[] upgradeImages = new Image[8]; + // Start is called before the first frame update void Start() { @@ -58,11 +64,41 @@ public class Upgrader : MonoBehaviour Player1Input = player1.GetComponent(); Player2Input = player2.GetComponent(); + + background = GetComponent(); + + int idx = 0; + + foreach (Image i in GetComponentsInChildren()) + { + if (i.gameObject.name.StartsWith("Upgrade")) + upgradeImages[idx++] = i; + } + + // Debug.Log("Found " + idx + " upgrades"); + + upgrades = new Upgrades(); } bool canUpgrade() { - return bloodManager.score >= upgradeCost; + // return bloodManager.score >= upgradeCost; + return true; + } + + int getRegion(float x, float y, int regions) + { + if (x + y == 0) + return -1; + + float angle = Mathf.Atan2(x, -y) + Mathf.PI; + float regionSize = (Mathf.PI * 2.0f) / ((float)regions); + int region = (int)((((Mathf.PI * 2.0f) - angle) / regionSize) + 0.5f); + + if (region > regions - 1) + return 0; + + return region; } // Update is called once per frame @@ -70,10 +106,13 @@ public class Upgrader : MonoBehaviour { if (canUpgrade()) { - int p1a = (int)((Mathf.Atan2(Player1Input.look.y, Player1Input.look.x) / Mathf.PI * 2) * 8); - int p2a = (int)((Mathf.Atan2(Player2Input.look.y, Player2Input.look.x) / Mathf.PI * 2) * 8); - if (p1a == p2a) + int p1a = getRegion(Player1Input.look.x, Player1Input.look.y, 8); + int p2a = getRegion(Player2Input.look.x, Player2Input.look.y, 8); + + Debug.Log(p1a); + + if (p1a != -1 && p2a == p1a) { if (acceptTime > 2f) { @@ -95,7 +134,7 @@ public class Upgrader : MonoBehaviour DamageUpgrade(); break; case 5: - BloodUpgrade(); + BloodUpgrade(); break; case 6: ReelUpgrade(); @@ -108,10 +147,30 @@ public class Upgrader : MonoBehaviour acceptTime = 0f; } else + { acceptTime += Time.deltaTime; + + foreach (Image i in upgradeImages) + { + i.fillAmount = 1f; + } + + upgradeImages[p1a].fillAmount = acceptTime / 2f; + } } else + { + if (acceptTime > 0f) + { + foreach (Image i in upgradeImages) + { + i.fillAmount = 1f; + } + } + acceptTime = 0f; + // background.fillAmount = 0f; + } } Player1Cursor.localPosition = Player1Input.look.normalized * (125 - 12); @@ -136,6 +195,7 @@ public class Upgrader : MonoBehaviour public void RopeUpgrade() { // todo: public methods + rope.ropeMaxLength *= ropeIncrease; upgrades.ropeUpgrade.amount++; } @@ -152,6 +212,7 @@ public class Upgrader : MonoBehaviour public void DamageUpgrade() { // todo: public rope methods + // rope.da upgrades.damageUpgrade.amount++; } @@ -164,6 +225,7 @@ public class Upgrader : MonoBehaviour public void ReelUpgrade() { // todo rope methods + rope.ropeExtendSpeed *= reelIncrease; upgrades.reelUpgrade.amount++; } From 18779699525e01f3303d1ebed82166ad6f7c0ded Mon Sep 17 00:00:00 2001 From: SpoodyTheOne Date: Sat, 3 Feb 2024 20:52:55 +0100 Subject: [PATCH 3/3] Added menu iconography to upgrade menu --- Assets/Animations/UpgradeMenu.meta | 8 +++ .../Animations/UpgradeMenu/IdleAnimation.anim | 53 +++++++++++++++++++ .../UpgradeMenu/IdleAnimation.anim.meta | 8 +++ .../UpgradeMenu/UpgradeMenu.controller | 12 +++++ .../UpgradeMenu/UpgradeMenu.controller.meta | 8 +++ 5 files changed, 89 insertions(+) create mode 100644 Assets/Animations/UpgradeMenu.meta create mode 100644 Assets/Animations/UpgradeMenu/IdleAnimation.anim create mode 100644 Assets/Animations/UpgradeMenu/IdleAnimation.anim.meta create mode 100644 Assets/Animations/UpgradeMenu/UpgradeMenu.controller create mode 100644 Assets/Animations/UpgradeMenu/UpgradeMenu.controller.meta diff --git a/Assets/Animations/UpgradeMenu.meta b/Assets/Animations/UpgradeMenu.meta new file mode 100644 index 0000000..ec95b9b --- /dev/null +++ b/Assets/Animations/UpgradeMenu.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9d71163dbbfec8de4bd8e4f9f6c88ede +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/UpgradeMenu/IdleAnimation.anim b/Assets/Animations/UpgradeMenu/IdleAnimation.anim new file mode 100644 index 0000000..aa09e25 --- /dev/null +++ b/Assets/Animations/UpgradeMenu/IdleAnimation.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: IdleAnimation + serializedVersion: 7 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Animations/UpgradeMenu/IdleAnimation.anim.meta b/Assets/Animations/UpgradeMenu/IdleAnimation.anim.meta new file mode 100644 index 0000000..1d09a78 --- /dev/null +++ b/Assets/Animations/UpgradeMenu/IdleAnimation.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7092c28a45e7f0f9aa29d627683da0b4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/UpgradeMenu/UpgradeMenu.controller b/Assets/Animations/UpgradeMenu/UpgradeMenu.controller new file mode 100644 index 0000000..97768e4 --- /dev/null +++ b/Assets/Animations/UpgradeMenu/UpgradeMenu.controller @@ -0,0 +1,12 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UpgradeMenu + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: [] diff --git a/Assets/Animations/UpgradeMenu/UpgradeMenu.controller.meta b/Assets/Animations/UpgradeMenu/UpgradeMenu.controller.meta new file mode 100644 index 0000000..0266c3f --- /dev/null +++ b/Assets/Animations/UpgradeMenu/UpgradeMenu.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7866120a2d012ae3db02cdb779b1ea00 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: