| | |
| | | private Dictionary<TreasureCategory, List<TreasureComponent>> m_Treasures = new Dictionary<TreasureCategory, List<TreasureComponent>>();
|
| | | private Dictionary<TreasureCategory, bool> m_PreloadDict = new Dictionary<TreasureCategory, bool>();
|
| | |
|
| | | Coroutine preloadCoroutine = null;
|
| | | private void InitTreasure()
|
| | | {
|
| | | Load(TreasureCategory.Human);
|
| | |
| | | HideAllTreasure();
|
| | | InitScene();
|
| | |
|
| | | if (preloadCoroutine != null)
|
| | | {
|
| | | StopCoroutine(preloadCoroutine);
|
| | | preloadCoroutine = null;
|
| | | }
|
| | |
|
| | | if (!m_PreloadDict.ContainsKey(currentCategory) && !_closer)
|
| | | {
|
| | | Preloading = true;
|
| | |
| | | current_angle = 0;
|
| | | before_angle = 0;
|
| | | before_drag_angle = current_angle;
|
| | | StartCoroutine(Co_PreLoad(currentCategory, () =>
|
| | | {
|
| | | if (!m_PreloadDict.ContainsKey(currentCategory))
|
| | | {
|
| | | m_PreloadDict.Add(currentCategory, true);
|
| | | }
|
| | | GoTreasureFromHeader(_index);
|
| | | Preloading = false;
|
| | | }));
|
| | | preloadCoroutine = StartCoroutine(Co_PreLoad(currentCategory, () =>
|
| | | {
|
| | | if (!m_PreloadDict.ContainsKey(currentCategory))
|
| | | {
|
| | | m_PreloadDict.Add(currentCategory, true);
|
| | | }
|
| | | GoTreasureFromHeader(_index);
|
| | | Preloading = false;
|
| | | preloadCoroutine = null;
|
| | | }));
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | public void Goto(int _index, bool _force = false)
|
| | | {
|
| | | var _list = m_Treasures[currentCategory];
|
| | | if (_index < 0 || _index >= _list.Count)
|
| | | {
|
| | | _index = 0;
|
| | | }
|
| | | jumpTreasure = _list[_index].treasureId;
|
| | | if (!_force && _index == presentSelectIndex)
|
| | | {
|