From 917e9e0b320775634dc2e710f7deac74fd0822f0 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 22 Oct 2020 23:30:02 +0800 Subject: * amplify shader editor --- .../Plugins/Editor/Native/FallbackVariable.cs | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Assets/AmplifyShaderEditor/Plugins/Editor/Native/FallbackVariable.cs (limited to 'Assets/AmplifyShaderEditor/Plugins/Editor/Native/FallbackVariable.cs') diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Native/FallbackVariable.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Native/FallbackVariable.cs new file mode 100644 index 00000000..c6d3eaf2 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Native/FallbackVariable.cs @@ -0,0 +1,36 @@ +// Amplify Shader Editor - Visual Shader Editing Tool +// Copyright (c) Amplify Creations, Lda + +using UnityEngine; +using System; + +namespace AmplifyShaderEditor +{ + //GENERICS DON'T WORK WITH HOT CODE RELOAD + [Serializable] + public class FallbackVariable + { + [SerializeField] + private T m_current; + [SerializeField] + private T m_last; + + public void Revert() + { + m_current = m_last; + } + + public T Current + { + get + { + return m_current; + } + set + { + m_last = m_current; + m_current = value; + } + } + } +} -- cgit v1.1-26-g67d0