Exemple #1
0
        public override void Execute()
        {
            MYXZEntity entity = new MYXZEntity(Npc, 2);

            entity.RegisterObserver(AOIInfoModel.Update);

            entity.UpdatePosition();
            int mark = MYXZTimer.Instance.AddTimer(entity.UpdatePosition, Setting.AOI.UPDATE_RATE, -1);

            AOIInfoModel.AddEntityUpdateMark(entity, mark);
            MapModel.AddEntity(Npc.TargetGameObject, entity);
        }
Exemple #2
0
        public override void Execute()
        {
            Player.BaseSpeed    = 5;
            Player.TalkDistance = 5;

            PlayerModel.CurrentPlayer = Player;

            MYXZEntity entity = new MYXZEntity(Player, Setting.AOI.PLAYER_INTEREST_RADIUS);

            entity.RegisterObserver(AOIModel.Update);                                                   //当Entity的AOIPosition发生变化时会通知AOIModel

            entity.UpdatePosition();                                                                    //初始化调用一次
            int mark = MYXZTimer.Instance.AddTimer(entity.UpdatePosition, Setting.AOI.UPDATE_RATE, -1); //每隔一段时间更新一次坐标信息

            AOIModel.AddEntityUpdateMark(entity, mark);
            MapModel.AddEntity(Player.TargetGameObject, entity);
        }