提交
This commit is contained in:
@@ -156,6 +156,10 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
return _cutSpriteRenderer;
|
||||
}
|
||||
public SpriteRenderer GetCutTextSpriteRenderer()
|
||||
{
|
||||
return _cutTextRenderer;
|
||||
}
|
||||
|
||||
public void StartCutTextFlicker()
|
||||
{
|
||||
|
||||
@@ -200,6 +200,10 @@ namespace AibisDream.FixSystem
|
||||
PlugRef.SwitchToPhysicCableState();
|
||||
isCableRetracted = false;
|
||||
SaveCableState();
|
||||
// 添加一个短暂的延迟来确保状态正确设置
|
||||
DOVirtual.DelayedCall(0.1f, () => {
|
||||
Enable_plugInput();
|
||||
});
|
||||
});
|
||||
// 只有在非收起状态时才切换到物理线缆状态
|
||||
}
|
||||
|
||||
@@ -513,6 +513,14 @@ public class GearFollower : MonoBehaviour
|
||||
{
|
||||
sparkVFX.Play();
|
||||
}
|
||||
// 播放切割音效
|
||||
var audioManager = AibisDream.Kit.AudioManager.Instance;
|
||||
if (audioManager != null)
|
||||
{
|
||||
audioManager.PlaySfx("event:/FollowInput/drill");
|
||||
// 快速将is_drill_cutting参数从0拉到1
|
||||
audioManager.SetGlobalParam("is_drill_cutting", 1f);
|
||||
}
|
||||
}
|
||||
private void AddCutPoint(Vector3 point)
|
||||
{
|
||||
@@ -575,6 +583,15 @@ public class GearFollower : MonoBehaviour
|
||||
cutLight.enabled = false;
|
||||
cutLight.intensity = 0f;
|
||||
}
|
||||
|
||||
// 停止切割音效
|
||||
var audioManager = AibisDream.Kit.AudioManager.Instance;
|
||||
if (audioManager != null)
|
||||
{
|
||||
// 快速将is_drill_cutting参数从1拉到0
|
||||
audioManager.SetGlobalParam("is_drill_cutting", 0f);
|
||||
audioManager.StopSfx("event:/FollowInput/drill");
|
||||
}
|
||||
}
|
||||
private int FindNearestEdgePointIndex(Vector2 pos, out float minDist)
|
||||
{
|
||||
@@ -755,6 +772,15 @@ public class GearFollower : MonoBehaviour
|
||||
sparkVFX.Stop();
|
||||
}
|
||||
|
||||
// 停止切割音效
|
||||
var audioManager = AibisDream.Kit.AudioManager.Instance;
|
||||
if (audioManager != null)
|
||||
{
|
||||
// 快速将is_drill_cutting参数从1拉到0
|
||||
audioManager.SetGlobalParam("is_drill_cutting", 0f);
|
||||
audioManager.StopSfx("event:/FollowInput/drill");
|
||||
}
|
||||
|
||||
// 计算随机方向
|
||||
float randomAngle = Random.Range(-cutCompleteTiltAngle, cutCompleteTiltAngle);
|
||||
Vector2 randomOffset = Random.insideUnitCircle * cutCompleteOffset;
|
||||
@@ -763,8 +789,6 @@ public class GearFollower : MonoBehaviour
|
||||
{
|
||||
cuttingManager.StopCutTextFlicker();
|
||||
cuttingManager.SetCutTextVisible(false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 立即应用倾斜和位移
|
||||
|
||||
@@ -112,10 +112,18 @@ namespace AibisDream.FixSystem
|
||||
private void OnDrag(BaseEventData eventData)
|
||||
{
|
||||
// 系统被锁定就返回
|
||||
if (!_cableSystem.IsPlugAvailable()) return;
|
||||
if (!_cableSystem.IsPlugAvailable())
|
||||
{
|
||||
Debug.Log("OnDrag - System not available");
|
||||
return;
|
||||
}
|
||||
|
||||
// 未被拖拽也返回
|
||||
if (!_isDragging) return;
|
||||
if (!_isDragging)
|
||||
{
|
||||
Debug.Log("OnDrag - Not dragging");
|
||||
return;
|
||||
}
|
||||
|
||||
if (eventData is PointerEventData pointerData)
|
||||
{
|
||||
@@ -125,6 +133,7 @@ namespace AibisDream.FixSystem
|
||||
|
||||
private void OnPointerDown(BaseEventData eventData)
|
||||
{
|
||||
Debug.Log($"OnPointerDown - IsPlugAvailable: {_cableSystem.IsPlugAvailable()}, isDragging: {_isDragging}");
|
||||
GetComponent<SpriteRenderer>().sortingLayerName = "Tools";
|
||||
GetComponent<SpriteRenderer>().sortingOrder = 48;
|
||||
// 系统被锁定就返回
|
||||
|
||||
Reference in New Issue
Block a user