12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using AIPagedLod;
- public class LoadTileAsyncManager : MonoBehaviour
- {
- public static LoadTileAsyncManager mInstance;
- public int mCurrentCoroutineCount = 0;
- void Awake()
- {
- mInstance = this;
- }
- public void StartLoadChildTile(PagedLod pagedLod, PagedLodFileLoader pagedLodLoader, PagedLodInfo pagedLodInfo)
- {
- mCurrentCoroutineCount++;
- StartCoroutine(LoadChildTileAsync( pagedLod, pagedLodLoader, pagedLodInfo));
- }
- public IEnumerator LoadChildTileAsync(PagedLod pagedLod, PagedLodFileLoader pagedLodLoader, PagedLodInfo pagedLodInfo)
- {
- pagedLod.LoadTilePagedLod(pagedLodInfo,pagedLodLoader);
- pagedLodLoader.Dispose();
- pagedLodLoader = null;
- yield return null;
- mCurrentCoroutineCount--;
- }
- public void StartLoadRenderNode(PagedLod pagedLod, PagedLodFileLoader pagedLodLoader)
- {
- StartCoroutine(LoadRenderNode(pagedLod, pagedLodLoader));
- }
- public IEnumerator LoadRenderNode(PagedLod pagedLod, PagedLodFileLoader pagedLodLoader)
- {
- pagedLod.LoadRenderNode(pagedLodLoader);
- pagedLodLoader.Dispose();
- pagedLodLoader = null;
- yield return null;
- }
- }
|