예제 #1
0
 static void UpdateRecursively(Gear gear, GameTime gameTime)
 {
     if (gear.Enabled) {
         foreach (var child in gear.Children) {
             UpdateRecursively(child, gameTime);
         }
         gear.Update(gameTime);
     }
 }
예제 #2
0
 static void DrawRecursively(Gear gear, GameTime gameTime)
 {
     if (gear.Visible) {
         gear.Draw(gameTime);
         foreach (var child in gear.Children) {
             DrawRecursively(child, gameTime);
         }
     }
 }