feat():为压力板、按钮、拉杆添加音效,为玩家移动添加音效
This commit is contained in:
@@ -9,6 +9,9 @@ namespace Script.Gameplay.Facility
|
||||
{
|
||||
private bool isPulled = false;
|
||||
[SerializeField] private GameObject rotationPrefab;
|
||||
[SerializeField] private AudioClip turnSound;
|
||||
[SerializeField] private AudioClip returnSound;
|
||||
[SerializeField] private AudioSource LeverSound;
|
||||
|
||||
public override string GetInteractPrompt()
|
||||
{
|
||||
@@ -30,11 +33,15 @@ namespace Script.Gameplay.Facility
|
||||
{
|
||||
// 旋转拉杆到下拉位置
|
||||
rotationPrefab.transform.rotation = Quaternion.Euler(0f, 0f, 45f);
|
||||
LeverSound.clip = turnSound;
|
||||
LeverSound.Play();
|
||||
}
|
||||
else
|
||||
{
|
||||
// 旋转拉杆回到初始位置
|
||||
rotationPrefab.transform.rotation = Quaternion.Euler(0f, 0f, 0f);
|
||||
LeverSound.clip = returnSound;
|
||||
LeverSound.Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user