protected override bool ExecCommand(StoryInstance instance, StoryValueParam <int, float, float> _params, long delta)
        {
            BoxedValue us;

            if (instance.GlobalVariables.TryGetValue("EntityInfo", out us))
            {
                EntityInfo user = us.ObjectVal as EntityInfo;
                if (null != user)
                {
                    int        objId   = _params.Param1Value;
                    float      x       = _params.Param2Value;
                    float      z       = _params.Param3Value;
                    EntityInfo charObj = user.SceneContext.GetEntityById(objId);
                    if (null != charObj)
                    {
                        MovementStateInfo msi = charObj.GetMovementStateInfo();
                        msi.SetPosition2D(x, z);

                        Scene scene = user.SceneContext.CustomData as Scene;
                        if (null != scene)
                        {
                            GameFrameworkMessage.Msg_RC_AdjustPosition adjustPos = new GameFrameworkMessage.Msg_RC_AdjustPosition();
                            adjustPos.role_id  = objId;
                            adjustPos.face_dir = msi.GetFaceDir();
                            adjustPos.x        = x;
                            adjustPos.z        = z;

                            scene.NotifyAllUser(RoomMessageDefine.Msg_RC_AdjustPosition, adjustPos);
                        }
                    }
                }
            }
            return(false);
        }
예제 #2
0
        internal void SyncGfxMoveControlStop(CharacterInfo obj, int id, bool isSkill)
        {
            MovementStateInfo msi = obj.GetMovementStateInfo();

            Msg_CRC_GfxControlMoveStop msg = new Msg_CRC_GfxControlMoveStop();

            msg.obj_id             = obj.GetId();
            msg.skill_or_impact_id = id;
            msg.is_skill           = isSkill;
            msg.target_pos         = new ArkCrossEngineMessage.Position();
            msg.target_pos.x       = msi.PositionX;
            msg.target_pos.z       = msi.PositionZ;
            msg.face_dir           = msi.GetFaceDir();
            msg.send_time          = TimeUtility.GetServerMilliseconds();

            SendMessage(msg);
        }