public IGameObjectResource[] snapshot() { var ret = new IGameObjectResource[resources.Count]; resources.Values.forEach((res, i) => ret[i] = res); return(ret); }
public void unloadObject(IGameObjectResource res) { var _res = res as GameObjectResource; if (_res != null && resources.Remove(res.name)) { _res._prefab = null; _res.requests = null; onResourceUnload(res); //ResourceManager.inst.hintUnloadUnusedAssets(); } }
protected virtual GameObject doInstantiate(IGameObjectResource res, GameObject proxy, bool worldPositionStays) { Transform parent = null; if (!Object.ReferenceEquals(proxy, null)) { if (proxy != null) { parent = proxy.transform; } else { return(null); } } return(Instantiate <GameObject>(res.prefab, parent, worldPositionStays)); }
GameObject specialInstantiate(IGameObjectResource res) { GameObject childObj = getChildGameObj(res.prefab); return(Instantiate <GameObject>(childObj, Vector3.zero, new Quaternion())); }
protected override void onResourceUnload(IGameObjectResource res) { policy.unload(res); }
protected override void onResourceRequest(IGameObjectResource res) { policy.request(res); }
protected virtual void onResourceUnload(IGameObjectResource res) { }
protected virtual void onResourceRequest(IGameObjectResource res) { }