예제 #1
0
        public string mDefaultLanguage = "Chinese";//refer to Unity API "SystemLanguage" for more language options

        void Awake()
        {
            #region multiTouch
            //Input.multiTouchEnabled = false;
            #endregion

            #region set traget frame rate
            Application.targetFrameRate = 60;
            #endregion

            #region set log filter
            LogUtil.SetFilters(LogMask.NONE, null);
            #endregion

            #region set language
            string language = null;
                        #if UNITY_EDITOR
            language = mLanguage;
                        #else
            LogUtil.LogNoTag("System Language: {0}", Application.systemLanguage);
            language = Application.systemLanguage.ToString();
            if (language == "Chinese")
            {
                language = "ChineseSimplified";
            }
                        #endif
            Localization.language = Localization.HasLanguage(language) ? language : mDefaultLanguage;
            Localization.LoadFonts(new string[] { "Arial" }, true);
            #endregion

            #region create ItemManager instance and load data
            BuildingManager.GetOrCreateInstance();
            #endregion

            #region init lean touch
            //create lean touch
            GameObject leanTouchObj = new GameObject("LeanTouch");
            leanTouchObj.AddComponent <Lean.Touch.LeanTouch>();
            leanTouchObj.AddComponent <DontDestroyOnLoad>();
            #endregion

            #region init Centers
            EventCenter.GetOrCreateInstance();
            DataCenter.GetOrCreateInstance();
            #endregion

            InitGame();
        }