rabidus-test/Assets/Plugins/QFSW/Quantum Console/Source/Scripts/Parsing/Parsers/GameObjectParser.cs

22 lines
523 B
C#
Raw Normal View History

2023-08-22 15:41:12 +03:00
using QFSW.QC.Utilities;
using UnityEngine;
namespace QFSW.QC.Parsers
{
public class GameObjectParser : BasicQcParser<GameObject>
{
public override GameObject Parse(string value)
{
string name = ParseRecursive<string>(value);
GameObject obj = GameObjectExtensions.Find(name, true);
if (!obj)
{
throw new ParserInputException($"Could not find GameObject of name {value}.");
}
return obj;
}
}
}