Last active
          December 14, 2015 08:09 
        
      - 
      
 - 
        
Save canab/5055580 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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