You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
843 B

  1. // Amplify Shader Editor - Visual Shader Editing Tool
  2. // Copyright (c) Amplify Creations, Lda <info@amplify.pt>
  3. using System;
  4. using UnityEngine;
  5. namespace AmplifyShaderEditor
  6. {
  7. [Serializable]
  8. public class FallbackString : IFallbackVars
  9. {
  10. [SerializeField]
  11. private string m_current;
  12. [SerializeField]
  13. private string m_previous;
  14. public FallbackString()
  15. {
  16. m_current = string.Empty;
  17. m_previous = string.Empty;
  18. }
  19. public FallbackString( string data )
  20. {
  21. m_current = data;
  22. m_previous = data;
  23. }
  24. public void Revert()
  25. {
  26. string aux = m_current;
  27. m_current = m_previous;
  28. m_previous = aux;
  29. }
  30. public string Current
  31. {
  32. get
  33. {
  34. return m_current;
  35. }
  36. set
  37. {
  38. m_previous = m_current;
  39. m_current = value;
  40. }
  41. }
  42. public override string ToString()
  43. {
  44. return m_current;
  45. }
  46. }
  47. }