25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 lines
345 B

  1. using System;
  2. using UnityEngine;
  3. public class ShopItem : MonoBehaviour
  4. {
  5. private void OnDestroy()
  6. {
  7. this._onClick = null;
  8. }
  9. public void Init(Action onClick)
  10. {
  11. this._onClick = onClick;
  12. }
  13. public void OnItemClicked()
  14. {
  15. if (this._onClick != null)
  16. {
  17. this._onClick();
  18. }
  19. }
  20. private Action _onClick;
  21. }