kõik vanad helid lisatud, peaaegu kõik esimese iteratsiooni helid on lisatud, auto jaoks üks lisaloogika on tehtud
This commit is contained in:
@@ -6,6 +6,7 @@ using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
using FMOD.Studio;
|
||||
|
||||
public class MenuTeleportButton : MonoBehaviour
|
||||
{
|
||||
@@ -20,6 +21,15 @@ public class MenuTeleportButton : MonoBehaviour
|
||||
private Button button;
|
||||
private TeleportLocation target; // Target teleport position
|
||||
|
||||
private EventInstance TeleportingSound;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
TeleportingSound = AudioManager.Instance.CreateInstance(FMODEvents.Instance.Teleport); //initialise the instance
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
button = GetComponent<Button>();
|
||||
@@ -49,6 +59,7 @@ public class MenuTeleportButton : MonoBehaviour
|
||||
{
|
||||
button.targetGraphic.GetComponent<Image>().sprite = HoverSprite;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SetStateDefault()
|
||||
@@ -90,5 +101,7 @@ public class MenuTeleportButton : MonoBehaviour
|
||||
// Refresh the button state
|
||||
button.interactable = false;
|
||||
button.interactable = true;
|
||||
|
||||
TeleportingSound.start(); //playing 2d oneshot
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user