title: Inline function blocks in C#
body: <p>Using the dotween library for Unity: <a href="http://dotween.demigiant.com/documentation.php" rel="nofollow">http://dotween.demigiant.com/documentation.php</a></p>
  
  <p>And being rusty on C#...</p>
  
  <p>Is there a way to specify a function inline as parameter to .OnComplete for instance, so that we don't have to chop up a sequence of actions in separate functions?</p>
  
  <p>Ie I'd like to use the feature known as blocks in ObjC, but in C#.</p>
  
  <p>Long-winded an unintuitive way:</p>
  
  <pre><code>void myCallback () {
     // do more stuff here
  }
  void mysequence() {
      transform.DOMoveX(4, 1).OnComplete(myCallback);
  }
  </code></pre>
  
  <p>What I want to do which is easier to read and keeps stuff in place:</p>
  
  <pre><code>void mysequence() {
      transform.DOMoveX(4, 1).OnComplete({
          // do more stuff here
      });
  }
  </code></pre>