2using System.Collections.Generic;
4using System.Text.RegularExpressions;
5using Sirenix.OdinInspector;
13 [CreateAssetMenu(menuName =
"Scenarios Data Menu/Create VoiceOver Data", fileName =
"VoiceOverData", order = 3)]
16 [SerializeField][Searchable]
private List<VoiceOverInfo>
_voiceOverInfos =
new List<VoiceOverInfo>();
27 if (voiceOverInfo ==
null)
29 Debug.LogError(
"AudioClip GetAudioClipVO is NULL");
34 return voiceOverInfo.voiceOver;
42 public VoiceOverInfo
GetDataVO(
string voID)
44 VoiceOverInfo voiceOverInfo =
_voiceOverInfos.SingleOrDefault(x => x.id == voID);
51 private void OnValidate()
53 Debug.Log($
"VoiceoverData {name} validation begin");
59 if (Regex.IsMatch(v1.id,
@"\p{IsCyrillic}"))
61 Debug.LogError($
"VoiceoverData {v1} Cyrillic symbol presented!!");
64 if (v1.voiceOver ==
null)
66 Debug.LogError($
"VoiceoverData {v1.id} audioData not presented");
78 if (v1.id.Equals(v2.id))
80 Debug.LogError($
"VoiceoverData data {v1.id} duplicates at position {i}:{j}");
85 Debug.Log($
"VoiceoverData {name} validation finish");
Data that stores all information about voice overs.
List< VoiceOverInfo > _voiceOverInfos
[SerializeField]
VoiceOverInfo GetDataVO(string voID)
Get voiceover info by id.
AudioClip GetAudioClipVO(string voID)
Get voiceover audio clip by id.