public override void Deserialize(SerializeProperty rootProperty) { m_FileID = (int)rootProperty.FindChild("m_FileID").Value; var pathID = rootProperty.FindChild("m_PathID"); if (pathID.propertyType == SerializePropertyType.Int) { m_PathID = (ulong)((int)pathID.Value); } else if(pathID.propertyType == SerializePropertyType.ULong) { m_PathID =(ulong)pathID.Value; } }
public override void Deserialize(SerializeProperty rootProperty) { m_FileID = (int)rootProperty.FindChild("m_FileID").Value; var pathID = rootProperty.FindChild("m_PathID"); if (pathID.propertyType == SerializePropertyType.Int) { m_PathID = (ulong)((int)pathID.Value); } else if (pathID.propertyType == SerializePropertyType.ULong) { m_PathID = (ulong)pathID.Value; } }
public override void Deserialize(SerializeProperty rootProperty) { base.Deserialize(rootProperty); bindField("m_Width", rootProperty); bindField("m_Height", rootProperty); bindField("m_CompleteImageSize", rootProperty); bindField("m_TextureFormat", rootProperty); bindField("m_MipCount", rootProperty); bindField("m_IsReadable", rootProperty); bindField("m_ReadAllowed", rootProperty); bindField("m_ImageCount", rootProperty); bindField("m_TextureDimension", rootProperty); m_TextureSettings.Deserialize(rootProperty.FindChild("m_TextureSettings")); bindField("m_LightmapFormat", rootProperty); bindField("m_ColorSpace", rootProperty); image_data = (byte[])rootProperty.FindChild("image data").Value; }
protected void bindField(string fieldName, SerializeProperty rootProperty) { var field = GetType().GetField(fieldName, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); if (field == null) { Debug.LogError("Can't find field {0} in {1}.", fieldName, GetType().Name); return; } var property = rootProperty.FindChild(fieldName); if (property == null) { Debug.LogError("Can't find property {0} in {1}.", fieldName, GetType().Name); return; } field.SetValue(this, property.Value); }
public override void Deserialize(SerializeProperty rootProperty) { var array = (SerializeProperty[])rootProperty.FindChild("m_Container.Array").Value; foreach (var data in array) { string path = (string)data.FindChild("path").Value; var assetProperty = data.FindChild("asset"); var asset = new PptrObject(); asset.Deserialize(assetProperty); List<PptrObject> list = null; if (!m_Container.TryGetValue(path, out list)) { list = new List<PptrObject>(); m_Container[path] = list; } list.Add(asset); } }
public override void Deserialize(SerializeProperty rootProperty) { var array = (SerializeProperty[])rootProperty.FindChild("m_Container.Array").Value; foreach (var data in array) { string path = (string)data.FindChild("path").Value; var assetProperty = data.FindChild("asset"); var asset = new PptrObject(); asset.Deserialize(assetProperty); List <PptrObject> list = null; if (!m_Container.TryGetValue(path, out list)) { list = new List <PptrObject>(); m_Container[path] = list; } list.Add(asset); } }
public override void Deserialize(SerializeProperty rootProperty) { base.Deserialize(rootProperty); m_FontData = (byte[])rootProperty.FindChild("m_FontData.Array").Value; }
public override void Deserialize(SerializeProperty rootProperty) { base.Deserialize(rootProperty); m_Script = (string)rootProperty.FindChild("m_Script").Value; m_PathName = (string)rootProperty.FindChild("m_PathName").Value; }
public override void Deserialize(SerializeProperty rootProperty) { m_Name = (string)rootProperty.FindChild("m_Name").Value; }