void Awake() { Instance = this; closeUIButton.onClick.RemoveAllListeners(); closeUIButton.onClick.AddListener(Hide); }
void Awake( ) { Instance = this; closeUIButtonImage = closeUIButton.GetComponent <Image> ( ); closeUIButtonText = closeUIButton.GetComponentInChildren <Text> ( ); canvasGroup = canvas.GetComponent <CanvasGroup> ( ); //Add close event listener closeUIButton.onClick.RemoveAllListeners( ); closeUIButton.onClick.AddListener(Hide); }