Button Click Sound Added
This commit is contained in:
@@ -18,6 +18,7 @@ namespace UI
|
||||
public void OnPointerUp(PointerEventData eventData)
|
||||
{
|
||||
text.transform.localPosition = initialTextPosition;
|
||||
UIManager.Instance.PlayClickSound();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
|
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Pausable;
|
||||
using UnityEngine;
|
||||
@@ -8,8 +9,10 @@ namespace UI
|
||||
{
|
||||
private static UIManager _instance = null;
|
||||
public static UIManager Instance => _instance;
|
||||
private Dictionary<string, Canvas> canvases = null;
|
||||
|
||||
public Pauser Pauser { get; private set; } = null;
|
||||
private Dictionary<string, Canvas> canvases = null;
|
||||
private AudioSource audioSource = null;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -20,7 +23,11 @@ namespace UI
|
||||
Destroy(this);
|
||||
}
|
||||
|
||||
private void Start() => Pauser = gameObject.AddComponent<Pauser>();
|
||||
private void Start()
|
||||
{
|
||||
Pauser = gameObject.AddComponent<Pauser>();
|
||||
audioSource = gameObject.GetComponent<AudioSource>();
|
||||
}
|
||||
|
||||
public void SwitchToCanvas(string canvasName)
|
||||
{
|
||||
@@ -54,5 +61,7 @@ namespace UI
|
||||
canvases.Add(child.name, child.GetComponent<Canvas>());
|
||||
}
|
||||
}
|
||||
|
||||
public void PlayClickSound() => audioSource.Play();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user