File size: 627 Bytes
24b81cb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
// -----------------------------------------------------------
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);
}
}; |