void OnEnable() { script = (NavMeshObject)target; if (script.subMesh == null) { EnterEditMode(); } }
private Vector3[] ConvertAllPoints(NavMeshObject script) { int count = script.list.Count; List <Vector3> all = new List <Vector3>(); for (int i = 0; i < count; i++) { all.Add(script.transform.TransformPoint(script.list[i])); } return(all.ToArray()); }
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); }
void OnEnable() { script = (NavMeshObject)target; }