Exemplo n.º 1
0
    public Coroutine StartTrackedCoroutine(IEnumerator routine)
    {
        var tc = new TrackedCoroutine(routine);

        _tcSet.Add(tc);
        tc.onComplete += RemoveTC;
        tc.coroutine   = base.StartCoroutine(tc);
        return(tc.coroutine);
    }
Exemplo n.º 2
0
    public void StopTrackedCoroutine(IEnumerator routine)
    {
        TrackedCoroutine tc = null;

        foreach (var temp in _tcSet)
        {
            if (temp.trackedCoroutine == routine)
            {
                tc = temp;
                break;
            }
        }

        if (tc != null)
        {
            RemoveTC(tc);
            base.StopCoroutine(routine);
        }
    }
    public void StopTrackedCoroutine(Coroutine routine)
    {
        TrackedCoroutine tc = null;

        foreach (var temp in _tcSet)
        {
            if (temp.coroutine == routine)
            {
                tc = temp;
                break;
            }
        }

        if (tc != null)
        {
            RemoveTC(tc);
            if (null != this)
            {
                base.StopCoroutine(routine);
            }
        }
    }
Exemplo n.º 4
0
 private void RemoveTC(TrackedCoroutine tc)
 {
     tc.onComplete -= RemoveTC;
     _tcSet.Remove(tc);
     DestroyIfEmpty();
 }