コード例 #1
0
ファイル: Menu.cs プロジェクト: kinlam/RUN-SHOOT
 void Awake()
 {
     creator = new EntityCreator (this);
     config = new GameConfig ();
     Screen.SetResolution (1022, 409, false);
     //creator.CreateMainMenu ();
     var size = Camera.main.ScreenToWorldPoint (new Vector2(Screen.width, Screen.height));
     config.Bounds = new Bounds (Vector3.zero, new Vector3 (size.x * 2, size.y * 2));
     Engine.AddSystem (new NetworkSystem(creator), SystemPriorities.PreUpdate);
     //creator.createNetwork ();
 }
コード例 #2
0
        void Awake()
        {
            creator = new EntityCreator(this);
            config = new GameConfig();

            var size = Camera.main.ScreenToWorldPoint(new Vector2(Screen.width, Screen.height));
            config.Bounds = new Bounds(Vector3.zero, new Vector3(size.x*2, size.y*2));

            Engine.AddSystem(new WaitForStartSystem(creator), SystemPriorities.PreUpdate);
            Engine.AddSystem(new GameManagerSystem(creator, config), SystemPriorities.PreUpdate);
            Engine.AddSystem(new MotionControlSystem(), SystemPriorities.Update);
            Engine.AddSystem(new GunControlSystem(creator), SystemPriorities.Update);
            Engine.AddSystem(new BulletAgeSystem(creator), SystemPriorities.Update);
            Engine.AddSystem(new DeathThroesSystem(creator), SystemPriorities.Update);
            Engine.AddSystem(new MovementSystem(config), SystemPriorities.Move);
            Engine.AddSystem(new CollisionSystem(creator), SystemPriorities.ResolveCollisions);
            Engine.AddSystem(new HudSystem(), SystemPriorities.Animate);
            Engine.AddSystem(new AudioSystem(), SystemPriorities.Render);

            creator.CreateWaitForClick();
            creator.CreateGame();
        }