Beispiel #1
0
    public void Step()
    {
        int asyncLength = _asyncList.Count;

        for (int i = 0; i < asyncLength; ++i)
        {
            AsyncBlock block = _asyncList[i];
            Assert.IsNotNull(block);
            Assert.IsNotNull(block.request);

            if (!block.request.isDone)
            {
                continue;
            }

            UIView view = _createView((UIView)block.request.asset, block.parent);
            Assert.IsNotNull(view);

            if (block.callback != null)
            {
                block.callback(view);
            }

            _asyncList[i] = null;
        }

        for (int i = asyncLength - 1; i >= 0; --i)
        {
            if (_asyncList[i] == null)
            {
                _asyncList.RemoveAt(i);
            }
        }
    }
Beispiel #2
0
        public void Step(float deltaTime)
        {
            int asyncLength = _asyncList.Count;

            for (int i = 0; i < asyncLength; ++i)
            {
                AsyncBlock block = _asyncList[i];
                Assert.IsNotNull(block);
                Assert.IsNotNull(block.request);

                if (!block.request.isDone)
                {
                    continue;
                }

                Assert.IsNotNull(block.request.asset, "Asset: " + block.name + " couldn't be loaded!");

                UIView prefab = (UIView)block.request.asset;
                _assetCache.Add(block.name, prefab);
                UIView view = _createView(prefab, block.parent);
                Assert.IsNotNull(view);

                if (block.callback != null)
                {
                    block.callback(view);
                }

                _asyncList[i] = null;
            }

            for (int i = asyncLength - 1; i >= 0; --i)
            {
                if (_asyncList[i] == null)
                {
                    _asyncList.RemoveAt(i);
                }
            }
        }