Exemplo n.º 1
0
        private System.Collections.Generic.List <string> GetModules(FeatureBase feature)
        {
            if (this.cacheModules.TryGetValue(feature, out var list) == false)
            {
                list = new System.Collections.Generic.List <string>();
                var script = MonoScript.FromScriptableObject(feature);
                var text   = script.text;

                var matches = System.Text.RegularExpressions.Regex.Matches(text, @"AddModule\s*\<(.*?)\>");
                foreach (System.Text.RegularExpressions.Match match in matches)
                {
                    if (match.Groups.Count > 0)
                    {
                        var systemType = match.Groups[1].Value;
                        var spl        = systemType.Split('.');
                        systemType = spl[spl.Length - 1];
                        list.Add(systemType);
                    }
                }

                this.cacheModules.Add(feature, list);
            }

            return(list);
        }