- Home /
Question by
gaia2222 · Jun 05, 2020 at 09:41 AM ·
scriptableobjectstaticstartcoroutine
Can I active some static function in ScriptableObject?
public abstract class Enemy_Skill : ScriptableObject
{
public float aBaseCoolDown = 1f;
public abstract void TriggerSkill(Transform t, Vector3 dir);
}
[CreateAssetMenu(menuName = "Enemy_Skill/basic_attack")]
public class basic_attack : Enemy_Skill
{
public override void TriggerSkill(Transform t, Vector3 mousePos)
{
//StopCoroutine(some static function,Skill(1f,5,));
}
}
public class test :MonoBehaviour
{
public static IEnumerator Skill(float time, int x)
{
int counter= new int();
counter = 0;
while (counter < x)
{
//doing something
yield return new WaitForSeconds(time);
counter++;
}
}
Comment