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.

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