コード例 #1
0
ファイル: Routines.cs プロジェクト: PlumpMath/Iterator
        public static IEnumerator Cancelable(float x, Action <float> retrun, CoroutToken token)
        {
            for (int i = 0; i < 5; i++)
            {
                yield return(null);
            }

            token.Cancel();
            retrun(x * x);
        }
コード例 #2
0
ファイル: Routines.cs プロジェクト: PlumpMath/Iterator
        public static IEnumerator CancelableAfter(int step, float x, Action <float> retrun, CoroutToken token)
        {
            token.CancelAfter(step);

            for (int i = 0; i < 1000; i++)
            {
                yield return(null);
            }

            retrun(x * x);
        }