Exemplo n.º 1
0
 protected void Awake()
 {
     sharedBlackboard = UnityContext.GetSharedBlackboard("sharedbb");
     blackboard       = new Blackboard(sharedBlackboard, UnityContext.GetClock());
     RegisterToSharedBlackboard();
     mailbox                = new Mailbox(this);
     canCheckMailbox        = true;
     awaitingReconfirmation = false;
 }
Exemplo n.º 2
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();
    }
Exemplo n.º 3
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();
    }
        private void Awake()
        {
            Manager = this;

            var blackboard = UnityContext.GetSharedBlackboard(SharedBlackboardKey);

            BuffManager = new BuffManager();

            SkillManager = new SkillManager();

            blackboard.Set(BuffManagerKey, BuffManager);

            blackboard.Set(SkillManagerKey, SkillManager);

            BuffManager
            .AddBuffSystem(new BuffTimeSystem <IBuffDataComponent>(BuffManager))
            .AddBuffSystem(new AttackSpeedPercentageSystem(BuffManager))
            .AddBuffSystem(new DamageReduceFixedSystem(BuffManager))
            .AddBuffSystem(new DamageReducePercentageSystem(BuffManager))
            .AddBuffSystem(new LifestealFixedSystem(BuffManager))
            .AddBuffSystem(new LifestealPercentageSystem(BuffManager))
            .AddBuffSystem(new DamageSystem(BuffManager))
            .AddBuffSystem(new DeathSystem(BuffManager));
        }
Exemplo n.º 6
0
        protected override Blackboard GetOutValue()
        {
            var key = GetInputValue(nameof(_key), _key);

            return(UnityContext.GetSharedBlackboard(key));
        }