- Home /
 
I want to have a variable that is set to what UI image I just clicked on, How can I do this?
 public void OnPointerClick(PointerEventData eventData)
 {
     if (Input.GetMouseButtonDown(1))
     {
         if (eventData.button == PointerEventData.InputButton.Right && Input.GetMouseButtonDown(1) && Right2 == null)
         {
             //eventData.selectedObject Doesnt work
             Right = eventData.selectedObject;
         }
         if (eventData.button == PointerEventData.InputButton.Right && Right != null && Input.GetMouseButtonDown(1))
         {
             //How do I set it?
             Right2 = ;
         }
     }
 }
 
              
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
Finish rotation in the same angle of beginning? 1 Answer
made animation in idle state while click back 0 Answers
GUI.depth issue 2 Answers
Mouse ignore object 2 Answers