我正在研究需要快速協程的東西,我相信numba可以加速我的代碼。 下面是一個愚蠢的例子:一個函數,它的輸入平方,並增加了它被調用的次數。 def make_square_plus_count():
i = 0
def square_plus_count(x):
nonlocal i
i += 1
return x**2 + i
re
這裏是我的代碼,我想使用一個協程: using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
void Update(){
StartCoroutine (Test()