fix():修复场景BUG,人物摔落伤害不对BUG,添加传播控制字段
This commit is contained in:
@@ -18,6 +18,7 @@ namespace Script.Gameplay.Facility
|
||||
[SerializeField] protected int currentSignalCount = 0;
|
||||
[SerializeField] protected string componentName;
|
||||
[SerializeField] protected bool isEnableSendSignal = false;
|
||||
[SerializeField] protected bool isEnableDeliverSignal = false;
|
||||
|
||||
public virtual bool IsEnableInteract
|
||||
{
|
||||
@@ -109,11 +110,6 @@ namespace Script.Gameplay.Facility
|
||||
|
||||
public virtual void OnSignalReceived(bool active, GameObject sender)
|
||||
{
|
||||
if (isEnableSendSignal)
|
||||
{
|
||||
SendSignal(active, sender);
|
||||
}
|
||||
|
||||
if (active)
|
||||
{
|
||||
CurrentNeedSignalCount++;
|
||||
@@ -127,6 +123,11 @@ namespace Script.Gameplay.Facility
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (isEnableDeliverSignal)
|
||||
{
|
||||
SendSignal(active, sender);
|
||||
}
|
||||
// Implement signal received logic here
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ namespace Script.Gameplay.Player
|
||||
if (characterController == null)
|
||||
Debug.LogError("PlayerMoveController 需要 CharacterController 组件!");
|
||||
|
||||
lastGroundY = transform.position.y;
|
||||
initSpeed = speed;
|
||||
playerSound = playerSound != null ? playerSound : GetComponent<AudioSource>();
|
||||
if (playerSound == null)
|
||||
@@ -76,6 +77,7 @@ namespace Script.Gameplay.Player
|
||||
// 落地检测
|
||||
if (!wasGroundedLastFrame && isCurrentlyGrounded)
|
||||
{
|
||||
|
||||
float fallHeight = lastGroundY - transform.position.y;
|
||||
if (fallHeight > fallDamageThreshold) // 3米为伤害阈值,可调整
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user