public static void Serialize(ServerScene scene, ByteBuffer buffer) { buffer.Append(scene.buildIndex); buffer.AppendUnicodeString(scene.name); buffer.Append(scene.roots.Count); for (int i = 0; i < scene.roots.Count; i++) { NetGameObject.Serialize(scene.roots[i], buffer); } }
public static void Serialize(ServerGameObject node, ByteBuffer buffer) { using (SafeWrapByteBuffer.Get(buffer)) { buffer.Append(node.gameObject.activeSelf); buffer.AppendUnicodeString(node.gameObject.name); buffer.Append(node.instanceID); buffer.Append(node.children.Count); for (int i = 0; i < node.children.Count; i++) { NetGameObject.Serialize(node.children[i], buffer); } } }