private void OnEnable() { _placement.volume = _placementExtents; _placement.tilt = _placementTiltOffset; _placement.allowHorizontal = true; _placement.allowVertical = false; _placement.Place(Camera.main.transform, HandlePlacementConfirmed, IsPlacementValid); foreach (GameObject placedObject in _placedObjects) { ProximityIndicator proximitySphere = placedObject.GetComponent(typeof(ProximityIndicator)) as ProximityIndicator; if (proximitySphere != null) { proximitySphere.enabled = true; proximitySphere.SetRadius(_placementClearance); } } GestureManager.OnGestureBegin += HandleOnGestureBegin; }
//----------- MonoBehaviour Methods ----------- private void OnGUI() { if (!placement.Running) { if (GUILayout.Button("Start Placement")) { contentToPlace.gameObject.SetActive(false); placement.Place(Camera.main.transform, HandlePlacementComplete); } } else { if (GUILayout.Button("Confirm Placement")) { placement.Confirm(); } } }