/// <summary> /// Returns the instance of PineTreeUnityContext. If the instance is null, and new GameObject /// is created with PineTreeUnityContext added as a component. /// </summary> public static PineTreeUnityContext Instance() { if (instance == null) { // Creates a new GameObject in the scene to get Unity lifecycle calls GameObject pineGameObject = new GameObject(); pineGameObject.name = "PineBTUnityContext"; instance = (PineTreeUnityContext)pineGameObject.AddComponent(typeof(PineTreeUnityContext)); pineGameObject.isStatic = true; } return(instance); }
/// <summary> /// Enables the Blackboard for listeners. /// </summary> public void Enable() { treeManager = PineTreeUnityContext.Instance().TreeManager; }