public static AssetReferenceComponent createFromConfig(string configPath)
        {
            YamlNode config = ConfigurationService.GetConfig(configPath);

            if (config == null)
            {
                throw new ArgumentException("Not found config '" + configPath + "'");
            }
            YamlNode childNode = config.GetChildNode("unityAsset");

            if (childNode == null)
            {
                throw new ArgumentException("Not found unityAsset in config '" + configPath + "'");
            }
            return(childNode.ConvertTo <AssetReferenceComponent>());
        }
        protected internal override Component GetComponentInstance(ComponentDescription componentDescription, EntityInternal entity)
        {
            Component           component2;
            YamlNode            yamlNode = entity.TemplateAccessor.Get().YamlNode;
            ConfigComponentInfo info     = componentDescription.GetInfo <ConfigComponentInfo>();
            string keyName = info.KeyName;

            if (info.ConfigOptional && !yamlNode.HasValue(keyName))
            {
                return((Component)Activator.CreateInstance(componentDescription.ComponentType));
            }
            try
            {
                component2 = (Component)yamlNode.GetChildNode(keyName).ConvertTo(componentDescription.ComponentType);
            }
            catch (Exception exception)
            {
                TemplateAccessor accessor;
                string           str2      = !accessor.HasConfigPath() ? yamlNode.ToString() : accessor.ConfigPath;
                object[]         objArray1 = new object[] { "Error deserializing component ", componentDescription.ComponentType, " from configs, entity=", entity, ", key=", keyName, ", pathOrNode=", str2 };
                throw new Exception(string.Concat(objArray1), exception);
            }
            return(component2);
        }