/// <summary> /// This function finds all HapticLocations within maxDistance of the provided worldspace Point. /// </summary> /// <param name="point">A worldspace point to compare</param> /// <param name="maxDistance">The max distance to look for HapticLocations from this suit's definition.</param> /// <returns>AreaFlag with the flagged areas within range. Tip: Use value.AreaCount() or value.IsSingleArea()</returns> public AreaFlag FindAllFlagsWithinRange(Vector3 point, float maxDistance, bool DisplayInEditor = false) { AreaFlag result = AreaFlag.None; GameObject[] closest = Definition.GetMultipleNearestLocations(point, 16, maxDistance); for (int i = 0; i < closest.Length; i++) { HapticLocation loc = closest[i].GetComponent <HapticLocation>(); if (loc != null) { if (DisplayInEditor) { ColorHapticLocationInEditor(loc, Color.cyan); } //Debug.Log("Adding: " + loc.name + "\n"); result = result.AddFlag(loc.Where); } } //Debug.Log("Result of find all flags: " + result.AreaCount() + "\n"); return(result); }
public void DisableArea(AreaFlag AreaToFilterOut) { InactiveRegions.AddFlag(AreaToFilterOut); }