Add SoftAssetReference type
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
|
||||
struct Version;
|
||||
struct VariantType;
|
||||
template<typename T>
|
||||
class SoftAssetReference;
|
||||
|
||||
// @formatter:off
|
||||
|
||||
@@ -513,6 +515,26 @@ namespace Serialization
|
||||
v = id;
|
||||
}
|
||||
|
||||
// Soft Asset Reference
|
||||
|
||||
template<typename T>
|
||||
inline bool ShouldSerialize(const SoftAssetReference<T>& v, const void* otherObj)
|
||||
{
|
||||
return !otherObj || v.Get() != ((SoftAssetReference<T>*)otherObj)->Get();
|
||||
}
|
||||
template<typename T>
|
||||
inline void Serialize(ISerializable::SerializeStream& stream, const SoftAssetReference<T>& v, const void* otherObj)
|
||||
{
|
||||
stream.Guid(v.GetID());
|
||||
}
|
||||
template<typename T>
|
||||
inline void Deserialize(ISerializable::DeserializeStream& stream, SoftAssetReference<T>& v, ISerializeModifier* modifier)
|
||||
{
|
||||
Guid id;
|
||||
Deserialize(stream, id, modifier);
|
||||
v = id;
|
||||
}
|
||||
|
||||
// Array
|
||||
|
||||
template<typename T, typename AllocationType = HeapAllocation>
|
||||
|
||||
Reference in New Issue
Block a user