public void Init()
 {
     if (!UseUnityContextClock)
     {
         _clock = new Clock();
     }
     Blackboard = new Blackboard(UseUnityContextClock ? UnityContext.GetClock() : _clock);
 }
Пример #2
0
 protected void Awake()
 {
     sharedBlackboard = UnityContext.GetSharedBlackboard("sharedbb");
     blackboard       = new Blackboard(sharedBlackboard, UnityContext.GetClock());
     RegisterToSharedBlackboard();
     mailbox                = new Mailbox(this);
     canCheckMailbox        = true;
     awaitingReconfirmation = false;
 }
Пример #3
0
    void Start()
    {
        Hunger = UnityEngine.Random.Range(90, 120);

        sharedBlackboard = UnityContext.GetSharedBlackboard("penguin-union");
        ownBlackboard    = new Blackboard(sharedBlackboard, UnityContext.GetClock());

        behaviorTree = CreateBehaviourTree();

                #if UNITY_EDITOR
        Debugger debugger = (Debugger)this.gameObject.AddComponent(typeof(Debugger));
        debugger.BehaviorTree = behaviorTree;
                #endif

        behaviorTree.Start();
    }
Пример #4
0
    void Start()
    {
        visited = new string[areaDest.Length];

        navAgent = GetComponent <UnityEngine.AI.NavMeshAgent>();

        sharedBlackboard = UnityContext.GetSharedBlackboard("SharedData");
        ownBlackboard    = new Blackboard(sharedBlackboard, UnityContext.GetClock());

        behaviorTree = CreateBehaviourTree();


#if UNITY_EDITOR
        Debugger debugger = (Debugger)this.gameObject.AddComponent(typeof(Debugger));
        debugger.BehaviorTree = behaviorTree;
#endif

        behaviorTree.Start();
    }
    void Start()
    {
        // get the shared blackboard for this kind of ai, this blackboard is shared by all instances
        sharedBlackboard = UnityContext.GetSharedBlackboard("example-swarm-ai");

        // create a new blackboard instance for this ai instance, parenting it to the sharedBlackboard.
        // This way we can also access shared values through the own blackboard.
        ownBlackboard = new Blackboard(sharedBlackboard, UnityContext.GetClock());

        // create the behaviourTree
        behaviorTree = CreateBehaviourTree();

        // attach the debugger component if executed in editor (helps to debug in the inspector)
#if UNITY_EDITOR
        Debugger debugger = (Debugger)this.gameObject.AddComponent(typeof(Debugger));
        debugger.BehaviorTree = behaviorTree;
#endif

        // start the behaviour tree
        behaviorTree.Start();
    }
Пример #6
0
 protected override Clock GetOutValue()
 {
     return(UnityContext.GetClock());
 }