//check if creating a new submesh is possible private bool CheckSubMesh() { NavMeshManagerEditor.GetSceneView().Focus(); //get count of all submeshes int subPointsCount = script.subPoints.Count; if (subPointsCount > 0 && script.subPoints[subPointsCount - 1].list.Count <= 2) { NavMeshManagerEditor.ShowNotification("Resuming current submesh."); return(false); } return(true); }
private bool CheckCombine(NavMeshObject script) { //get count of all submeshes int subPointsCount = script.subPoints.Count; if (subPointsCount > 0) { //remove submesh without references if (script.subPoints[subPointsCount - 1].list.Count == 0) { script.subPoints.RemoveAt(subPointsCount - 1); } else if (script.subPoints[subPointsCount - 1].list.Count <= 2) { NavMeshManagerEditor.ShowNotification("Can't combine submeshes.\nYou haven't placed enough points."); return(false); } } return(true); }