예제 #1
0
 public override void OnIndexTriggered()
 {
     base.OnIndexTriggered();
     if (coolNow <= 0)
     {
         RaycastHit hit;
         if (Physics.Raycast(pointer.transform.position, pointer.transform.TransformDirection(Vector3.forward), out hit))
         {
             GameObject hitObject = hit.transform.gameObject;
             MenuUI     menObj    = hitObject.GetComponent <MenuUI>();
             if (menObj)
             {
                 menObj.GetClicked(this);
                 Debug.Log("Click Button");
             }
             else
             {
                 Debug.Log("Click Air");
             }
         }
         coolNow = coolDown;
     }
 }