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

30 lines
756 B
C#
Raw Normal View History

2023-10-20 15:49:25 +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);
}
}
}
}