title: Store a reference in another variable
body: <p>I've been searching around a bit, but I can't find any way to store a reference to another variable in a certain variable.
  I'm trying to make a class to undo things done by the user;</p>
  
  <pre><code>class UndoAction
  {
      public object var;
      public object val;
      public UndoAction(ref object var, object val)
      {
          this.var = var;
          this.val = val;
      }
  
      public static List&lt;UndoAction&gt; history = new List&lt;UndoAction&gt;();
      public static void AddHistory(ref object var, object val)
      {
          history.Add(new UndoAction(ref var, val));
      }
  }
  </code></pre>
  
  <p>I guess you can see what I'm trying to achieve here.</p>
  
  <p>The problem I ran on;</p>
  
  <pre><code>this.var = var;
  </code></pre>
  
  <p>doesn't store the reference, but the value of the referenced 'var'.
  How can I store the reference itself, so I can simply run;</p>
  
  <pre><code>this.var = val;
  </code></pre>
  
  <p>to "undo" an action, in my case?</p>