private void MyRay() { var layerMask = (1 << LayerMask.NameToLayer("Roof")); layerMask |= Physics.IgnoreRaycastLayer; layerMask = ~layerMask; if (Physics.Raycast(MapImage.worldPoint, mapCamera.transform.forward * 100f , out _hit, Mathf.Infinity, layerMask) && _mapImg.IsOver) { this.PrintLog(_hit.collider.gameObject.name); if (_hit.collider.gameObject.GetComponent <ContentPoint>() != null) { if (!_loader) { _tempContent = _hit.collider.gameObject.GetComponent <ContentPoint>(); } } else { if (!_loader) { _tempContent = null; } } tempPoint = _hit.point; if (menuCoroutine == null) { menuCoroutine = StartCoroutine(OpenMenu()); } } }
public void CloseEditMenu() { _menuOpen = false; _loader = false; InvokedBtn = null; _tempContent = null; ContentPoint point; for (int i = 0; i < editMenuContent.childCount; i++) { Destroy(editMenuContent.GetChild(i).gameObject); } scrollView.SetActive(false); }
private void InteractToPoint() { GameObject go; if (_tempContent == null) { go = Instantiate(contentPointPrefab, new Vector3(finalPoint.x, 0 , finalPoint.z), Quaternion.identity , contentPointContainer.transform); } else { go = _tempContent.gameObject; } ContentPoint point = go.GetComponent <ContentPoint>(); point.Selected(_tempContent == null ? Color.blue : Color.yellow); scrollView.GetComponent <ContentWindow>().destinationGO = go; ReplaceEditMenu(menuPoint); scrollView.SetActive(true); }