GameObjectOnclick.cs 849 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using Mono;
  5. using Mono.UI.Core;
  6. using UnityEngine;
  7. public class GameObjectOnclick : MonoBehaviour
  8. {
  9. public Animator Animator;
  10. public int Count;
  11. void Start()
  12. {
  13. Animator.Play("dabaojianshan");
  14. }
  15. // Update is called once per frame
  16. void Update()
  17. {
  18. }
  19. private bool isEnable;
  20. private void OnMouseDown()
  21. {
  22. if (isEnable)
  23. {
  24. return;
  25. }
  26. if (Count > 1)
  27. {
  28. return;
  29. }
  30. Count++;
  31. Animator.Play("init");
  32. UIManager.Instance.GetPanel<TipPanel>().DBJNext();
  33. isEnable = true;
  34. TimeComponent.Instance.AddTimer(0.5f, () =>
  35. {
  36. Animator.Play("dabaojianshan");
  37. isEnable = false;
  38. });
  39. }
  40. }