/// <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(); } }
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++; } }
public void IncrementGoal() { dct.GoalAchieved(); }