Beispiel #1
0
        protected override void Run(Session session, S2CCoalesceInput message)
        {
            ETModel.Scene mScene = ETModel.Game.Scene;
            mScene.GetComponent <LatencyComponent>().AddAMsgLan(message.Time - TimeHelper.GetCurrentTimeUnix());
            Unit             u;
            C2SCoalesceInput mC2SCoalesceInput = new C2SCoalesceInput();

            for (int i = 0; i < message.UnitID.Count; i++)
            {
                u = mScene.GetComponent <WorldManagerComponent>().mEntityList[0].GetUnitByID(message.UnitID[i]);
                if (u != null)
                {
                    u.QueueMessage(message.MC2SCoalesceInputs[i]);
                }
            }
        }
Beispiel #2
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();
        }