private void OnDisable() { if (PlacementIndicator != null) { PlacementIndicator.SetActive(false); } }
private void Update() { #if UNITY_EDITOR var screenCenter = Camera.ViewportToWorldPoint(new Vector3(0.5f, 0.65f, 30)); OnScreenCenter.Invoke(screenCenter); #else var screenCenter = Camera.ViewportToScreenPoint(new Vector3(0.5f, 0.65f)); if (Raycast(screenCenter, out var planePoint, out var planeRotation)) { PlacementIndicator.SetActive(true); PlacementIndicator.transform.SetPositionAndRotation(planePoint, planeRotation); OnScreenCenter.Invoke(planePoint); }