示例#1
0
    public Cothread StartCothread(IEnumerator routine, GameObject owner)
    {
        CothreadsBehaviour cb = owner.GetComponent <CothreadsBehaviour>();

        if (cb == null)
        {
            cb = owner.AddComponent <CothreadsBehaviour>();
        }
        Cothread th = StartCoroutine(routine);

        cb.AddCothread(th);
        return(th);
    }
示例#2
0
 public void AddCothread(Cothread thread)
 {
     threads.Add(thread);
     thread.ev.onSet += onClose;
 }