本人想在unity當中制作技能的擴展,因為不能在ScriptableObject當中直接使用StartCoroutine,只能在library之中再寫一個function去StartCoroutine一個 IEnumerator funcyion.之後就出現an object reference is required for the non-static field的ERROR,求大神賜教QQ
public class basic_attack : ScriptableObject
{
public void TriggerSkill()
{
testt.activeskill();
}
}
//以下是library當中的code
public class testt :MonoBehaviour
{
public static void activeskill()
{
StartCoroutine(testtt());
}
public IEnumerator testtt()
{
//doing something
yield return new WaitForSeconds(5f);
//doing something
}
}