public static IEventTigger Get(GameObject obj) { IEventTigger tigger = obj.GetComponent <IEventTigger>(); if (tigger == null) { tigger = obj.AddComponent <IEventTigger>(); } return(tigger); }
void Awake() { oldScale = transform.localScale; tigger = IEventTigger.Get(this.gameObject); tigger.OnClickCallBack = OnClick; tigger.OnPressCallBack = OnPress; tigger.OnPointerDownCallBack = OnPointerDownCallBack; tigger.OnPointerUpCallBack = OnPointeUpCallBack; _selfID = gameObject.GetInstanceID(); }