D3ltaQ's picture
Upload 2197 files
24b81cb verified
raw
history blame contribute delete
627 Bytes
// -----------------------------------------------------------
class Rotator
{
reference float speed;
protected Widget m_root;
protected ref AnimatorTimer m_anim;
// -----------------------------------------------------------
void Rotator()
{
m_anim = new AnimatorTimer();
}
// -----------------------------------------------------------
protected void Update()
{
if (m_root)
{
m_root.SetRotation(0, 0, m_anim.GetTargetValue() * Math.RAD2DEG);
}
}
// -----------------------------------------------------------
void OnWidgetScriptInit(Widget w)
{
m_root = w;
m_anim.AnimateLoop(speed);
}
};