Skip to content

Instantly share code, notes, and snippets.

@canab
Last active December 14, 2015 08:09
Show Gist options
  • Save canab/5055580 to your computer and use it in GitHub Desktop.
Save canab/5055580 to your computer and use it in GitHub Desktop.
public class CustomComponent : Component
{
DelayActivity delay = new DelayActivity(duration: 3000);
TimerActivity timer = new TimerActivity(period: 3000, ticksCount: 2);
enum RocketState { S1, S1 };
RocketState state;
public CustomComponent()
{
isUpdatable = true;
}
public override void update()
{
switch(state)
{
case RocketState.S1:
update1();
break;
case RocketState.S2:
update2();
break;
}
}
public override void update1()
{
// frame actions
if (delay.complete)
{
//...
}
if (timer.tick)
{
//..
}
if (timer.complete)
{
...
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment