ArgumentException: Type System.String is not supported by NetworkVariable1. If this is a type you can change, then either implement INetworkSerializable or mark it as serializable by memcpy by adding INetworkSerializeByMemcpy to its interface list. If not, assign serialization code to UserNetworkVariableSerialization.WriteValue and UserNetworkVariableSerialization.ReadValue, or if it's serializable by memcpy (contains no pointers), wrap it in ForceNetworkSerializeByMemcpy
1.
という感じで
NetworkVariable<string>が使えなそうで
Unity fixed string types:
FixedString32Bytes
, FixedString64Bytes
, FixedString128Bytes
, FixedString512Bytes
, and FixedString4096Bytes
(which are serialized intelligently, only sending the used part across the network and adjusting the “length” of the string on the other side to fit the received data).
ということで NetworkVariable<FixedString32Bytes>に変更しました。
コメント