public void OnGlobalBPressUp(WiiMoteEventData eventData) { isbutton = false; A_ = eventData.module.transform.position; B_ = eventData.module.transform.position; Debug.Log(eventData.module.transform.position); }
void HandlePointerExitAndEnter(WiiMoteEventData eventData) { if (eventData.previousRaycast != eventData.currentRaycast) { ExecuteEvents.Execute <IPointerEnterHandler>(eventData.currentRaycast, eventData, ExecuteEvents.pointerEnterHandler); ExecuteEvents.Execute <IPointerExitHandler>(eventData.previousRaycast, eventData, ExecuteEvents.pointerExitHandler); } }
public void OnGlobalBPressDown(WiiMoteEventData eventData) { isbutton = true; B_ = eventData.module.transform.position; Vector3 relapos = new Vector3(); relapos = (B_ - box.position) * 8f / 3f; float r = (float)Math.Sqrt(relapos.x * relapos.x + relapos.y * relapos.y + relapos.z * relapos.z); if (r < radius) { B = new Vector4(relapos.x, relapos.y, relapos.z, (float)Math.Sqrt(radius * radius - relapos.x * relapos.x - relapos.y * relapos.y - relapos.z * relapos.z)); } else { //float length = relapos.magnitude; Vector3 Q = (radius / r) * relapos; //relapos = Q + box.position; B = new Vector4(Q.x, Q.y, Q.z, 0f); } A = B; Debug.Log(eventData.module.transform.position); }
public void OnGlobalAPressUp(WiiMoteEventData eventData) { }
public void OnGlobalAPress(WiiMoteEventData eventData) { box.position = eventData.module.transform.position + movement; }
public void OnGlobalAPressDown(WiiMoteEventData eventData) { movement = new Vector3(); movement = box.position - eventData.module.transform.position; }