はじめに
https://bitbucket.org/snippets/Lordinarius/8rnLn/chainedworks
上記のサイト様が公開されている「ChainedWorks」を使用することで
関数を連結して実行できるようになります
使用例
using UnityEngine; public class Example : MonoBehaviour { private void Start() { var chainedWork = new ChainedWork(); chainedWork.AddWork( () => Debug.Log( "delegate" ), 2 ); chainedWork.AddWork( MethodWithNoParameter, 1.2f ); chainedWork.AddWork( () => MethodWithParameter( 5 ), 1.4f ); StartCoroutine( chainedWork.DoWorkCO() ); } private void MethodWithNoParameter() { Debug.Log( "MethodWithNoParameter" ); } private void MethodWithParameter( int param ) { Debug.Log( "MethodWithParameter: " + param.ToString() ); } }