修改命名空间和脚本名称
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AdvancedRope.Editor
|
||||
namespace NB.Rope.Editor
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
public class AssetRatingPrompt : EditorWindow
|
||||
|
||||
@@ -3,9 +3,9 @@ using UnityEditor.UIElements;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace AdvancedRope.Editor
|
||||
namespace NB.Rope.Editor
|
||||
{
|
||||
[CustomEditor(typeof(VerletRopeGenerator))]
|
||||
[CustomEditor(typeof(VerletRope))]
|
||||
public class VerletRopeGeneratorEditor : UnityEditor.Editor
|
||||
{
|
||||
public override VisualElement CreateInspectorGUI()
|
||||
@@ -32,7 +32,7 @@ namespace AdvancedRope.Editor
|
||||
{
|
||||
if (target == null) return;
|
||||
|
||||
var rope = (VerletRopeGenerator)target;
|
||||
var rope = (VerletRope)target;
|
||||
var isDirty = false;
|
||||
|
||||
if (rope.initialPinPoints != null)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
namespace AdvancedRope
|
||||
namespace NB.Rope
|
||||
{
|
||||
public interface IRopeRenderer
|
||||
{
|
||||
void Bind(VerletRopeGenerator ropeGenerator);
|
||||
void Bind(VerletRope rope);
|
||||
void Rebuild();
|
||||
void Render();
|
||||
void Clear();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace AdvancedRope
|
||||
namespace NB.Rope
|
||||
{
|
||||
[RequireComponent(typeof(LineRenderer))]
|
||||
public class RopeLineRenderer : MonoBehaviour, IRopeRenderer
|
||||
@@ -9,7 +9,7 @@ namespace AdvancedRope
|
||||
[SerializeField] private bool syncWidthWithRenderRadius = true;
|
||||
[SerializeField] private float widthMultiplier = 2f;
|
||||
|
||||
private VerletRopeGenerator _ropeGenerator;
|
||||
private VerletRope _rope;
|
||||
private LineRenderer _lineRenderer;
|
||||
private Vector3[] _positions;
|
||||
|
||||
@@ -19,20 +19,20 @@ namespace AdvancedRope
|
||||
ConfigureLineRenderer();
|
||||
}
|
||||
|
||||
public void Bind(VerletRopeGenerator ropeGenerator)
|
||||
public void Bind(VerletRope rope)
|
||||
{
|
||||
_ropeGenerator = ropeGenerator;
|
||||
_rope = rope;
|
||||
}
|
||||
|
||||
public void Rebuild()
|
||||
{
|
||||
if (_ropeGenerator == null) return;
|
||||
if (_rope == null) return;
|
||||
|
||||
if (!_lineRenderer)
|
||||
_lineRenderer = GetComponent<LineRenderer>();
|
||||
|
||||
ConfigureLineRenderer();
|
||||
ResizePositionBuffer(_ropeGenerator.Nodes.Count);
|
||||
ResizePositionBuffer(_rope.Nodes.Count);
|
||||
ApplyWidth();
|
||||
SyncPositions();
|
||||
_lineRenderer.enabled = true;
|
||||
@@ -65,9 +65,9 @@ namespace AdvancedRope
|
||||
|
||||
private void ApplyWidth()
|
||||
{
|
||||
if (!_lineRenderer || _ropeGenerator == null || !syncWidthWithRenderRadius) return;
|
||||
if (!_lineRenderer || _rope == null || !syncWidthWithRenderRadius) return;
|
||||
|
||||
var width = Mathf.Max(0.0001f, _ropeGenerator.RenderRadius * widthMultiplier);
|
||||
var width = Mathf.Max(0.0001f, _rope.RenderRadius * widthMultiplier);
|
||||
_lineRenderer.startWidth = width;
|
||||
_lineRenderer.endWidth = width;
|
||||
}
|
||||
@@ -85,9 +85,9 @@ namespace AdvancedRope
|
||||
|
||||
private void SyncPositions()
|
||||
{
|
||||
if (_ropeGenerator == null || !_lineRenderer) return;
|
||||
if (_rope == null || !_lineRenderer) return;
|
||||
|
||||
var nodes = _ropeGenerator.Nodes;
|
||||
var nodes = _rope.Nodes;
|
||||
var nodeCount = nodes.Count;
|
||||
if (nodeCount == 0)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace AdvancedRope
|
||||
namespace NB.Rope
|
||||
{
|
||||
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
|
||||
public class RopeMeshRenderer : MonoBehaviour, IRopeRenderer
|
||||
@@ -8,7 +8,7 @@ namespace AdvancedRope
|
||||
[SerializeField] private int radialSegments = 8;
|
||||
[SerializeField] private float textureTiling = 1f;
|
||||
|
||||
private VerletRopeGenerator _ropeGenerator;
|
||||
private VerletRope _rope;
|
||||
private MeshFilter _meshFilter;
|
||||
private Mesh _mesh;
|
||||
private Vector3[] _vertices;
|
||||
@@ -21,9 +21,9 @@ namespace AdvancedRope
|
||||
_meshFilter = GetComponent<MeshFilter>();
|
||||
}
|
||||
|
||||
public void Bind(VerletRopeGenerator ropeGenerator)
|
||||
public void Bind(VerletRope rope)
|
||||
{
|
||||
_ropeGenerator = ropeGenerator;
|
||||
_rope = rope;
|
||||
}
|
||||
|
||||
public void Rebuild()
|
||||
@@ -43,7 +43,7 @@ namespace AdvancedRope
|
||||
|
||||
private void SetupRopeMesh()
|
||||
{
|
||||
if (_ropeGenerator == null) return;
|
||||
if (_rope == null) return;
|
||||
if (!_meshFilter) _meshFilter = GetComponent<MeshFilter>();
|
||||
|
||||
var segmentCount = Mathf.Max(3, radialSegments);
|
||||
@@ -63,8 +63,8 @@ namespace AdvancedRope
|
||||
|
||||
_meshFilter.sharedMesh = _mesh;
|
||||
|
||||
_radius = _ropeGenerator.RenderRadius;
|
||||
var nodes = _ropeGenerator.Nodes;
|
||||
_radius = _rope.RenderRadius;
|
||||
var nodes = _rope.Nodes;
|
||||
var vertexCount = nodes.Count * (segmentCount + 1) + 2;
|
||||
var triCount = (nodes.Count - 1) * segmentCount * 6;
|
||||
var capTrisCount = (segmentCount * 3) * 2;
|
||||
@@ -142,13 +142,13 @@ namespace AdvancedRope
|
||||
|
||||
private void UpdateMeshVertices()
|
||||
{
|
||||
if (_ropeGenerator == null || _mesh == null) return;
|
||||
if (_rope == null || _mesh == null) return;
|
||||
|
||||
var segmentCount = Mathf.Max(3, radialSegments);
|
||||
var uvTiling = Mathf.Max(0.01f, textureTiling);
|
||||
|
||||
var verletTransform = _ropeGenerator.transform;
|
||||
var nodes = _ropeGenerator.Nodes;
|
||||
var verletTransform = _rope.transform;
|
||||
var nodes = _rope.Nodes;
|
||||
if (nodes.Count < 2) return;
|
||||
|
||||
var lastRotation = Quaternion.identity;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AdvancedRope
|
||||
namespace NB.Rope
|
||||
{
|
||||
public enum RopeDisconnectType
|
||||
{
|
||||
@@ -12,14 +12,14 @@ namespace AdvancedRope
|
||||
}
|
||||
public class RopeController : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private VerletRopeGenerator ropePrefab;
|
||||
[SerializeField] private VerletRope ropePrefab;
|
||||
|
||||
/// <summary>
|
||||
/// Increases the length of the rope for 1 unit
|
||||
/// </summary>
|
||||
/// <param name="rope"></param>
|
||||
/// <param name="maxRopeNodeCount"></param>
|
||||
public static void IncreaseRopeLength(VerletRopeGenerator rope, int maxRopeNodeCount = 50)
|
||||
public static void IncreaseRopeLength(VerletRope rope, int maxRopeNodeCount = 50)
|
||||
{
|
||||
if(rope.Nodes.Count >= maxRopeNodeCount) return;
|
||||
rope.IncreaseLength();
|
||||
@@ -30,7 +30,7 @@ namespace AdvancedRope
|
||||
/// </summary>
|
||||
/// <param name="rope"></param>
|
||||
/// <param name="lengthDelta">Length to add in world units</param>
|
||||
public static void IncreaseRopeLength(VerletRopeGenerator rope, float lengthDelta)
|
||||
public static void IncreaseRopeLength(VerletRope rope, float lengthDelta)
|
||||
{
|
||||
if (!rope || lengthDelta <= 0f) return;
|
||||
rope.IncreaseLength(lengthDelta);
|
||||
@@ -41,7 +41,7 @@ namespace AdvancedRope
|
||||
/// </summary>
|
||||
/// <param name="rope"></param>
|
||||
/// <param name="minRopeNodeCount"></param>
|
||||
public static void DecreaseRopeLength(VerletRopeGenerator rope, int minRopeNodeCount = 2)
|
||||
public static void DecreaseRopeLength(VerletRope rope, int minRopeNodeCount = 2)
|
||||
{
|
||||
if(rope.Nodes.Count <= minRopeNodeCount) return;
|
||||
rope.DecreaseLength();
|
||||
@@ -52,7 +52,7 @@ namespace AdvancedRope
|
||||
/// </summary>
|
||||
/// <param name="rope"></param>
|
||||
/// <param name="lengthDelta">Length to remove in world units</param>
|
||||
public static void DecreaseRopeLength(VerletRopeGenerator rope, float lengthDelta)
|
||||
public static void DecreaseRopeLength(VerletRope rope, float lengthDelta)
|
||||
{
|
||||
if (!rope || lengthDelta <= 0f) return;
|
||||
rope.DecreaseLength(lengthDelta);
|
||||
@@ -67,7 +67,7 @@ namespace AdvancedRope
|
||||
/// <param name="startLocalPos"></param>
|
||||
/// <param name="connectionOffset"></param>
|
||||
/// <returns></returns>
|
||||
public VerletRopeGenerator ConnectRope(Transform startTransform, VerletRopeGenerator endRope,
|
||||
public VerletRope ConnectRope(Transform startTransform, VerletRope endRope,
|
||||
int targetNodeIndex, Vector3 startLocalPos = default, Vector3 connectionOffset = default)
|
||||
{
|
||||
var rope = Instantiate(ropePrefab);
|
||||
@@ -87,7 +87,7 @@ namespace AdvancedRope
|
||||
/// <param name="startLocalPos"></param>
|
||||
/// <param name="endLocalPos"></param>
|
||||
/// <returns> Connected Rope</returns>
|
||||
public VerletRopeGenerator ConnectRope(Transform startTransform, Transform endTransform, Vector3 startLocalPos = default, Vector3 endLocalPos = default)
|
||||
public VerletRope ConnectRope(Transform startTransform, Transform endTransform, Vector3 startLocalPos = default, Vector3 endLocalPos = default)
|
||||
{
|
||||
var rope = Instantiate(ropePrefab);
|
||||
rope.ropeStartPoint = startTransform.TransformPoint(startLocalPos);
|
||||
@@ -106,7 +106,7 @@ namespace AdvancedRope
|
||||
/// <param name="startLocalPos"></param>
|
||||
/// <param name="endLocalPos"></param>
|
||||
/// <returns> Connected Rope </returns>
|
||||
public VerletRopeGenerator ConnectRope(Transform startTransform, Rigidbody endRigidbody, Vector3 startLocalPos = default, Vector3 endLocalPos = default)
|
||||
public VerletRope ConnectRope(Transform startTransform, Rigidbody endRigidbody, Vector3 startLocalPos = default, Vector3 endLocalPos = default)
|
||||
{
|
||||
var rope = Instantiate(ropePrefab);
|
||||
//rope.InitializeRope();
|
||||
@@ -126,7 +126,7 @@ namespace AdvancedRope
|
||||
/// <param name="startLocalPos"></param>
|
||||
/// <param name="endLocalPos"></param>
|
||||
/// <returns> Connected Rope </returns>
|
||||
public VerletRopeGenerator ConnectRope(Rigidbody startRigidbody, Rigidbody endRigidbody, Vector3 startLocalPos = default, Vector3 endLocalPos = default)
|
||||
public VerletRope ConnectRope(Rigidbody startRigidbody, Rigidbody endRigidbody, Vector3 startLocalPos = default, Vector3 endLocalPos = default)
|
||||
{
|
||||
var rope = Instantiate(ropePrefab);
|
||||
//rope.InitializeRope();
|
||||
@@ -145,7 +145,7 @@ namespace AdvancedRope
|
||||
/// <param name="targetRope"></param>
|
||||
/// <param name="targetNodeIndex"></param>
|
||||
/// <param name="connectionOffset"></param>
|
||||
public static void ConnectRopeStart(VerletRopeGenerator rope, VerletRopeGenerator targetRope, int targetNodeIndex, Vector3 connectionOffset = default)
|
||||
public static void ConnectRopeStart(VerletRope rope, VerletRope targetRope, int targetNodeIndex, Vector3 connectionOffset = default)
|
||||
{
|
||||
if(!rope || !targetRope) return;
|
||||
rope.UnpinNode(0);
|
||||
@@ -158,7 +158,7 @@ namespace AdvancedRope
|
||||
/// <param name="rope"></param>
|
||||
/// <param name="startTransform"></param>
|
||||
/// <param name="localPos"></param>
|
||||
public static void ConnectRopeStart(VerletRopeGenerator rope, Transform startTransform, Vector3 localPos = default)
|
||||
public static void ConnectRopeStart(VerletRope rope, Transform startTransform, Vector3 localPos = default)
|
||||
{
|
||||
if (!rope) return;
|
||||
rope.PinNode(0, startTransform, localPos);
|
||||
@@ -170,7 +170,7 @@ namespace AdvancedRope
|
||||
/// <param name="rope"></param>
|
||||
/// <param name="startRigidbody"></param>
|
||||
/// <param name="localPos"></param>
|
||||
public static void ConnectRopeStart(VerletRopeGenerator rope, Rigidbody startRigidbody, Vector3 localPos = default)
|
||||
public static void ConnectRopeStart(VerletRope rope, Rigidbody startRigidbody, Vector3 localPos = default)
|
||||
{
|
||||
if (!rope) return;
|
||||
rope.ConnectStartRigidbody(startRigidbody, localPos, 0);
|
||||
@@ -182,7 +182,7 @@ namespace AdvancedRope
|
||||
/// <param name="rope"></param>
|
||||
/// <param name="startRigidbody"></param>
|
||||
/// <param name="localPos"></param>
|
||||
public static void ConnectRopeStart(VerletRopeGenerator rope, Rigidbody startRigidbody, Vector3 localPos = default, float timeToReach = 0.5f)
|
||||
public static void ConnectRopeStart(VerletRope rope, Rigidbody startRigidbody, Vector3 localPos = default, float timeToReach = 0.5f)
|
||||
{
|
||||
if (!rope) return;
|
||||
rope.ConnectStartRigidbody(startRigidbody, localPos, timeToReach);
|
||||
@@ -195,7 +195,7 @@ namespace AdvancedRope
|
||||
/// <param name="targetRope"></param>
|
||||
/// <param name="targetNodeIndex"></param>
|
||||
/// <param name="connectionOffset"></param>
|
||||
public static void ConnectRopeEnd(VerletRopeGenerator rope, VerletRopeGenerator targetRope, int targetNodeIndex, Vector3 connectionOffset = default)
|
||||
public static void ConnectRopeEnd(VerletRope rope, VerletRope targetRope, int targetNodeIndex, Vector3 connectionOffset = default)
|
||||
{
|
||||
if(!rope || !targetRope) return;
|
||||
rope.UnpinNode(-1);
|
||||
@@ -208,7 +208,7 @@ namespace AdvancedRope
|
||||
/// <param name="rope"></param>
|
||||
/// <param name="endTransform"></param>
|
||||
/// <param name="localPos"></param>
|
||||
public static void ConnectRopeEnd(VerletRopeGenerator rope, Transform endTransform, Vector3 localPos = default)
|
||||
public static void ConnectRopeEnd(VerletRope rope, Transform endTransform, Vector3 localPos = default)
|
||||
{
|
||||
if (!rope) return;
|
||||
rope.PinNode(-1, endTransform, localPos);
|
||||
@@ -220,7 +220,7 @@ namespace AdvancedRope
|
||||
/// <param name="rope"></param>
|
||||
/// <param name="endRigidbody"></param>
|
||||
/// <param name="localPos"></param>
|
||||
public static void ConnectRopeEnd(VerletRopeGenerator rope, Rigidbody endRigidbody, Vector3 localPos = default)
|
||||
public static void ConnectRopeEnd(VerletRope rope, Rigidbody endRigidbody, Vector3 localPos = default)
|
||||
{
|
||||
if (!rope) return;
|
||||
rope.ConnectEndRigidbody(endRigidbody, localPos);
|
||||
@@ -234,7 +234,7 @@ namespace AdvancedRope
|
||||
/// <param name="disconnectType"> Start, End, Both, Destroy</param>
|
||||
/// <returns> Disconnected Rope: null if rope destroyed</returns>
|
||||
/// <exception cref="ArgumentOutOfRangeException"></exception>
|
||||
public VerletRopeGenerator DisconnectRope(VerletRopeGenerator rope, RopeDisconnectType disconnectType)
|
||||
public VerletRope DisconnectRope(VerletRope rope, RopeDisconnectType disconnectType)
|
||||
{
|
||||
switch (disconnectType)
|
||||
{
|
||||
@@ -258,14 +258,14 @@ namespace AdvancedRope
|
||||
}
|
||||
}
|
||||
|
||||
private static void DisconnectRopeStart(VerletRopeGenerator rope)
|
||||
private static void DisconnectRopeStart(VerletRope rope)
|
||||
{
|
||||
rope.DisconnectStartRigidbody();
|
||||
rope.UnpinNode(0);
|
||||
rope.DisconnectFromOtherRope(0);
|
||||
}
|
||||
|
||||
private static void DisconnectRopeEnd(VerletRopeGenerator rope)
|
||||
private static void DisconnectRopeEnd(VerletRope rope)
|
||||
{
|
||||
rope.DisconnectEndRigidbody();
|
||||
rope.UnpinNode(-1);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace AdvancedRope.TEST
|
||||
namespace NB.Rope.TEST
|
||||
{
|
||||
public class FurGenerator : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Transform capsuleTransform;
|
||||
[SerializeField] private VerletRopeGenerator furPrefab;
|
||||
[SerializeField] private VerletRope furPrefab;
|
||||
[SerializeField] private float furLength = 0.5f;
|
||||
[SerializeField] private float radius = 0.5f;
|
||||
[SerializeField] private float height = 2f;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
using UnityEngine.InputSystem;
|
||||
#endif
|
||||
|
||||
namespace AdvancedRope.TEST
|
||||
namespace NB.Rope.TEST
|
||||
{
|
||||
[RequireComponent(typeof(RopeController))]
|
||||
public class RopeConnectorTest : MonoBehaviour
|
||||
@@ -16,7 +16,7 @@ namespace AdvancedRope.TEST
|
||||
[SerializeField] private int minRopeNodeCount = 4;
|
||||
|
||||
private RopeController _ropeController;
|
||||
private VerletRopeGenerator _activeRope = null;
|
||||
private VerletRope _activeRope = null;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace AdvancedRope.TEST
|
||||
namespace NB.Rope.TEST
|
||||
{
|
||||
public class RopeLengthTest : MonoBehaviour
|
||||
{
|
||||
[Header("Input")] [SerializeField] private KeyCode extendKey = KeyCode.UpArrow;
|
||||
[SerializeField] private KeyCode retractKey = KeyCode.DownArrow;
|
||||
[SerializeField] private VerletRopeGenerator rope = null;
|
||||
[SerializeField] private VerletRope rope = null;
|
||||
|
||||
[Header("Length Change")]
|
||||
[Min(0.001f)] [SerializeField] private float clickLengthDelta = 0.1f;
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AdvancedRope
|
||||
namespace NB.Rope
|
||||
{
|
||||
public static class VerletPhysics
|
||||
{
|
||||
private static List<VerletRopeGenerator> ropeGenerators = new List<VerletRopeGenerator>();
|
||||
private static List<VerletRope> ropeGenerators = new List<VerletRope>();
|
||||
|
||||
public static void RegisterRopeGenerator(VerletRopeGenerator generator)
|
||||
public static void RegisterRopeGenerator(VerletRope generator)
|
||||
{
|
||||
if (!ropeGenerators.Contains(generator))
|
||||
{
|
||||
ropeGenerators.Add(generator);
|
||||
}
|
||||
}
|
||||
public static void UnregisterRopeGenerator(VerletRopeGenerator generator)
|
||||
public static void UnregisterRopeGenerator(VerletRope generator)
|
||||
{
|
||||
if (ropeGenerators.Contains(generator))
|
||||
{
|
||||
@@ -51,14 +51,14 @@ namespace AdvancedRope
|
||||
hitInfo = default;
|
||||
return false;
|
||||
}
|
||||
public static bool Raycast(Ray ray, out RopeHitInfo hitInfo, float maxDistance, VerletRopeGenerator excludeGenerator)
|
||||
public static bool Raycast(Ray ray, out RopeHitInfo hitInfo, float maxDistance, VerletRope exclude)
|
||||
{
|
||||
var closestHitDistance = float.MaxValue;
|
||||
var isHit = false;
|
||||
RopeHitInfo tempHitInfo = default;
|
||||
foreach (var generator in ropeGenerators)
|
||||
{
|
||||
if (generator == excludeGenerator) continue;
|
||||
if (generator == exclude) continue;
|
||||
if (generator.Raycast(ray, out var hit, maxDistance))
|
||||
{
|
||||
if (hit.Distance >= closestHitDistance) continue;
|
||||
|
||||
@@ -3,12 +3,12 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace AdvancedRope
|
||||
namespace NB.Rope
|
||||
{
|
||||
/// <summary>
|
||||
/// 用于生成并模拟基于 Verlet 积分绳索的基类。
|
||||
/// </summary>
|
||||
public class VerletRopeGenerator : MonoBehaviour
|
||||
public class VerletRope : MonoBehaviour
|
||||
{
|
||||
#region --- 数据结构 ---
|
||||
|
||||
@@ -897,7 +897,7 @@ namespace AdvancedRope
|
||||
/// <param name="targetRope"></param>
|
||||
/// <param name="targetNodeIndex"></param>
|
||||
/// <param name="connectionOffset"></param>
|
||||
public void ConnectEndToOtherRope(VerletRopeGenerator targetRope, int targetNodeIndex,
|
||||
public void ConnectEndToOtherRope(VerletRope targetRope, int targetNodeIndex,
|
||||
Vector3 connectionOffset = default)
|
||||
{
|
||||
ConnectToOtherRope(-1, targetRope, targetNodeIndex, connectionOffset);
|
||||
@@ -909,7 +909,7 @@ namespace AdvancedRope
|
||||
/// <param name="targetRope"></param>
|
||||
/// <param name="targetNodeIndex"></param>
|
||||
/// <param name="connectionOffset"></param>
|
||||
public void ConnectStartToOtherRope(VerletRopeGenerator targetRope, int targetNodeIndex,
|
||||
public void ConnectStartToOtherRope(VerletRope targetRope, int targetNodeIndex,
|
||||
Vector3 connectionOffset = default)
|
||||
{
|
||||
ConnectToOtherRope(0, targetRope, targetNodeIndex, connectionOffset);
|
||||
@@ -921,7 +921,7 @@ namespace AdvancedRope
|
||||
/// <param name="myNodeIndex">0 表示起点,-1 表示末尾节点</param>
|
||||
/// <param name="targetRope"></param>
|
||||
/// <param name="targetNodeIndex">0 表示起点,-1 表示末尾节点</param>
|
||||
public void ConnectToOtherRope(int myNodeIndex, VerletRopeGenerator targetRope, int targetNodeIndex,
|
||||
public void ConnectToOtherRope(int myNodeIndex, VerletRope targetRope, int targetNodeIndex,
|
||||
Vector3 connectionOffset = default)
|
||||
{
|
||||
if (myNodeIndex < 0)
|
||||
@@ -1142,7 +1142,7 @@ namespace AdvancedRope
|
||||
public struct RopeHitInfo
|
||||
{
|
||||
public bool DidHit;
|
||||
public VerletRopeGenerator Rope;
|
||||
public VerletRope Rope;
|
||||
public Vector3 Point;
|
||||
public int NodeIndex;
|
||||
public Vector3 NodePoint;
|
||||
Reference in New Issue
Block a user