GameObjectOnclick.cs 746 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. void Start()
  11. {
  12. Animator.Play("dabaojianshan");
  13. }
  14. // Update is called once per frame
  15. void Update()
  16. {
  17. }
  18. private bool isEnable;
  19. private void OnMouseDown()
  20. {
  21. if (isEnable)
  22. {
  23. return;
  24. }
  25. Animator.Play("init");
  26. UIManager.Instance.GetPanel<TipPanel>().DBJNext();
  27. isEnable = true;
  28. TimeComponent.Instance.AddTimer(1f, () =>
  29. {
  30. Animator.Play("dabaojianshan");
  31. isEnable = false;
  32. });
  33. }
  34. }