// Update is called once per frame void Update() { if (begin_calculation) { NavMesh.CalculatePath(Staring_Point, Boss_Point, NavMesh.AllAreas, Path); Path_Status = Path.status; Debug.Log(Path_Status); for (int i = 0; i < Path.corners.Length - 1; i++) { Debug.DrawLine(Path.corners[i], Path.corners[i + 1], Color.green); } if (Path_Status != NavMeshPathStatus.PathComplete) { Debug.Log("Is way blocked = " + blocked); begin_calculation = false; WG.StartAgain(); } else if (Path_Status == NavMeshPathStatus.PathComplete) { Debug.Log("The way is not blocked"); } } }
void OnTriggerEnter(Collider collision) { if (collision.gameObject.tag == "Level_End") { Debug.Log("Level End reached"); Game_Manager.Num_Of_Levels++; WG.StartAgain(); } }