提交
This commit is contained in:
+805
-801
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using AibisDream.Kit;
|
||||
|
||||
namespace AibisDream.FixSystem
|
||||
{
|
||||
@@ -125,6 +126,8 @@ namespace AibisDream.FixSystem
|
||||
PlugRef.PullUpSocket();
|
||||
BodyModuleSystem.CloseModuleSlots(null);
|
||||
PlugRef.ReturnToStartPosition();
|
||||
AudioManager.Instance.PlaySfx("event:/ActionFB/mods_close");
|
||||
AudioManager.Instance.PlaySfx("event:/FollowInput/plugdrop");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -4,6 +4,7 @@ using Cinemachine;
|
||||
using AibisDream.Framework;
|
||||
using DG.Tweening;
|
||||
using System.Collections;
|
||||
using AibisDream.Kit;
|
||||
|
||||
namespace AibisDream
|
||||
{
|
||||
@@ -81,6 +82,7 @@ namespace AibisDream
|
||||
|
||||
private void ActivateGear()
|
||||
{
|
||||
AudioManager.Instance.PlaySfx("event:/FollowInput/drill");
|
||||
isGearActive = true;
|
||||
if (gearFollower != null)
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ using DG.Tweening;
|
||||
using AibisDream.FixSystem;
|
||||
using AibisDream; // 添加OpenSystem的命名空间
|
||||
using System.Collections;
|
||||
using AibisDream.Kit;
|
||||
|
||||
public class GearFollower : MonoBehaviour
|
||||
{
|
||||
@@ -61,7 +62,7 @@ public class GearFollower : MonoBehaviour
|
||||
private Quaternion originalTargetRotation;
|
||||
private Vector3 originalTargetScale;
|
||||
private AudioSource audioSource;
|
||||
private Sequence cutCompleteSequence; // DOTween序列
|
||||
private DG.Tweening.Sequence cutCompleteSequence; // DOTween序列
|
||||
private HashSet<int> cutEdgeIndices = new HashSet<int>(); // 记录已切割的边缘点索引
|
||||
|
||||
private float currentEmissionRate = 0f;
|
||||
@@ -92,6 +93,7 @@ public class GearFollower : MonoBehaviour
|
||||
private Vector3 shakeOffset = Vector3.zero;
|
||||
private Vector3 targetPosition = Vector3.zero;
|
||||
private bool isInTractionMode = false;
|
||||
private bool isDrillSfxPlaying = false; // 标记音效是否已播放
|
||||
|
||||
void Start()
|
||||
{
|
||||
@@ -400,7 +402,7 @@ public class GearFollower : MonoBehaviour
|
||||
if (gearRenderer != null)
|
||||
{
|
||||
gearRenderer.sortingOrder = 5;
|
||||
}
|
||||
} // 只在未播放时播放音效
|
||||
}
|
||||
}
|
||||
private void UpdateTractionState(Vector2 mousePos)
|
||||
@@ -409,8 +411,6 @@ public class GearFollower : MonoBehaviour
|
||||
|
||||
if (Vector2.Distance(mousePos, gearPos) > detachDistance)
|
||||
{
|
||||
currentState = State.Follow;
|
||||
isInTractionMode = false;
|
||||
EndCutting();
|
||||
return;
|
||||
}
|
||||
@@ -419,7 +419,7 @@ public class GearFollower : MonoBehaviour
|
||||
EndCutting();
|
||||
return;
|
||||
}
|
||||
if (!isCutting)
|
||||
if (!isCutting && Input.GetMouseButton(0))
|
||||
{
|
||||
StartCutting();
|
||||
}
|
||||
@@ -513,14 +513,10 @@ 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);
|
||||
}
|
||||
|
||||
|
||||
AudioManager.Instance.SetSfxParam("event:/FollowInput/drill","is_drill_cutting",1f);
|
||||
|
||||
}
|
||||
private void AddCutPoint(Vector3 point)
|
||||
{
|
||||
@@ -577,31 +573,16 @@ public class GearFollower : MonoBehaviour
|
||||
sparkVFX.Stop();
|
||||
}
|
||||
|
||||
// AudioManager.Instance.SetGlobalParam("is_drill_cutting", 0f);
|
||||
AudioManager.Instance.SetSfxParam("event:/FollowInput/drill","is_drill_cutting",0f);
|
||||
|
||||
// 关闭切割光照
|
||||
if (cutLight != null)
|
||||
{
|
||||
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);
|
||||
StartCoroutine(DelayedStopAudio());
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator DelayedStopAudio()
|
||||
{
|
||||
yield return new WaitForSeconds(0.9f);
|
||||
var audioManager = AibisDream.Kit.AudioManager.Instance;
|
||||
if (audioManager != null)
|
||||
{
|
||||
audioManager.StopSfx("event:/FollowInput/drill");
|
||||
}
|
||||
// 停止音效
|
||||
}
|
||||
|
||||
private int FindNearestEdgePointIndex(Vector2 pos, out float minDist)
|
||||
@@ -788,8 +769,7 @@ public class GearFollower : MonoBehaviour
|
||||
if (audioManager != null)
|
||||
{
|
||||
// 快速将is_drill_cutting参数从1拉到0
|
||||
audioManager.SetGlobalParam("is_drill_cutting", 0f);
|
||||
audioManager.StopSfx("event:/FollowInput/drill");
|
||||
AudioManager.Instance.SetSfxParam("event:/FollowInput/drill","is_drill_cutting",0f);
|
||||
}
|
||||
|
||||
// 计算随机方向
|
||||
@@ -803,6 +783,7 @@ public class GearFollower : MonoBehaviour
|
||||
}
|
||||
|
||||
// 立即应用倾斜和位移
|
||||
AudioManager.Instance.PlaySfx("event:/ActionFB/mod_cutout");
|
||||
targetSpriteRenderer.transform.rotation = Quaternion.Euler(0, 0, randomAngle);
|
||||
targetSpriteRenderer.transform.position = originalTargetPosition + (Vector3)randomOffset;
|
||||
|
||||
@@ -873,5 +854,17 @@ public class GearFollower : MonoBehaviour
|
||||
{
|
||||
cutCompleteSequence.Kill();
|
||||
}
|
||||
StopDrillSfxIfPlaying();
|
||||
}
|
||||
|
||||
// 停止音效的辅助方法
|
||||
private void StopDrillSfxIfPlaying()
|
||||
{
|
||||
var audioManager = AibisDream.Kit.AudioManager.Instance;
|
||||
if (audioManager != null)
|
||||
{
|
||||
audioManager.StopSfx("event:/FollowInput/drill");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,6 +160,8 @@ namespace AibisDream.FixSystem
|
||||
|
||||
// 打开所有模块
|
||||
FixSystemCenter.SystemDic.Get<BodyModuleSystem>().OpenModuleSlots();
|
||||
AudioManager.Instance.PlaySfx("event:/ActionFB/mods_open");
|
||||
AudioManager.Instance.PlaySfx("event:/FollowInput/plugpick");
|
||||
}
|
||||
|
||||
private void OnPointerUp(BaseEventData eventData)
|
||||
|
||||
@@ -571,6 +571,7 @@ namespace AibisDream.FixSystem
|
||||
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.CutEmo);
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeInAsync(0.1f);
|
||||
AudioManager.Instance.SetGlobalParam("scene",14);
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.CutEmoDeep);
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeOutAsync(0.1f);
|
||||
yield return cuttingManager.StartCutting(bodyModule);
|
||||
@@ -621,6 +622,7 @@ namespace AibisDream.FixSystem
|
||||
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.CutMemory);
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeInAsync(0.1f);
|
||||
AudioManager.Instance.SetGlobalParam("scene",12);
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.CutMemoryDeep);
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeOutAsync(0.1f);
|
||||
yield return cuttingManager.StartCutting(bodyModule);
|
||||
@@ -670,6 +672,7 @@ namespace AibisDream.FixSystem
|
||||
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.CutLogic);
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeInAsync(0.1f);
|
||||
AudioManager.Instance.SetGlobalParam("scene",13);
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.CutLogicDeep);
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeOutAsync(0.1f);
|
||||
yield return cuttingManager.StartCutting(bodyModule);
|
||||
|
||||
Reference in New Issue
Block a user