예제 #1
0
 public void OnGlobalBPressUp(WiiMoteEventData eventData)
 {
     isbutton = false;
     A_       = eventData.module.transform.position;
     B_       = eventData.module.transform.position;
     Debug.Log(eventData.module.transform.position);
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
        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);
        }
예제 #4
0
 public void OnGlobalAPressUp(WiiMoteEventData eventData)
 {
 }
예제 #5
0
 public void OnGlobalAPress(WiiMoteEventData eventData)
 {
     box.position = eventData.module.transform.position + movement;
 }
예제 #6
0
 public void OnGlobalAPressDown(WiiMoteEventData eventData)
 {
     movement = new Vector3();
     movement = box.position - eventData.module.transform.position;
 }