Created
August 10, 2021 11:15
-
-
Save andijakl/197b741bac9f9d5f05422d8672c75845 to your computer and use it in GitHub Desktop.
Part 1 of the script to place holograms based on raycasts with AR Foundation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ARPlaceHologram : MonoBehaviour | |
{ | |
// The prefab to instantiate on touch. | |
[SerializeField] | |
private GameObject _prefabToPlace; | |
// Cache ARRaycastManager GameObject from ARCoreSession | |
private ARRaycastManager _raycastManager; | |
// List for raycast hits is re-used by raycast manager | |
private static readonly List<ARRaycastHit> Hits = new List<ARRaycastHit>(); | |
void Awake() | |
{ | |
_raycastManager = GetComponent<ARRaycastManager>(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment