提交测试代码

This commit is contained in:
Bob.Song
2026-03-06 12:15:56 +08:00
parent 209049354c
commit 7127857199
37 changed files with 1269 additions and 270 deletions

View File

@@ -1,4 +1,5 @@
using UnityEngine;
using System;
using UnityEngine;
namespace NBF
{
@@ -10,11 +11,19 @@ namespace NBF
public ConfigurableJoint Joint => joint;
private void Start()
{
RBody.detectCollisions = true;
RBody.collisionDetectionMode = CollisionDetectionMode.ContinuousDynamic;
RBody.interpolation = RigidbodyInterpolation.Interpolate;
}
public void SetJoint(Rigidbody rb)
{
joint.connectedBody = rb;
}
public void EnableCollision(bool enable)
{
if (rBody == null)
@@ -22,7 +31,7 @@ namespace NBF
rBody = GetComponent<Rigidbody>();
}
rBody.detectCollisions = enable;
// rBody.detectCollisions = enable;
}
public void SetKinematic(bool value)
@@ -37,5 +46,14 @@ namespace NBF
limit = limit
};
}
private void OnCollisionEnter(Collision other)
{
Debug.Log($"OnCollisionEnter:{other.gameObject.name}");
}
private void OnCollisionExit(Collision other)
{
Debug.Log($"OnCollisionExit:{other.gameObject.name}");
}
}
}