From 30233a2347d3959b45eab8263aa3dcaf3d736cf0 Mon Sep 17 00:00:00 2001 From: Sveske Juice Date: Sat, 3 Feb 2024 11:15:38 -0800 Subject: [PATCH] expose rope squeze damage & update rope texture --- Assets/Materials/Rope.mat | 2 +- Assets/Scenes/EnemyRope.unity | 7 ++++--- Assets/Scripts/Rope/RopeSimulator.cs | 5 ++++- Assets/{TempSprites => Sprites}/Rope.png | Bin 4470 -> 5407 bytes Assets/{TempSprites => Sprites}/Rope.png.meta | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) rename Assets/{TempSprites => Sprites}/Rope.png (54%) rename Assets/{TempSprites => Sprites}/Rope.png.meta (97%) diff --git a/Assets/Materials/Rope.mat b/Assets/Materials/Rope.mat index 47a10d5..983d8f9 100644 --- a/Assets/Materials/Rope.mat +++ b/Assets/Materials/Rope.mat @@ -44,7 +44,7 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _BaseMap: - m_Texture: {fileID: 2800000, guid: c19dca7dba0e0ab4eaf3d513ab5128bb, type: 3} + m_Texture: {fileID: 2800000, guid: 35a2c8d34a4b1bf44aaf5fe1847f24b9, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _BumpMap: diff --git a/Assets/Scenes/EnemyRope.unity b/Assets/Scenes/EnemyRope.unity index 8c81864..6e44196 100644 --- a/Assets/Scenes/EnemyRope.unity +++ b/Assets/Scenes/EnemyRope.unity @@ -185,7 +185,7 @@ Camera: far clip plane: 1000 field of view: 60 orthographic: 1 - orthographic size: 16.46 + orthographic size: 10.3 m_Depth: -1 m_CullingMask: serializedVersion: 2 @@ -628,7 +628,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] minThreshold: 1 - squezeDamageScalor: 0 + squezeDamageScalor: 1 --- !u!50 &220016288 Rigidbody2D: serializedVersion: 4 @@ -2046,7 +2046,7 @@ LineRenderer: numCapVertices: 0 alignment: 0 textureMode: 1 - textureScale: {x: 1, y: 1} + textureScale: {x: 1, y: -1} shadowBias: 0.5 generateLightingData: 0 m_MaskInteraction: 0 @@ -2083,6 +2083,7 @@ MonoBehaviour: xyGravityDampScalor: 1 ropeExtendSpeed: 10 ropeShrinkSpeed: 15 + squezeDamage: 1 ropeMaxLength: 50 ropeMinLength: 20 lineRenderer: {fileID: 1647138191} diff --git a/Assets/Scripts/Rope/RopeSimulator.cs b/Assets/Scripts/Rope/RopeSimulator.cs index 8001865..01a8948 100644 --- a/Assets/Scripts/Rope/RopeSimulator.cs +++ b/Assets/Scripts/Rope/RopeSimulator.cs @@ -53,9 +53,12 @@ public class RopeSimulator : MonoBehaviour [SerializeField, Range(0f, 20f)] public float ropeExtendSpeed, ropeShrinkSpeed; + public float squezeDamage = 1f; + [SerializeField] public float ropeMaxLength, ropeMinLength; + [Header("Rendering")] [SerializeField] LineRenderer lineRenderer; @@ -263,7 +266,7 @@ public class RopeSimulator : MonoBehaviour ISquezeDamageReceiver squezeDamageReceiver = collider.Key.GetComponent(); if (squezeDamageReceiver == null) continue; - squezeDamageReceiver.TakeSquezeDamage(collider.Value); + squezeDamageReceiver.TakeSquezeDamage(collider.Value * squezeDamage); } // Update line renderer diff --git a/Assets/TempSprites/Rope.png b/Assets/Sprites/Rope.png similarity index 54% rename from Assets/TempSprites/Rope.png rename to Assets/Sprites/Rope.png index 44000eef8f1a32e15f7972f49bdf05b2cef01bb1..c7d7127655d43525d03784cf804f02bf5271380a 100644 GIT binary patch delta 2173 zcmV-@2!i+aBA+UMiBL{Q4GJ0x0000DNk~Le0002x0000R2m=5B0JM*|O#lD@#ClX% zbW&k=AaHVTW@&6?Aar?fWgumEX=VTbc-n1HTMh#u2>j<1J%T)R@i=bRCcQzAUlg`k z+fL$u3>gvVujd191B3#SH!Zc4WRNPAnkAYXZ89dAJkfK1Xt>q^_YlZRY?1w{CHl`g zehfS`%ksrY?;-4~P$m5J%ZNPim}ulj7}YRhask7j`L|N3x?R7p_q0O&z#!3e?4SE) z+dHzo!$h5tlQDDg0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