/// <summary> /// Select and activate nearest tile system in parent hierarchy of selected object. /// </summary> /// <seealso cref="SelectTileSystem(TileSystem)"/> /// <seealso cref="SelectPreviousTileSystem()"/> /// <seealso cref="SelectNextTileSystem()"/> /// <seealso cref="SelectNthTileSystem(int)"/> /// <seealso cref="ActiveTileSystem"/> public static void SelectActiveOrParentTileSystem() { var tileSystem = ActiveTileSystem; // If no tile system is currently active, search the parent hierarchy of the // active game object for a tile system and select it. if (tileSystem == null && Selection.activeTransform != null) { tileSystem = ToolUtility.FindParentTileSystem(Selection.activeTransform); } if (tileSystem != null) { SelectTileSystem(tileSystem); } }