networkBehaviour的几种状态
来源:互联网 发布:vscode使用教程 编辑:程序博客网 时间:2024/04/28 21:10
参考文章:
Unity5.1 新的网络引擎UNET(十五) Networking 引用--上
UNET中常用到networkBehaviour的状态判断,项目中使用率最高时isLocalPlayer/isServer/isClient,不过初学时很容易误解意思,特此来理清一下。
Property: Function:
当这个玩家物体属于本地客户端的物体时为true。isServerTrue if this object is running on the server, and has been spawned.
当这个物体是被服务器NetworkServer.Spawn()产生出来的,并且本机端是服务器端(也包括主机端),则为true。startHost/startClient默认调用spawn()。isClientTrue if this object is running on a client.
当这个物体运行,并且本机端是客户端(也包括主机端),则为true。hasAuthorityThis returns true if this object is the authoritative version of the object in the distributed network application.So either on the server, or on the client with localPlayerAuthority.
当这个物体在分布式网络应用中是权威版本,则为true(不清楚)。发现基本与isServer状态同步。所以无论服务器或客户端都有本地玩家授权localPlayerAuthority。assetIdThis is the assetId of the object’s NetworkIdentity.
这是物体资源id,多个玩家使用同一个资源时这个属性会一样。netIdThis is the netId of the object’s NetworkIdentity.
这是物体网络id,针对每个玩家发送不同数据时会用到。playerControllerIdThis is the playerControllerId of the object’s NetworkIdentity.
这是物体的玩家控制id,暂不清楚作用。connectionToServerNetworkConnection object to use to send to the server.
用来发送给服务器的NetworkConnection 对象,暂不清楚作用。connectionToClient
NetworkConnection object to use to send to the client.
用来发送给客户端的NetworkConnection 对象,暂不清楚作用。
打开编辑器和一个导出的exe程序同时运行,演示结果如下(一行一个例子)
属于编辑器端物体外部程序物体编辑器host,外部client编辑器client,外部host编辑器server,外部client无编辑器client,外部server无
0 0
- networkBehaviour的几种状态
- 进程的几种状态
- 线程的几种状态
- 线程的几种状态
- 线程的几种状态
- 线程的几种状态
- Activity的几种状态
- task的几种状态
- 线程的几种状态
- 进程的几种状态
- 线程的几种状态
- 多线程的几种状态
- 线程的几种状态
- View 的几种状态
- java的线程的几种状态
- java 的几种线程的几种状态
- TCP连接的几种状态及连接状态详解
- 超链接样式的几种状态
- HTTP、TCP、UDP、Socket、servlet区别与联系
- 嵌入式Linux的Samba移植后的 smb.conf文件的配置
- linux mint安装
- 小知识
- 小程序实现局部元素隐藏
- networkBehaviour的几种状态
- 欢迎去简书继续支持博主
- 斯坦福大学——机器学习第一课
- (0020)iOS 开发之-设计模式-懒加载解惑
- 小程序的事件
- TCP客户/服务器
- sklearn-数据预处理-特征变换
- 股票买卖点K线形态:三空阴线__K线图形态
- 李彦宏-四宗“最”解读!《开讲啦》 节目现场首创四宗“最”