//============= Copyright (c) Ludic GmbH, All rights reserved. ============== // // Purpose: Part of the My Behaviour Tree Code // //============================================================================= using System; using System.Text.RegularExpressions; using UnityEngine; namespace MyBT { public class Token : ScriptableObject { [SerializeField] public SyntaxLabel type; [SerializeField] public TokenLocation location; [SerializeField] public void Init(SyntaxLabel _type, TokenLocation _tokenLocation) { type = _type; location = _tokenLocation; } public void Destroy() { type = SyntaxLabel.Undefined; } public override string ToString() { return $"<{type}> {location.location} '{location.code}'"; } public Token Duplicate () { Token t = ScriptableObject.CreateInstance(); t.type = type; t.location = Instantiate(location); return t; } } }