LoadingPanelController.cs 756 B

1234567891011121314151617181920212223242526272829
  1. using UnityEngine;
  2. namespace TapSDK.UI
  3. {
  4. public class LoadingPanelController : BasePanelController
  5. {
  6. public Transform rotater;
  7. public float speed = 10;
  8. /// <summary>
  9. /// bind ugui components for every panel
  10. /// </summary>
  11. protected override void BindComponents()
  12. {
  13. rotater = transform.Find("Image");;
  14. }
  15. private void Update()
  16. {
  17. if (rotater != null)
  18. {
  19. var localEuler = rotater.localEulerAngles;
  20. var z = rotater.localEulerAngles.z;
  21. z += Time.deltaTime * speed;
  22. rotater.localEulerAngles = new Vector3(localEuler.x, localEuler.y, z);
  23. }
  24. }
  25. }
  26. }