TapCommon-Unity/Runtime/Internal/UI/Base/LoadingPanelController.cs

30 lines
756 B
C#
Raw Permalink Normal View History

2023-11-08 10:47:27 +08:00
using UnityEngine;
namespace TapTap.UI
{
public class LoadingPanelController : BasePanelController
{
public Transform rotater;
public float speed = 10;
/// <summary>
/// bind ugui components for every panel
/// </summary>
protected override void BindComponents()
{
rotater = transform.Find("Image");;
}
private void Update()
{
if (rotater != null)
{
var localEuler = rotater.localEulerAngles;
var z = rotater.localEulerAngles.z;
z += Time.deltaTime * speed;
rotater.localEulerAngles = new Vector3(localEuler.x, localEuler.y, z);
}
}
}
}