少年修仙传客户端代码仓库
client_Wu Xijin
2018-10-22 2da6556c080e680286ce5e8f93b322bdb5a35259
Core/Utilities/AssetPreLoad.cs
@@ -1,10 +1,11 @@
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);
@@ -36,8 +37,8 @@
        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))
@@ -61,8 +62,8 @@
        {
            StartCoroutine(Co_AsyncLoadEffects(preLoadEffects));
        }
    }
    }
    IEnumerator Co_AsyncLoadEffects(List<int> _effectIds)
    {
        for (int i = 0; i < _effectIds.Count; i++)
@@ -72,14 +73,14 @@
            yield return null;
        }
    }
    }
    private void OnAsyncLoadEffect(bool _ok, Object _object)
    {
        if (_ok)
        {
            GameObjectPoolManager.Instance.CacheGameObject(_object as GameObject, 1, false);
        }
    }
}
    }
}