public void CreatSyncRequest()//创建request 脚本为同步信息set值
{
playerSyncRequest = new GameObject("PlayerSyncRequest");
playerSyncRequest.AddComponent<MoveRequest>()
.SetLocalPlayer(currentRoleGameObject.transform, currentRoleGameObject.GetComponent<PlayerMove>())
.SetRemotePlayer(remoteRoleGameObject.transform);
shootRequest = playerSyncRequest.AddComponent<ShootRequest>();
shootRequest.PlayerMng = this;
attackRequest = playerSyncRequest.AddComponent<AttackRequest>();
}
这一段方法里我退出房间在进入房间角色不会动
然后PlayerSyncRequest这个物体身上的PlayerMove MoveRequest ShootRequest AttackRequest
脚本都是没有打勾勾的但是第一次运行就是可以的退出后在运行就有问题