/// <summary> /// For bounding box selection and some tools. /// </summary> /// <returns>True if the entire selection cancelled, false otherwise.</returns> public bool CancelSelection(bool cancelAll = false, XRInteractableTerrainActivity nextMode = XRInteractableTerrainActivity.Default) { switch (CurrentActivity) { case XRInteractableTerrainActivity.BBoxSelection: if (BBoxSelectionController.CancelSelection(cancelAll)) { CurrentActivity = nextMode; BBoxSelectionController.SetEnabled(false); return(true); } break; case XRInteractableTerrainActivity.Distance: case XRInteractableTerrainActivity.HeightProfile: if (!HeightProfileController.SelectionInputEnabled) { cancelAll = true; } if (HeightProfileController.CancelSelection(cancelAll)) { CurrentActivity = nextMode; HeightProfileController.SetEnabled(false); return(true); } break; case XRInteractableTerrainActivity.SunAngle: break; } return(false); }
protected override void Awake() { if (Instance != this) { Destroy(this); } base.Awake(); // Create the latitude and longitude selection indicators and controller. GameObject selectionIndicatorsContainer = new GameObject(GameObjectName.SelectionIndicatorContainer) { layer = (int)CullingLayer.RenderToTexture }; selectionIndicatorsContainer.transform.SetParent(_renderTextureObjectsContainer.transform, false); BBoxSelectionController = selectionIndicatorsContainer.AddComponent <LocalTerrainBoundingBoxSelectionController>(); BBoxSelectionController.SetEnabled(false); }
protected virtual void Start() { BBoxSelectionController.ResetSelectionBoundingBox(); HeightProfileController = gameObject.AddComponent <TerrainHeightProfileController>(); }