public int WriteLength(StreamContext context) { int length = 0; // Meta model length += WriteStream.WriteModelLength(0, _metaModel, context); if (context.fullModel) { // Write all properties if (_sceneViewUUID != null && _sceneViewUUID.Length > 0) { length += WriteStream.WriteBytesLength((uint)PropertyID.SceneViewUUID, _sceneViewUUID.Length); } if (_prefabName != null && _prefabName.Length > 0) { length += WriteStream.WriteStringLength((uint)PropertyID.PrefabName, _prefabName); } } // Components if (_componentsModel != null) { length += WriteStream.WriteModelLength((uint)PropertyID.Components, _componentsModel, context); } // Child Views if (_childViewsModel != null) { length += WriteStream.WriteModelLength((uint)PropertyID.ChildViews, _childViewsModel, context); } return(length); }
// Serialization public int WriteLength(StreamContext context) { int length = 0; foreach (Component component in _components) { length += WriteStream.WriteModelLength((uint)component.componentID, component.model, context); } return(length); }