コード例 #1
0
        public void OnPlayerMove(NFDataList valueList)
        {
            NFGUID tar = valueList.ObjectVal(0);

            if (tar == mPlayerModule.mRoleID)
            {
                return;
            }

            GameObject  player      = GetObject(tar);
            OtherPlayer otherPlayer = player.GetComponent <OtherPlayer>();

            double    fSpeed = valueList.FloatVal(1);
            long      nType  = valueList.IntVal(2);
            NFVector3 pos    = valueList.Vector3Val(3);
            Vector3   vPos   = new Vector3(pos.X(), pos.Y(), pos.Z());

            if (nType > 0)
            {
                otherPlayer.JumpTo(vPos);
            }
            else
            {
                otherPlayer.MoveTo((float)fSpeed, vPos);
            }

            Debug.Log("Player Move:" + vPos.ToString());
        }
コード例 #2
0
    public bool OnPlayerMove(NFIDataList valueList)
    {
        NFGUID tar = valueList.ObjectVal(0);


        if (tar == NFCPlayerLogic.Instance().mRoleID)
        {
            return(true);
        }

        OtherPlayer player = transform.Find(tar.ToString()).GetComponent <OtherPlayer>();

        double    fSpeed = valueList.FloatVal(1);
        NFVector3 pos    = valueList.Vector3Val(2);

        player.MoveTo(new Vector3(pos.X(), pos.Y(), pos.Z()));

        return(true);
    }
コード例 #3
0
ファイル: NFSceneModule.cs プロジェクト: yanmf/NFClient
        public void OnPlayerMove(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ReqAckPlayerMove xData = NFMsg.ReqAckPlayerMove.Parser.ParseFrom(xMsg.msg_data);

            if (xData.target_pos.Count <= 0)
            {
                return;
            }

            NFGUID tar = mHelpModule.PBToNF(xData.mover);

            if (tar == mLoginModule.mRoleID)
            {
                return;
            }

            GameObject  player      = GetObject(tar);
            OtherPlayer otherPlayer = player.GetComponent <OtherPlayer>();

            float fSpeed = xData.speed;

            long      nType = xData.moveType;
            NFVector3 pos   = mHelpModule.PBToNF(xData.target_pos[0]);
            Vector3   vPos  = new Vector3(pos.X(), pos.Y(), pos.Z());

            if (nType > 0)
            {
                otherPlayer.JumpTo(vPos);
            }
            else
            {
                otherPlayer.MoveTo((float)fSpeed, vPos);
            }

            Debug.Log("Player Move:" + vPos.ToString());
        }