Ejemplo n.º 1
0
        private void OnEnterBattleScene()
        {
            WorldEntity worldEntity = WorldEntityFactory.Create();

            //  WorldEntity worldEntity = ComponentFactory.Create<WorldEntity>();
            ETModel.Scene mScene = ETModel.Game.Scene;
            mScene.AddComponent <BattleControlComponent>().CreatUnitModel(mScene.GetComponent <UnitComponent>().GetAll());
            worldEntity.SetMainUnit(mScene.GetComponent <BattleControlComponent>().GetMainUnit());
            foreach (var v in mScene.GetComponent <UnitComponent>().GetAll())
            {
                worldEntity.GetGameState().AddGameUnit(v);
            }
            mScene.GetComponent <WorldManagerComponent>().AddWorld(worldEntity);
            foreach (var v in mScene.GetComponent <UnitComponent>().GetAll())
            {
                ETModel.Game.Scene.GetComponent <WorldManagerComponent>().AddUnitToWorld(v, worldEntity);
            }
            ThreadEntity threadEntity = ThreadEntityFactory.Create();

            threadEntity.InitWorldEntity(worldEntity);
            mScene.AddComponent <InputComponent>();
            CameraController.Instance.OnEnterBattleScene();
        }