Example #1
0
        public void ProcessCustomTags()
        {
            var tags        = XmlLayoutUtilities.GetXmlTagHandlerNames();
            var groupedTags = new Dictionary <string, Dictionary <string, ElementTagHandler> >();

            foreach (var tag in tags)
            {
                var tagHandler = XmlLayoutUtilities.GetXmlTagHandler(tag);

                if (!tagHandler.isCustomElement)
                {
                    continue;
                }

                if (!groupedTags.ContainsKey(tagHandler.elementGroup))
                {
                    groupedTags.Add(tagHandler.elementGroup, new Dictionary <string, ElementTagHandler>());
                }

                groupedTags[tagHandler.elementGroup].Add(tag, tagHandler);
            }

            foreach (var group in groupedTags)
            {
                var existingTags = GetElementGroup(group.Key);

                foreach (var tag in group.Value)
                {
                    if (!existingTags.Contains(tag.Key, StringComparer.OrdinalIgnoreCase))
                    {
                        if (!customElementTagHandlersToAdd.ContainsKey(group.Key))
                        {
                            customElementTagHandlersToAdd.Add(group.Key, new Dictionary <string, ElementTagHandler>());
                        }

                        customElementTagHandlersToAdd[group.Key].Add(tag.Key, tag.Value);
                    }
                }
            }
        }
Example #2
0
        IEnumerator Preload_Internal()
        {
            var tagHandlerNames = XmlLayoutUtilities.GetXmlTagHandlerNames();

            var customAttributeNames = XmlLayoutUtilities.GetCustomAttributeNames();

            foreach (var tagHandlerName in tagHandlerNames)
            {
                // instantiate the tag handler (which will create an instance of it we can use later)
                var tagHandler = XmlLayoutUtilities.GetXmlTagHandler(tagHandlerName);

                // load the prefab (this will cache it)
                XmlLayoutUtilities.LoadResource <GameObject>(tagHandler.prefabPath);
            }

            foreach (var customAttributeName in customAttributeNames)
            {
                // Load the custom attribute (which will create an instance of it we can use later)
                XmlLayoutUtilities.GetCustomAttribute(customAttributeName);
            }

            yield return(null);
        }
Example #3
0
        void Preload_Internal()
        {
            var tagHandlerNames = XmlLayoutUtilities.GetXmlTagHandlerNames();

            var customAttributeNames = XmlLayoutUtilities.GetCustomAttributeNames();

            foreach (var tagHandlerName in tagHandlerNames)
            {
                // instantiate the tag handler (which will create an instance of it we can use later)
                var tagHandler = XmlLayoutUtilities.GetXmlTagHandler(tagHandlerName);

                // load the prefab (this will cache it)
                XmlLayoutUtilities.LoadResource <GameObject>(tagHandler.prefabPath);
            }

            foreach (var customAttributeName in customAttributeNames)
            {
                // Load the custom attribute (which will create an instance of it we can use later)
                XmlLayoutUtilities.GetCustomAttribute(customAttributeName);
            }

            /*foreach (var entry in XmlLayoutResourceDatabase.instance.entries)
             * {
             *  XmlLayoutResourceDatabase.instance.GetResource<UnityEngine.Object>(entry.path);
             * }
             *
             * var resourceDatabases = XmlLayoutResourceDatabase.instance.customResourceDatabases;
             *
             * foreach (var resourceDatabase in resourceDatabases)
             * {
             *  foreach(var entry in resourceDatabase.entries)
             *  {
             *      XmlLayoutResourceDatabase.instance.GetResource<UnityEngine.Object>(entry.path);
             *  }
             * }*/
        }