using QFSW.QC.Utilities; using System; using UnityEngine; namespace QFSW.QC.Parsers { public class ComponentParser : PolymorphicQcParser { public override Component Parse(string value, Type type) { GameObject obj = ParseRecursive(value); Component objComponent = obj.GetComponent(type); if (!objComponent) { throw new ParserInputException($"No component on the object '{value}' of type {type.GetDisplayName()} existed."); } return objComponent; } } }