public static void Serialize(ByteBuffer buffer, ServerGameObject NGGameObject) { using (SafeWrapByteBuffer.Get(buffer)) { NGGameObject.ProcessComponents(); buffer.Append(NGGameObject.instanceID); buffer.AppendUnicodeString(NGGameObject.gameObject.tag); buffer.Append(NGGameObject.gameObject.layer); buffer.Append(NGGameObject.gameObject.isStatic); buffer.Append(NGGameObject.components.Count); for (int i = NGGameObject.components.Count - 1; i >= 0; --i) { try { NetComponent.Serialize(buffer, NGGameObject.components[i]); } catch (Exception ex) { InternalNGDebug.LogException("GameObject \"" + NGGameObject.gameObject.name + "\" failed on Component \"" + NGGameObject.components[i].component.name + "\" (" + (i + 1) + "/" + NGGameObject.components.Count + ").", ex); throw; } } } }
public override void Out(ByteBuffer buffer) { if (this.OutResponseStatus(buffer) == true) { buffer.Append(this.gameObjectInstanceID); NetComponent.Serialize(buffer, this.serverComponent); } }
public override void Out(ByteBuffer buffer) { buffer.Append(this.networkId); buffer.Append(this.gameObjectInstanceID); NetComponent.Serialize(buffer, this.serverComponent); }