Exemple #1
0
    private static IEnumerator CheckRelease()
    {
        // 1分钟以后开始回收资源
        yield return(new WaitForSeconds(60.0f));

        while (true)
        {
            var array = mDictionary.Values.ToArray();
            {
                var __array1       = array;
                var __arrayLength1 = __array1.Length;
                for (var __i1 = 0; __i1 < __arrayLength1; ++__i1)
                {
                    var i = __array1[__i1];
                    {
                        i.CheckRelease();
                        if (i.Count == 0)
                        {
                            i.Destroy();
                            mDictionary.Remove(i.Name);
                            OptList.ClearAll();
                            yield return(new WaitForSeconds(10.0f));
                        }
                    }
                }
            }
            yield return(new WaitForSeconds(30.0f));
        }
        yield break;
    }
Exemple #2
0
 private void OnDestroy()
 {
     RemoveBinding();
     OptList.ClearAll();
 }