} // Public property for gazeOver private void Awake() { // Set default references gazeManager = GazeManager.Instance; interactiveItem = this.GetComponent <VRInteractiveItem>(); selectionRadial = Camera.main.GetComponent <SelectionRadial>(); }
private void Awake() { IsInfo = true; m_InteractiveItem = GetComponent <VRInteractiveItem>(); m_SelectionRadial = Camera.main.GetComponent <SelectionRadial>(); origMaterial = m_Renderer.material; }
//[SerializeField] private string pName; //[SerializeField] private string pInfo; //[SerializeField] private Texture pImg; private void Awake() { m_InteractiveItem = GetComponent <VRInteractiveItem>(); //m_Renderer = GetComponent<MeshRenderer>(); m_SelectionRadial = Camera.main.GetComponent <SelectionRadial>(); //origMaterial = m_Renderer.material; }
private IEnumerator Start() { Camera camera = m_camInputsManager.CurrentCamera; m_cameraFade = camera.GetComponent <CameraFade>(); m_camera = camera.transform; m_pathWalker = camera.GetComponentInParent <PathWalker>(); if (m_camInputsManager.CurrentInputName == "Touch") { m_selectionRadial = m_touch.GetComponent <SelectionRadial>(); m_reticle = m_touch.GetComponent <Reticle>(); } else { m_selectionRadial = camera.GetComponent <SelectionRadial>(); m_reticle = camera.GetComponent <Reticle>(); } SessionData.SetGameType(m_gameType); //loop to all phases while (true) { yield return(StartCoroutine(StartPhase())); yield return(StartCoroutine(PlayPhase())); yield return(StartCoroutine(EndPhase())); } }
private void Awake() { m_InteractiveItem = gameObject.GetComponent <VRInteractiveItem>(); m_SelectionRadial = GameObject.FindWithTag("MainCamera2").GetComponent <SelectionRadial>(); mpc = GameObject.Find("sphere").GetComponent <MediaPlayerCtrl>(); }
public void OnPointerExit(PointerEventData eventData) { if (selectionRadial == null) { selectionRadial = FindObjectOfType <SelectionRadial>(); // TODO: Find out why it is null sometimes } PointerExit(); }
private void OnEnable() { Debug.Log(m_camInputManager.CurrentCamera); m_selectionRadial = m_camInputManager.CurrentCamera.GetComponent <SelectionRadial>(); m_InteractiveItem.OnOver += HandleOver; m_InteractiveItem.OnOut += HandleOut; m_selectionRadial.OnSelectionComplete += HandleSelectionComplete; }
private bool m_GazeOver; // Whether the user is looking at the VRInteractiveItem currently. void Awake() { m_CameraFade = Camera.main.gameObject.GetComponent <VRCameraFade> () as VRCameraFade; m_SelectionRadial = Camera.main.gameObject.GetComponent <SelectionRadial> () as SelectionRadial; m_InteractiveItem = GetComponent <VRInteractiveItem> () as VRInteractiveItem; m_ButtonImage = GetComponent <Image> () as Image; m_ButtonCollider = GetComponent <BoxCollider> () as BoxCollider; m_canvas = m_ButtonImage.canvas; }
private bool m_GazeOver; // Whether the user is looking at the VRInteractiveItem currently. private void OnEnable() { managerObj = GameObject.Find("GameManager"); manager = managerObj.GetComponent <GameManager>(); mainCamera = GameObject.Find("MainCamera"); m_SelectionRadial = mainCamera.GetComponent <SelectionRadial>(); m_InteractiveItem.OnOver += HandleOver; m_InteractiveItem.OnOut += HandleOut; m_SelectionRadial.OnSelectionComplete += HandleSelectionComplete; }
private bool m_GazeOver; // Whether the user is looking at the VRInteractiveItem currently. private void Awake() { if (m_SelectionRadial == null) { m_SelectionRadial = FindObjectOfType <SelectionRadial>(); } if (m_InteractiveItem == null) { m_InteractiveItem = GetComponent <VRInteractiveItem>(); } }
private bool m_GazeOver; // Whether the user is looking at the VRInteractiveItem currently. private void OnEnable() { mainCamera = GameObject.Find("MainCamera"); m_SelectionRadial = mainCamera.GetComponent <SelectionRadial>(); InfoText = GameObject.Find("InfoText"); infoTextBox = InfoText.GetComponent <Text>(); UIPicture = GameObject.Find("PictureBox"); pictureBox = UIPicture.GetComponent <Image>(); m_InteractiveItem.OnOver += HandleOver; m_InteractiveItem.OnOut += HandleOut; m_SelectionRadial.OnSelectionComplete += HandleSelectionComplete; }
private bool m_GazeOver; // Whether the user is looking at the VRInteractiveItem currently. private void OnEnable() { attachedButton = GetComponent <Button> (); if (this.GetComponent <VRInteractiveItem>() != null) { m_InteractiveItem = this.GetComponent <VRInteractiveItem> (); } else { this.gameObject.AddComponent(typeof(VRInteractiveItem)); Debug.Log("Attaching VR Interactive Script to this GameObject, it's required"); m_InteractiveItem = this.GetComponent <VRInteractiveItem> (); } if (this.GetComponent <BoxCollider>() == null) { this.gameObject.AddComponent(typeof(BoxCollider)); GetComponent <BoxCollider> ().size = new Vector3(this.GetComponent <RectTransform> ().rect.width, this.GetComponent <RectTransform> ().rect.height, 1); Debug.Log("Attaching Box collider to this GameObject, it's required"); } if (VRInteractiveCamera.GetComponent <VRCameraFade> () != null) { m_CameraFade = VRInteractiveCamera.GetComponent <VRCameraFade> (); } else { Debug.Log("No VRCameraFade Script attached to the VR Interactive Camera, it's required"); } if (VRInteractiveCamera.GetComponent <SelectionRadial>() != null) { m_SelectionRadial = VRInteractiveCamera.GetComponent <SelectionRadial> (); } else { Debug.Log("No SelectionRadial Script attached to the VR Interactive Camera, it's required"); } if (gazeTimeForSelection == 0) { gazeTimeForSelection = 1; } m_InteractiveItem.OnOver += HandleOver; m_InteractiveItem.OnOut += HandleOut; m_SelectionRadial.OnSelectionComplete += HandleSelectionComplete; }
private void OnEnable() { slider = GetComponent <Slider>(); selectionRadial = Camera.main.GetComponent <SelectionRadial>(); OnOver += HandleOver; OnOut += HandleOut; OnClick += HandleOnClick; float newWidth = GetComponent <RectTransform>().rect.width; if (originalWidth == -1 || originalWidth > newWidth) { originalWidth = newWidth; } GetComponent <BoxCollider>().size = new Vector3(originalWidth, 20, 0.001f); leftSideOfTheSeekBarCollider = transform.Find("LeftSideOfTheSeekBar").GetComponent <BoxCollider>(); sliderCollider = slider.GetComponent <BoxCollider>(); }
public bool isSelected; //选中 private void Awake() { isSelected = false; m_InteractiveItem = gameObject.GetComponent <VRInteractiveItem>(); m_SelectionRadial = GameObject.FindWithTag("MainCamera2").GetComponent <SelectionRadial>(); }
// Use this for initialization void Start() { if (gazeTimeForSelection == 0) { gazeTimeForSelection = 1; } if (this.GetComponent <VRInteractiveItem> () != null) { m_InteractiveItem = this.GetComponent <VRInteractiveItem> (); } else { Debug.Log("Attaching VR Interactive Script to this GameObject, it's required"); this.gameObject.AddComponent(typeof(VRInteractiveItem)); m_InteractiveItem = this.GetComponent <VRInteractiveItem> (); } if (this.GetComponent <BoxCollider>() == null) { this.gameObject.AddComponent(typeof(BoxCollider)); GetComponent <BoxCollider> ().size = new Vector3(this.GetComponent <RectTransform> ().rect.width, this.GetComponent <RectTransform> ().rect.height, 1); Debug.Log("Attaching Box collider to this GameObject, it's required"); } if (this.GetComponent <Scrollbar> () != null) { vScale = this.GetComponent <Scrollbar> (); } else { Debug.Log("No Scrollbar component attached to this GameObject, it's required"); } if (this.GetComponent <Scrollbar>().handleRect.gameObject != null) { sliderHandle = this.GetComponent <Scrollbar>().handleRect.gameObject; } else { Debug.Log("No child Handle (GameObject) attached to this GameObject, it's required"); } if (VRInteractiveCamera.GetComponent <SelectionRadial>() != null) { m_SelectionRadial = VRInteractiveCamera.GetComponent <SelectionRadial> (); } else { Debug.Log("No SelectionRadial Script attached to the VR Interactive Camera, it's required"); } if (VRInteractiveCamera.GetComponent <Reticle>() != null) { reticlePosition = VRInteractiveCamera.GetComponent <Reticle>().ReticleTransform; } else { Debug.Log("No Reticle Script attached to the VR Interactive Camera, it's required with it's references"); } sliderHandle.SetActive(false); }
protected void Awake() { selectionRadial = FindObjectOfType <SelectionRadial>(); player = GameObject.FindGameObjectWithTag("Player"); }
private bool m_GazeOver; // Whether the user is looking at the VRInteractiveItem currently. void Update() { m_SelectionRadial = GameObject.Find("MainCamera").GetComponent <SelectionRadial>(); }
// Use this for initialization void Awake() { m_SelectionRadial = GameObject.FindWithTag("MainCamera2").GetComponent <SelectionRadial>(); }
// private const string k_SliderMaterialPropertyName = "_SliderValue"; void Start() { m_VRInput = GameObject.Find("MainCamera").GetComponent <VRInput>(); m_SelectionRadial = GameObject.Find("MainCamera").GetComponent <SelectionRadial>(); }