private void MakeKB()
{
var parent = transform.parent;
KB parentKB = null;
if (parent != null)
{
parentKB = parent.GetComponent <KB>();
}
kb = IsGlobal?
KnowledgeBase.Global
: new KnowledgeBase(
gameObject.name,
gameObject,
parentKB == null ? GameObject.Find(GlobalKBGameObjectName).KnowledgeBase() : parentKB.KnowledgeBase);
// Add UID counter.
ELNode.Store(kb.ELRoot / Symbol.Intern("next_uid") % 0);
try
{
foreach (var file in SourceFiles)
{
kb.Consult(file);
}
}
catch (Exception)
{
Debug.Break(); // Pause the game
throw;
}
}