Exemplo n.º 1
0
        /// <summary>
        /// Collision with a target plate will call this function
        /// </summary>
        /// <param name="caller"></param>
        public void ReaquireTarget(GameObject caller)
        {
            if (caller.Equals(target))
            {
                GameObject tempTarget = demoController.GetTarget();
                demoController.ReturnToPool(target);

                if (tempTarget != null)
                {
                    target = tempTarget;

                    Transform[] positions = { target.transform };

                    transformBehaviour.Positions = positions;
                    mov.LookTarget = target;
                }

                dct?.GoalAchieved();
            }
        }
Exemplo n.º 2
0
        private void OnTriggerEnter(Collider other)
        {
            if (other.CompareTag("Agent"))
            {
                if (DemoID == null)
                {
                    DemoID = other.gameObject.GetComponent <AgentCommon>()?.DemoID;
                    dct    = FindObjectsOfType <DemoCollisionTracker>().Where(colTracker => colTracker.DemoID == DemoID).First();
                }

                dct?.GoalAchieved();


                if (jumpIndex == jumpPoints.Length)
                {
                    jumpIndex = 0;
                }
                transform.localPosition = jumpPoints[jumpIndex];
                jumpIndex++;
            }
        }
Exemplo n.º 3
0
 public void IncrementGoal()
 {
     dct.GoalAchieved();
 }