Assignment for RMIT Mixed Reality in 2020
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
808 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 FallbackInt : IFallbackVars
  9. {
  10. [SerializeField]
  11. private int m_current;
  12. [SerializeField]
  13. private int m_previous;
  14. public FallbackInt()
  15. {
  16. m_current = 0;
  17. m_previous = 0;
  18. }
  19. public FallbackInt( int data )
  20. {
  21. m_current = data;
  22. m_previous = data;
  23. }
  24. public void Revert()
  25. {
  26. int aux = m_current;
  27. m_current = m_previous;
  28. m_previous = aux;
  29. }
  30. public int 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. }