// Called before first frame. Prepares the displays and loads cameras. private void Awake() { // Things here should only ever happen once. if (instance == null) { viewpoint = GetComponentInChildren <CameraViewpoint>(); } }
// Called before first frame. Prepares the displays and loads cameras. private void Awake() { // Things here should only ever happen once. if (instance != null) { GameObject.Destroy(instance.gameObject); } instance = this; CAVEViewpoint = GetComponentInChildren <CameraViewpoint>(); }
// Initialization void Start() { gameManager = GetComponentInParent <GameManager>(); cameraViewpoint = gameManager.cameraRig.viewpoint; if (photoPrefab == null) { photoPrefab = new GameObject(); photoPrefab.name = "Photo Template"; ((GameObject)photoPrefab).transform.parent = this.transform; ((GameObject)photoPrefab).AddComponent <CatalystPhoto>(); ((GameObject)photoPrefab).AddComponent <SpriteRenderer>(); ((GameObject)photoPrefab).AddComponent <BoxCollider>(); ((GameObject)photoPrefab).SetActive(false); } }
public void CheckIfPOISelected() { if (selectedPOI == null && GamepadInput.GetDown(GamepadInput.InputOption.A_BUTTON)) { RaycastHit cameraRaycast = CameraViewpoint.GetRaycast(); if (cameraRaycast.collider != null) { POI hitPOI = cameraRaycast.collider.GetComponent <POI>(); if (hitPOI != null) { hitPOI.Toggle(gameManager); } } } }