Ejemplo n.º 1
0
        /// <summary>
        /// override
        /// </summary>
        // -------------------------------------------------------------------------------------------------------
        protected override void initOnAwake()
        {
            this.m_numberOfCo = Math.Max(1, this.m_numberOfCo);

#if UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS)
            if (!SystemInfo.graphicsDeviceType.ToString().ToLower().Contains("opengl"))
            {
                Debug.LogWarning("(#if UNITY_EDITOR) Use OpenGLES, or you will see pink shader, perhaps.");
            }
#endif

#if UNITY_EDITOR
            if (this.m_useDecryption)
            {
                if (this.m_cryptoVersion == CryptoVersion.Ver1_depricated)
                {
                    Debug.LogWarning(
                        "(#if UNITY_EDITOR) : CryptoVersion.Ver1_depricated uses old crypto function, please use newer instead : " +
                        Funcs.CreateHierarchyPath(this.transform));
                }

                else
                {
                    Debug.Log("(#if UNITY_EDITOR) : AssetBundleStartupManager's CryptoVersion == " + this.m_cryptoVersion.ToString());
                }
            }
#endif
        }
        /// <summary>
        /// Show popup
        /// </summary>
        /// <param name="message">message</param>
        /// <param name="showDoneCallback">callback when showing done</param>
        // ----------------------------------------------------------------------------------------
        public void showPopup(string message, Action showDoneCallback)
        {
            if (this.m_popupUiInfo)
            {
                // Enqueue
                {
                    this.m_tempPopupInfoList.Enqueue(new TempPopupInfo(message, showDoneCallback));
                }

                // StartCoroutine
                {
                    if (this.m_showPopupIE == null)
                    {
                        StartCoroutine(this.m_showPopupIE = this.showPopupIE());
                    }
                }
            }

#if UNITY_EDITOR
            else
            {
                Debug.LogWarning("(#if UNITY_EDITOR) : m_popupUiInfo == null : " + Funcs.CreateHierarchyPath(this.transform));
            }
#endif
        }
        /// <summary>
        /// Check duplicates
        /// </summary>
        /// <typeparam name="T1">IEnumerable</typeparam>
        /// <typeparam name="T2">key</typeparam>
        /// <param name="source">source</param>
        /// <param name="keySelector">keySelector</param>
        /// <param name="transform">Transform</param>
        // ------------------------------------------------------------------------------------------------------------------------------
        public static void checkDuplicatesEditorOnly <T1, T2>(IEnumerable <T1> source, System.Func <T1, T2> keySelector, Transform transform)
        {
            var temp = source.GroupBy(keySelector).Where(val => val.Count() > 1);

            foreach (var val in temp)
            {
                Debug.LogWarningFormat(
                    "(#if UNITY_EDITOR) : Found duplicates : {0} : {1}",
                    val.Key,
                    Funcs.CreateHierarchyPath(transform)
                    );
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Start
        /// </summary>
        // -----------------------------------------------------------------------------
        void Start()
        {
#if UNITY_EDITOR
            if (!this.m_refText)
            {
                Debug.LogWarning("(#if UNITY_EDITOR) : m_refText == null : " + Funcs.CreateHierarchyPath(this.transform));
            }

            if (this.m_sendEvent.GetPersistentEventCount() <= 0)
            {
                Debug.LogWarning("(#if UNITY_EDITOR) : m_sendEvent.GetPersistentEventCount() <= 0 : " + Funcs.CreateHierarchyPath(this.transform));
            }
#endif
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Called in Awake
        /// </summary>
        // -------------------------------------------------------------------------------------------------------
        protected override void initOnAwake()
        {
#if UNITY_EDITOR
            if (!this.m_languageCsvForSystemText)
            {
                Debug.LogWarning("(#if UNITY_EDITOR) : m_languageCsvForSystemText is null : " + Funcs.CreateHierarchyPath(this.transform));
            }

            // m_languageAndFontList
            {
                foreach (var val in this.m_languageAndFontList)
                {
                    if (!this.isSupportedLanguageEditorOnly(val.systemLanguage))
                    {
                        Debug.LogWarning("(#if UNITY_EDITOR) : Not supported language : " + val.systemLanguage.ToString() + " : " + Funcs.CreateHierarchyPath(this.transform));
                    }

                    if (!val.font)
                    {
                        Debug.LogWarning("(#if UNITY_EDITOR) : font is null : " + val.systemLanguage.ToString() + " : " + Funcs.CreateHierarchyPath(this.transform));
                    }
                }
            }
#endif

            // initCsvForSystemText
            {
                this.initCsvForSystemText();
            }

            // m_currentFont
            {
                var temp = this.m_languageAndFontList.Find(val => val.systemLanguage == this.m_currentSystemLanguage);
                this.m_currentFont = (temp != null) ? temp.font : null;
            }
        }
        /// <summary>
        /// Start
        /// </summary>
        // ---------------------------------------------------------------------------------------
        private void Start()
        {
            // m_refImage
            {
                this.m_refImage = this.GetComponent <Image>();
            }

            // addLanguageSignalReceiver
            {
                SimpleReduxManager.Instance.addLanguageSignalReceiver(this.onLanguageSignal);
            }

            // changeSpriteByLanguage
            {
                this.changeSpriteByLanguage();
            }

#if UNITY_EDITOR
            // checkDuplicatesEditorOnly
            {
                Funcs.checkDuplicatesEditorOnly(this.m_languageAndSpriteList, val => val.systemLanguage, this.transform);
            }

            // empty sprite
            {
                var temp = this.m_languageAndSpriteList.FindAll(val => val.sprite == null);

                if (temp.Count > 0)
                {
                    Debug.LogWarningFormat("(#if UNITY_EDITOR) : {0} Empty sprites : {1}", temp.Count, Funcs.CreateHierarchyPath(this.transform));
                }
            }

            // supportedLanguagesEditorOnly
            {
                if (LanguageManager.isAvailable())
                {
                    // count
                    {
                        if (LanguageManager.Instance.supportedLanguagesEditorOnly.Count != this.m_languageAndSpriteList.Count)
                        {
                            Debug.LogWarning("(#if UNITY_EDITOR) : Different size in language setting : " + Funcs.CreateHierarchyPath(this.transform));
                        }
                    }

                    // isSupportedLanguageEditorOnly
                    {
                        foreach (var val in this.m_languageAndSpriteList)
                        {
                            if (!LanguageManager.Instance.isSupportedLanguageEditorOnly(val.systemLanguage))
                            {
                                Debug.LogWarningFormat(
                                    "(#if UNITY_EDITOR) : Not supported language : {0} : {1}",
                                    val.systemLanguage,
                                    Funcs.CreateHierarchyPath(this.transform)
                                    );
                            }
                        }
                    }
                }
            }
#endif
        }