kõik vanad helid lisatud, peaaegu kõik esimese iteratsiooni helid on lisatud, auto jaoks üks lisaloogika on tehtud
This commit is contained in:
@@ -25,6 +25,7 @@ public class ContinuoslocomotionConfigurator : MonoBehaviour
|
||||
|
||||
private void enableLocomotion()
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject); //3d oneshot sound
|
||||
locomotion.enabled = true;
|
||||
turnOnButton.gameObject.SetActive(false);
|
||||
turnOffButton.gameObject.SetActive(true);
|
||||
@@ -32,6 +33,7 @@ public class ContinuoslocomotionConfigurator : MonoBehaviour
|
||||
|
||||
private void disableLocomotion()
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject); //3d oneshot sound
|
||||
locomotion.enabled = false;
|
||||
turnOnButton.gameObject.SetActive(true);
|
||||
turnOffButton.gameObject.SetActive(false);
|
||||
|
||||
@@ -23,6 +23,7 @@ public class HoverSlideButton : MonoBehaviour, IPointerEnterHandler, IPointerExi
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
SlideToPosition(onPosition);
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Hover, gameObject); //3d oneshot sound
|
||||
}
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,9 @@ public class Menu : MonoBehaviour
|
||||
private float floor1LowerLimit = -5;
|
||||
private bool activated = true;
|
||||
|
||||
|
||||
private bool hasFloorButtonSoundInitialized = false;
|
||||
private bool hasMapButtonSoundInitialized = false;
|
||||
|
||||
|
||||
private void Awake()
|
||||
@@ -84,17 +87,24 @@ public class Menu : MonoBehaviour
|
||||
|
||||
private void activateMapPanel()
|
||||
{
|
||||
if (hasMapButtonSoundInitialized) //if statement to check if the button sound instance was initiated in the beginning, thie applies to Map and Floor click sounds.
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject);
|
||||
else
|
||||
hasMapButtonSoundInitialized = true;
|
||||
|
||||
SetActiveTab(MenuTab.Map);
|
||||
}
|
||||
|
||||
private void activateOptionsPanel()
|
||||
{
|
||||
SetActiveTab(MenuTab.Options);
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject); //3d oneshot sound
|
||||
}
|
||||
|
||||
private void activateCreditsPanel()
|
||||
{
|
||||
SetActiveTab(MenuTab.Credits);
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject); //3d oneshot sound
|
||||
}
|
||||
|
||||
private void SetActiveTab(MenuTab tab)
|
||||
@@ -125,6 +135,8 @@ public class Menu : MonoBehaviour
|
||||
|
||||
// Toggle the menu visibility
|
||||
setCanvasVisibility(!canvas.enabled);
|
||||
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.MapOpen, gameObject);
|
||||
}
|
||||
|
||||
public Transform updateMenuTransform()
|
||||
@@ -154,6 +166,7 @@ public class Menu : MonoBehaviour
|
||||
}
|
||||
private void DisplayFloor1()
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject); //3d oneshot sound
|
||||
//Debug.Log("Dispaling floor 1");
|
||||
Floor1Panel.gameObject.SetActive(true);
|
||||
Floor2Panel.gameObject.SetActive(false);
|
||||
@@ -165,7 +178,14 @@ public class Menu : MonoBehaviour
|
||||
buttonComponent.interactable = true;
|
||||
}
|
||||
private void DisplayFloor2()
|
||||
{
|
||||
{
|
||||
|
||||
|
||||
if (hasFloorButtonSoundInitialized)
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject);
|
||||
else
|
||||
hasFloorButtonSoundInitialized = true;
|
||||
|
||||
//Debug.Log("Dispaling floor 2");
|
||||
Floor1Panel.gameObject.SetActive(false);
|
||||
Floor2Panel.gameObject.SetActive(true);
|
||||
|
||||
Reference in New Issue
Block a user