I wanted to ask something i think is really simple but i just dont get it.
I want to put my public void OnPointerClick(PointerEventData eventData) in void Update but i dont know hot to because it got something in the brackets.
If somebody could help me i would be really thankfull 
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using UnityEngine.UIElements;
public class DifferentButtonClick : MonoBehaviour, IPointerClickHandler
{
public GameObject panel;
private void Start()
{
panel.SetActive(false);
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.Escape) && panel == true || Input.GetKeyDown(KeyCode.I) && panel == true)
{
panel.SetActive(false);
}
}
public void OnPointerClick(PointerEventData eventData)
{
////Mouse Middle Click
if (eventData.button == PointerEventData.InputButton.Middle)
Debug.Log("Middle Click");
//Mouse Right Click
else if (eventData.button == PointerEventData.InputButton.Right)
{
panel.SetActive(true);
}
}
public void RightClick(PointerEventData eventData)
{
if (eventData.button == PointerEventData.InputButton.Right && panel == true)
{
panel.SetActive(false);
}
}
}
Oh okay thank for the answer and the thig what i want to do is: I got a Inventory and if you right click on an Item it opens a action menu but i want that if you press on another Item right click that the previous action menu closes and the new one pops up, but i have no idea how to do this and wantet to try something.
– GerGames@GerGames you can make another post to ask about how to do you menu / popup system
– Cyber_Cats