NewJiantou.cs 487 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class NewJiantou : MonoBehaviour
  6. {
  7. public SCButton cButton;
  8. public TextMesh textMesh;
  9. // Start is called before the first frame update
  10. void Start()
  11. {
  12. cButton.onClick.AddListener(ClickOnBtn);
  13. }
  14. public void Init(int num)
  15. {
  16. textMesh.text = num.ToString();
  17. }
  18. private void ClickOnBtn()
  19. {
  20. Destroy(gameObject);
  21. }
  22. }