Tim Cooper
7 年前
当前提交
4e26b4fc
共有 10 个文件被更改,包括 153 次插入 和 67 次删除
-
2MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorView.cs
-
8MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/ShaderLayerview.cs
-
54MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/AbstractMaterialGraph.cs
-
34MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/AbstractShaderProperty.cs
-
2MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/IShaderGraph.cs
-
4MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Interfaces/MaterialGraphChange.cs
-
4MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SubGraph/LayerWeightsOutputNode.cs
-
72MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SubGraph/LayeredShaderGraph.cs
-
37MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/SerializableGuid.cs
-
3MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/SerializableGuid.cs.meta
|
|||
using System; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Serializable] |
|||
public class SerializableGuid : ISerializationCallbackReceiver |
|||
{ |
|||
public SerializableGuid() |
|||
{ |
|||
m_Guid = Guid.NewGuid(); |
|||
} |
|||
|
|||
[NonSerialized] |
|||
private Guid m_Guid; |
|||
|
|||
[SerializeField] |
|||
private string m_GuidSerialized; |
|||
|
|||
public Guid guid |
|||
{ |
|||
get { return m_Guid; } |
|||
} |
|||
|
|||
public virtual void OnBeforeSerialize() |
|||
{ |
|||
m_GuidSerialized = m_Guid.ToString(); |
|||
} |
|||
|
|||
public virtual void OnAfterDeserialize() |
|||
{ |
|||
if (!string.IsNullOrEmpty(m_GuidSerialized)) |
|||
m_Guid = new Guid(m_GuidSerialized); |
|||
else |
|||
m_Guid = Guid.NewGuid(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: fb9a23efd2bc46e9a5e34bf5ff0c9768 |
|||
timeCreated: 1507479217 |
撰写
预览
正在加载...
取消
保存
Reference in new issue