Example #1
0
    public bool RequestUpdate(IUpdatableOnDemand updateRequester)
    {
        var contains = _updating.Contains(updateRequester);

        if (_behaviour.gameObject.activeSelf)
        {
            _behaviour.StartCoroutine(UpdateCoroutine(updateRequester));
        }
        return(!contains);
    }
Example #2
0
    public bool RequestUpdate(IUpdatableOnDemand updateRequester)
    {
        var contains = _updating.Contains(updateRequester);

        if (!contains)
        {
            StartCoroutine(UpdateCoroutine(updateRequester));
        }
        return(!contains);
    }
Example #3
0
    public bool RequestUpdate(IUpdatableOnDemand updateRequester)
    {
        var contains = _updatingHash.Contains(updateRequester);

        if (!contains)
        {
            _updating.Add(updateRequester);
            _updatingHash.Add(updateRequester);
        }
        return(!contains);
    }
Example #4
0
 IEnumerator UpdateCoroutine(IUpdatableOnDemand updateRequester)
 {
     if (!_updating.Contains(updateRequester))
     {
         _updating.Add(updateRequester);
         while (_behaviour != null && updateRequester.Update(Time.deltaTime))
         {
             yield return(null);
         }
         _updating.Remove(updateRequester);
     }
 }