NewJiantou.cs 577 B

123456789101112131415161718192021222324252627
  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. transform.eulerAngles = new Vector3(0, OpenXRCamera.Instance.head.eulerAngles.y, 0);
  14. }
  15. public void Init(int num)
  16. {
  17. textMesh.text = num.ToString();
  18. }
  19. private void ClickOnBtn()
  20. {
  21. Destroy(gameObject);
  22. }
  23. }