提交测试代码
This commit is contained in:
@@ -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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,6 +62,21 @@ namespace NBF
|
||||
return base.onUpdate();
|
||||
}
|
||||
|
||||
// IEnumerator ThrowCoroutine(float distance)
|
||||
// {
|
||||
// float startLength = 0.5f;
|
||||
// Debug.Log($"REST LENGTH : {rope.restLength}");
|
||||
// do
|
||||
// {
|
||||
// float a = Vector3.Distance(rodTipTarget.position, attachedBody.transform.position);
|
||||
// attachedBody.RBody.AddForce(playerForward.Value, ForceMode.VelocityChange);
|
||||
// startLength = Mathf.Max(a, startLength);
|
||||
// UnwindLine(attachedBody.RBody.linearVelocity.magnitude * Time.deltaTime);
|
||||
// yield return null;
|
||||
// }
|
||||
// while ((bool)isBailOpen);
|
||||
// }
|
||||
|
||||
#region 动画回调
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user