Version: 2017.2
public List<ChannelQOS> Channels ;

描述

属于当前配置的通道的列表。

注意:作为参数传递到 Unity Multiplayer 中某个函数的所有 ConnectionConfig 都会进行深度复制(即创建一个全新的副本,完全不引用原始配置)。

using UnityEngine;
using UnityEngine.Networking;

public class ExampleScript : NetworkBehaviour { void Start() { ConnectionConfig myConfig = new ConnectionConfig(); myConfig.AddChannel(QosType.Unreliable); myConfig.AddChannel(QosType.UnreliableFragmented); myConfig.AddChannel(QosType.UnreliableSequenced); myConfig.AddChannel(QosType.Reliable); myConfig.AddChannel(QosType.ReliableFragmented); myConfig.AddChannel(QosType.ReliableSequenced); myConfig.AddChannel(QosType.StateUpdate); myConfig.AddChannel(QosType.ReliableStateUpdate); myConfig.AddChannel(QosType.AllCostDelivery);

for (int i = 0; i < myConfig.ChannelCount; ++i) { Debug.Log("Channel: " + i + " has qos: " + myConfig.Channels[i].QOS); } } }