private void OnTriggerStay2D(Collider2D col)//InteractionBounds HitBox { //Debug.Log(LoopNum); //CircleCollider2D[] Colliders = col.GetComponents<CircleCollider2D>(); //if (col.GetComponent<CircleCollider2D>() == InteractionBounds) { Debug.Log("Interact Bounds"); } //if (col.GetComponent<CircleCollider2D>() == HitBox) { Debug.Log("Hit Box"); } if (col.gameObject.tag == "Obstacle" && GoalPosPath.Length != 0)//col.GetComponent<CircleCollider2D>() == InteractionBounds && { GFunction_Library.TravelPathTransform(gameObject, transform.position, ref GoalPosPath, ref DelUpdate, ref DelSub, 1); GameObject[] ToDelete; ToDelete = GameObject.FindGameObjectsWithTag("Path-Marker"); foreach (GameObject delete in ToDelete) { Destroy(delete); } } if (col.gameObject.tag == "Enemy")//col.GetComponent<CircleCollider2D>() == InteractionBounds && { Debug.Log("Enemy Encountered"); InCombat = true; if (!Combatants.Contains(col.gameObject)) { Combatants.Add(col.gameObject); } if (!UnitController.Contains(col.gameObject.GetComponent <Unit_Controller_Script>())) { UnitController.Add(col.gameObject.GetComponent <Unit_Controller_Script>()); } } }
void FixedUpdate() { DelSub = false; if (GoalPosPath.Length >= 1 && NoObstacle == true) { GFunction_Library.TravelPathTransform(gameObject, GoalPosPath[0], ref GoalPosPath, ref DelUpdate, ref DelSub, GoalAdvanceSpeed); } LoopNum++; //Debug.Log(LoopNum + " " + DelSub + " " + DelUpdate); }