コード例 #1
0
ファイル: ShapeSpace.cs プロジェクト: TheKalleAnka/ShapeSpace
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            gc = new GameComponent(GraphicsDevice);

            UIComponent.Instance.spriteBatch = new SpriteBatch(GraphicsDevice);
            UIComponent.Instance.callbackShell = HandleUICallbacks;

            gc.Initialize();

            UpdateGameState(GameStates.PLAYING);

            base.Initialize();
        }
コード例 #2
0
ファイル: ObjectManager.cs プロジェクト: gjbianco/Pacemaker
 public void Register(GameComponent _GameComponent)
 {
     GameObjects.Add(_GameComponent);
     _GameComponent.Initialize();
 }
コード例 #3
0
ファイル: BIOXScene.cs プロジェクト: gabry90/BIOXFramework
 protected void AddGameComponent(GameComponent component)
 {
     lock (gameComponents)
     {
         if (component != null && !(component is GuiBase) && !gameComponents.Contains(component))
         {
             component.Initialize();
             gameComponents.Add(component);
             collision2DManager.AddComponent(component);
         }
     }
 }