HKI Core
LocalizationSystem.cs
Go to the documentation of this file.
1 #pragma warning disable 0414
2 using UnityEngine;
3 using System.Collections.Generic;
4 using HKI.Core.Init;
5 using HKI.Core.Settings;
6 
7 namespace HKI.Core.Loc
8 {
12  public class LocalizationSystem : ScriptableObject, IInit
13  {
14  // Public variables
15  [SerializeField] TextLocalization TextLocalizationTemplate = null;
16  [SerializeField] AudioLocalization AudioLocalizationTemplate = null;
17 
18  [SerializeField] List<TextLocalization> TextLocalizationContainer = new List<TextLocalization>();
19  [SerializeField] List<AudioLocalization> AudioLocalizationContainer = new List<AudioLocalization>();
20 
21  // Init function
22  public void Init()
23  {
24 
25  }
26 
27  // Inteface function
29  {
30  for(int i = TextLocalizationContainer.Count - 1; i >= 0; i--)
31  {
32  if(TextLocalizationContainer[i].name == tag)
33  return TextLocalizationContainer[i];
34  }
35 
36  return null;
37  }
38 
40  {
41  for (int i = AudioLocalizationContainer.Count - 1; i >= 0; i--)
42  {
43  if (AudioLocalizationContainer[i].name == tag)
44  return AudioLocalizationContainer[i];
45  }
46 
47  return null;
48  }
49  }
50 }
This interface allows the initialization of anything by the Initialzer.
Definition: IInit.cs:8
This ScriptableObject contains as a container for all text localization information.
This ScriptableObject holds the data for all localization. Most of its functionality is implemented b...
AudioLocalization FindAudioLocalization(string tag)
TextLocalization FindTextLocalization(string tag)
This ScriptableObject contains as a container for all audio localization information.