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.

55 lines
845 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 FallbackTexture : IFallbackVars
  9. {
  10. [SerializeField]
  11. private Texture m_current;
  12. [SerializeField]
  13. private Texture m_previous;
  14. public FallbackTexture()
  15. {
  16. m_current = null;
  17. m_previous = null;
  18. }
  19. public FallbackTexture( Texture data )
  20. {
  21. m_current = data;
  22. m_previous = data;
  23. }
  24. public void Revert()
  25. {
  26. Texture aux = m_current;
  27. m_current = m_previous;
  28. m_previous = aux;
  29. }
  30. public Texture 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.ToString();
  45. }
  46. }
  47. }