| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using TableConfig; |
| | | |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using TableConfig;
|
| | |
|
| | | [XLua.LuaCallCSharp]
|
| | | public class AssetPreLoad : SingletonMonobehaviour<AssetPreLoad>
|
| | | { |
| | | {
|
| | | public void PreLoadNPC(int _mapId)
|
| | | {
|
| | | NpcPreloadConfig _config = Config.Instance.Get<NpcPreloadConfig>(_mapId);
|
| | |
| | | get { return m_Effects ?? (m_Effects = Config.Instance.GetAllValues<EffectConfig>()); }
|
| | | }
|
| | |
|
| | | List<int> loadedJobs = new List<int>(); |
| | | |
| | | List<int> loadedJobs = new List<int>();
|
| | |
|
| | | public void PreLoadJobEffect(int _job)
|
| | | {
|
| | | if (loadedJobs.Contains(_job))
|
| | |
| | | {
|
| | | StartCoroutine(Co_AsyncLoadEffects(preLoadEffects));
|
| | | }
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | IEnumerator Co_AsyncLoadEffects(List<int> _effectIds)
|
| | | {
|
| | | for (int i = 0; i < _effectIds.Count; i++)
|
| | |
| | |
|
| | | yield return null;
|
| | | }
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | private void OnAsyncLoadEffect(bool _ok, Object _object)
|
| | | {
|
| | | if (_ok)
|
| | | {
|
| | | GameObjectPoolManager.Instance.CacheGameObject(_object as GameObject, 1, false);
|
| | | }
|
| | | } |
| | | |
| | | } |
| | | }
|
| | |
|
| | | }
|