Documentation for the Unity C# Library
Loading...
Searching...
No Matches
SetVoiceOverVolume.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using PixoVR.Audio;
4using PixoVR.Core;
5using UnityEngine;
6
7namespace PixoVR.Event
8{
13 {
14 private readonly AudioService _audioService;
15
16 public event Action OnFunctionFinished;
17
19 {
21 }
22
23 public void StartStep(StepItem stepItem, StepFunction function, List<InteractableClass> interactables = null,
24 Action onStepSkipped = null)
25 {
26 Debug.Log("SetVoiceOverVolume : IStep VO:" + function.value);
27
29
30 if (function.additionalValues.Length == 0)
31 {
32 Debug.LogError("Audio volume value not added");
33
34 return;
35 }
36
37 var voiceOverVolume = function.additionalValues[0];
38
39 if (string.IsNullOrEmpty(voiceOverVolume))
40 {
41 Debug.LogError("Audio volume value is empty");
42
43 return;
44 }
45
46 if (float.TryParse(voiceOverVolume, out float value))
47 {
49 }
50
51 else
52 {
53 Debug.LogError("Value is not number value");
54 }
55 }
56
57 public void FunctionFinished()
58 {
59 OnFunctionFinished?.Invoke();
60 }
61 }
62}
Main logic for playing fxs and voice overs.
void SetRepeatableSoundVolume(float volume)
Set repeatable sound volume.
Unity components communication service.
Change general voice overs volume functions.
readonly AudioService _audioService
void StartStep(StepItem stepItem, StepFunction function, List< InteractableClass > interactables=null, Action onStepSkipped=null)
void FunctionFinished()
Called to end current step and start a next one.
[Serializable]
Definition StepItem.cs:12
Basic interface of functions. (Please note that iStep is a wrong name)
Definition IStep.cs:10