Rasagar/Library/PackageCache/com.unity.render-pipelines.high-definition/Editor/AssetProcessors/PluginMaterialVersions.cs

22 lines
640 B
C#
Raw Normal View History

2024-08-26 13:07:20 -07:00
using System;
using UnityEngine.Rendering;
namespace UnityEditor.Rendering.HighDefinition
{
[Serializable]
class PluginMaterialVersions : SerializedDictionary<GUID, int, string, int>
{
public override string SerializeKey(GUID key) => key.ToString();
public override int SerializeValue(int val) => val;
public override GUID DeserializeKey(string key)
{
if (!string.IsNullOrEmpty(key) && GUID.TryParse(key, out GUID guid))
return guid;
else
return new GUID();
}
public override int DeserializeValue(int val) => val;
}
}