Пример #1
0
        public static bool Contains(string key)
        {
            if (mMsg == null)
            {
                BlockResMgr.Get().LoadI18n();
            }

            return(mMsg.ContainsKey(key));
        }
Пример #2
0
        public static void Add(string key, string value)
        {
            if (mMsg == null)
            {
                BlockResMgr.Get().LoadI18n();
            }

            mMsg[key] = value;
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
 public static void Dispose()
 {
     mInstance = null;
 }
Пример #7
0
 /// <summary>
 /// Initialize blockly model. Called very first when start blockly
 /// </summary>
 public static void Init()
 {
     BlockResMgr.Get().LoadI18n(I18n.EN);
     BlockResMgr.Get().LoadJsonDefinitions();
 }
Пример #8
0
 /// <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();
 }