public static void Destroy(GameObject gameObject) { gameObject.taggedForDestruction = true; for (int i = 0; i < gameObject._components.Count; i++) { gameObject._components[i].enabled = false; gameObject._components[i].OnDestroy(); } gameObject._components = null; }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); Initializer.Initialize(); //Initialize Everything mainCamera = new GameObject("Main Camera"); mainCamera.AddComponent(typeof(Camera)); }