You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
433 B
C#
16 lines
433 B
C#
4 weeks ago
|
using UnityEngine;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
|
[CreateAssetMenu(menuName = "Localization/LanguageDatabase")]
|
||
|
public class LanguageDatabase : ScriptableObject
|
||
|
{
|
||
|
public List<LocalizedText> texts;
|
||
|
|
||
|
public string GetText(string key, string language)
|
||
|
{
|
||
|
var entry = texts.Find(t => t.key == key);
|
||
|
if (entry == null) return key;
|
||
|
return language == "Arabic" ? entry.arabic : entry.english;
|
||
|
}
|
||
|
}
|