void onIdleTimer(Timer.Node tn) { switch (tn.timerID) { case TimerDectect: if (mUnit.attr.HP < warnningHP && warnningHP > 0) { tn.loop(1f); break; } if (findTarget()) { next = Cmd.Attack; } else { tn.loop(0.1f); } break; case TimerWakeup: next = Cmd.Patrol; break; } }
void onFleeTimer(Timer.Node tn) { }
void onTraceTimer(Timer.Node tn) { }
void onAttackTimer(Timer.Node tn) { }
void onTimer(Timer.Node timer) { sendUnitEvent((int)UnitEvent.Timer, timer); }