Beispiel #1
0
        public override void Initialize(GameObject agent, Chalkboard chalkboard)
        {
            base.Initialize(agent, chalkboard);

            Debug.Assert(moveToBehaviour != null, "The Examine behaviour requires that a movement " +
                         "behaviour is provided otherwise the agent cannot move to the interaction point.");

            chalkboard.Add("NavMeshAgent", agent.GetComponent <NavMeshAgent>());
            moveToBehaviour.Initialize(agent.gameObject, chalkboard);
        }
Beispiel #2
0
        public override void Tick(Chalkboard chalkboard)
        {
            base.Tick(chalkboard);

            // FIXME: Need to provide a method that is called once on startup of a behaviour so we can cache values like these.
            Interactable item = chalkboard.GetUnity <Interactable>(interactable.GetHashCode());
            Vector3      pos  = item.GetInteractionPosition();

            chalkboard.Add(moveToBehaviour.targetPositionVariable, pos);
            moveToBehaviour.Tick(chalkboard);
        }