Unity by using UIBehaviour make light UI button system.
Unity UI Button contains all the selectable datas so it's too heavy.
It's waste of resources when it comes to the mobile development.
In order to cutoff the useless resources for button we have to make new Button system (all UI systems which use selectable are same) by using UIBehaviour and put only the data which we need.
In this post I developed that for button.
Custom UIBehaviour button.
________________________________________________________________________________
using UnityEngine.EventSystems;
using UnityEngine.Events;
public class Joybutton : UIBehaviour, IPointerClickHandler //HGK
{
public UnityEvent onClick = new UnityEvent();
public void OnPointerClick(PointerEventData eventData)
{
onClick?.Invoke();
}
protected override void OnDestroy()
{
onClick.RemoveAllListeners();
}
}
Crazy Selectable datas
_______________________________________________________________________________________
댓글
댓글 쓰기