public static bool Contains(string key) { if (mMsg == null) { BlockResMgr.Get().LoadI18n(); } return(mMsg.ContainsKey(key)); }
public static void Add(string key, string value) { if (mMsg == null) { BlockResMgr.Get().LoadI18n(); } mMsg[key] = value; }
public static BlockResMgr Get() { if (mInstance == null) { mInstance = Resources.Load <BlockResMgr>("BlockResSettings"); } if (mInstance == null) { throw new Exception("There is no \"BlockResSettings\" ScriptObject under Resources folder"); } return(mInstance); }
public static BlockResMgr Get() { if (mInstance == null) //mInstance = Resources.Load<BlockResMgr>("BlockResSettings"); //*****tmp for editor #if UNITY_EDITOR && !FORCE_USE_AB { mInstance = UnityEditor.AssetDatabase.LoadAssetAtPath <BlockResMgr>("Assets/LogicProgram/Config/BlockResSettings.asset"); } #endif { if (mInstance == null) { throw new Exception("There is no \"BlockResSettings\" ScriptObject under Resources folder"); } } return(mInstance); }
public static string Get(string key) { if (mMsg == null) { BlockResMgr.Get().LoadI18n(); } string value; if (mMsg.TryGetValue(key, out value)) { return(value); } throw new Exception("I18n file doesn't contain translation for key: " + key); }
public static void Dispose() { mInstance = null; }
/// <summary> /// Initialize blockly model. Called very first when start blockly /// </summary> public static void Init() { BlockResMgr.Get().LoadI18n(I18n.EN); BlockResMgr.Get().LoadJsonDefinitions(); }
/// <summary> /// Initialize blockly model. Called very first when start blockly /// </summary> public static void Init(bool localize = true) { BlockResMgr.Get().LoadI18n(localize); BlockResMgr.Get().LoadJsonDefinitions(); }