public static void PreLoad(int resourceId, Action cb) { ResourceConfig conf = configs[resourceId]; if (conf == null) { Debug.LogErrorFormat("RreLoad error, not conf {0}", resourceId); return; } XLoader.LoadAsync <GameObject>(conf.path, (UnityEngine.Object go) => { GameObject g = go as GameObject; if (MapResourceCenter.caches.ContainsKey(resourceId)) { return; } g.transform.localScale = new Vector3((float)Map.MAP_CELL_DEMANSION_X, (float)Map.MAP_CELL_DEMANSION_Y, (float)Map.MAP_CELL_DEMANSION_X); MapResourceCache cache = new MapResourceCache(g); Debug.LogFormat("PreLoad {0}", resourceId); caches[resourceId] = cache; cb(); }); }
public MapResourceProxy(MapResourceCache p, GameObject resource) { parent = p; //this.proxyId = proxyId; this._resource = resource; }