音效微调
This commit is contained in:
parent
b9d14a590c
commit
77989384fc
@ -912,7 +912,12 @@ public class UIManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (eventTriggerType == EventTriggerType.PointerClick)
|
||||||
|
{
|
||||||
|
var audioSource = gameObject.GetComponent<AudioSource>();
|
||||||
|
if (audioSource != null)
|
||||||
|
audioSource.PlayOneShot(buttonClip);
|
||||||
|
}
|
||||||
call(e);
|
call(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -927,18 +932,18 @@ public class UIManager : MonoBehaviour
|
|||||||
//设置点击音效
|
//设置点击音效
|
||||||
if (buttonClip == null)
|
if (buttonClip == null)
|
||||||
{
|
{
|
||||||
buttonClip = Resources.Load<AudioClip>("audio/dundundun");
|
buttonClip = Resources.Load<AudioClip>("audio/高科技UI点击触控警告提示反馈APP菜单UI-很酷的应用程序_爱给网_aigei_com");
|
||||||
}
|
}
|
||||||
var audioSource = gameObject.GetComponent<AudioSource>();
|
var audioSource = gameObject.GetComponent<AudioSource>();
|
||||||
if (audioSource == null)
|
if (audioSource == null)
|
||||||
{
|
{
|
||||||
audioSource = gameObject.AddComponent<AudioSource>();
|
audioSource = gameObject.AddComponent<AudioSource>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
audioSource.volume = 0.5f;
|
||||||
|
|
||||||
UIManager.AddEvent(gameObject, EventTriggerType.PointerEnter, (e) =>
|
UIManager.AddEvent(gameObject, EventTriggerType.PointerEnter, (e) =>
|
||||||
{
|
{
|
||||||
//if (!gameObject.activeInHierarchy) return;
|
//if (!gameObject.activeInHierarchy) return;
|
||||||
audioSource.PlayOneShot(buttonClip);
|
|
||||||
Cursor.SetCursor(cursor, Vector2.zero, CursorMode.Auto);
|
Cursor.SetCursor(cursor, Vector2.zero, CursorMode.Auto);
|
||||||
});
|
});
|
||||||
UIManager.AddEvent(gameObject, EventTriggerType.PointerUp, (e) =>
|
UIManager.AddEvent(gameObject, EventTriggerType.PointerUp, (e) =>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user