title: c# A Queue of different Action
body: <p>My Queue Class;</p>
  
  <pre><code>public class JobManager : MonoBehaviour {
  
  private Queue&lt;Action&gt; queue;
  
  public void AddAction(Action action)
      {
          queue.Enqueue(action);
      }
  ....
  </code></pre>
  
  <p>I have two methods:</p>
  
  <pre><code>void CreateCube()
  {
     // doSomething..
  }
  
  void SetPosition(Vector3 pos)
  {
     // doSomething..
  }
  </code></pre>
  
  <p>I can use this:</p>
  
  <pre><code>JobManager.Instance.AddAction(CreateCube);
  </code></pre>
  
  <p>But this is not:</p>
  
  <pre><code>JobManager.Instance.AddAction(SetPosition);
  </code></pre>
  
  <p>How can i define a queue for all different Actions? Or How can i add different Actions?</p>
  
  <p>Edit:</p>
  
  <p>JobManager calling Actions like this;</p>
  
  <pre><code>    IEnumerator ActionControl(){
          while (true){
              if (currentQueue != null){
                  while (true){
                      currentQueue();
                      yield return null;
                      currentQueue = null;
                      break;
                  }
              }
              yield return null;
          }
      }
  
      private void Update(){
          if (queue.Count &gt; 0 &amp;&amp; currentQueue == null){
              currentQueue = queue.Dequeue();
          }
      }
  </code></pre>
  
  <p>What I really want is that any method can be placed in a single queue. (with parameter or not) Then we will run them in order. Is that possible?</p>