diff options
Diffstat (limited to 'Assets/Scripts/Core/Rope.cs')
-rw-r--r-- | Assets/Scripts/Core/Rope.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Assets/Scripts/Core/Rope.cs b/Assets/Scripts/Core/Rope.cs index aff295a..0e12382 100644 --- a/Assets/Scripts/Core/Rope.cs +++ b/Assets/Scripts/Core/Rope.cs @@ -17,7 +17,7 @@ public class Rope : MonoBehaviour protected bool ropeCreated = false; // Start is called before the first frame update - private void Start() + protected void Start() { player = GameObject.FindGameObjectWithTag("Player"); dj = GetComponent<DistanceJoint2D>(); @@ -36,18 +36,22 @@ public class Rope : MonoBehaviour } // Update is called once per frame - private void Update() + protected void Update() { if (!ropeCreated) { CreateRope(); ropeCreated = true; } + else + { + + } RenderLine(); Simulate(); } - private void RenderLine() + protected void RenderLine() { for (int i = 0; i < ropePositions.Length; i++) { @@ -56,14 +60,14 @@ public class Rope : MonoBehaviour lr.SetPositions(ropePositions); } - private void CreateRope() + protected void CreateRope() { dj.connectedBody = player.GetComponent<Rigidbody2D>(); dj.maxDistanceOnly = true; dj.distance = Vector2.Distance(player.transform.position, transform.position); } - private void Simulate() + protected void Simulate() { Vector2 gravityForce = new Vector2(0f, -gravityMultiplier); @@ -83,7 +87,7 @@ public class Rope : MonoBehaviour } } - private void ApplyContraint() + protected void ApplyContraint() { RopeSegment endSegment1 = ropeSegments[0]; endSegment1.posNow = transform.position; |