void OnDrawGizmos() { if ( navMeshPath != null ) { for ( int i = 0; i < navMeshPath.corners.Length; i++ ) { Gizmos.color = curPoint == i ? Color.red : Color.white; Gizmos.DrawCube(navMeshPath.corners[i], Vector3.one); } } } }