//public GameObject holde; // Use this for initialization void Start() { VREventListener.Get(gameObject).OnClickEvent = AnchorWidegt_OnClickEvent; // VREventListener.Get(gameObject).onHover = Anchor_OnHover; VREventListener.Get(gameObject).onDrag = Anchor_OnDrag; IVRTouchPad.Instance.AddKeyEvent(Back, IVRTouchPad.KeyLayout.Layout_1); }
// Update is called once per frame void Update() { if (m_focus) { UnityEngine.UI.Text text = GetComponentInChildren <UnityEngine.UI.Text>(); text.text = "onHover " + m_focus + " " + VREventListener.Get(gameObject).hitPoint; } }
void Start() { AnchorWidget aw = VREventListener.Get(gameObject); aw.onHover = (GameObject go, bool isHover) => { if (isHover) { StartCoroutine("Rotation"); } else { StopCoroutine("Rotation"); } }; aw.OnClickEvent = (GameObject go) => { rot = new Vector3(rot.z, rot.x, rot.y); }; }
private void Anchor_OnHover(GameObject go, bool state) { UnityEngine.UI.Text text = GetComponentInChildren <UnityEngine.UI.Text>(); m_focus = state; text.text = "onHover " + state + " " + VREventListener.Get(gameObject).hitPoint; }