private void SpawnIntel(Vector2 pos) { GameObject intel = new GameObject("intel"); intel.Transform.Position = pos; intel.Transform.Scale = new Vector2(0.25f); Model2D m = new Model2D(intel, "intel"); m.LoadContent(Scene.Content); intel.AddComponent(m); intel.AddComponent<Intel>(); intel.AddComponent<RigidBody>(); }
public void SpawnEnemy(Vector2 pos, int num) { GameObject enemy = new GameObject(string.Format("enemy_{0}", num)); enemy.Transform.Scale = new Vector2(0.25f); enemy.Transform.Position = pos; Model2D model = new Model2D(enemy, "Player\\hero5"); model.LoadContent(Scene.Content); model.UseAnimations = true; enemy.AddComponent(model); Enemy e = enemy.AddComponent<Enemy>(); var r = enemy.AddComponent<RigidBody>(); r.HasDrag = true; r.Drag = Vector2.Zero; }