Example #1
0
        private void InitConfigFile()
        {
            TextAsset config = Resources.Load <TextAsset>(GameServiceDefine.Resources_UI_UIViewConfig);

            if (config != null)
            {
                UIViewConfig = JsonUtility.FromJson <UIViewConfig>(config.text);
                Resources.UnloadAsset(config);
            }
        }
Example #2
0
        public T OpenUI <T>(params object[] values) where T : IUIViewListener
        {
            string typeName = typeof(T).Name;

            if (UIViewConfig == null)
            {
                return(_OpenUI_ByDefault <T>(values));
            }
            else
            {
                UIViewConfigElement configElement = UIViewConfig.FindUIViewConfigElement(typeName);
                if (configElement == null)
                {
                    return(_OpenUI_ByDefault <T>(values));
                }
                else
                {
                    return(_OpenUI_ByConfig <T>(configElement, values));
                }
            }
        }