You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
🆙 Fix latency problems with walking / avatars
This commit is contained in:
@@ -9,6 +9,7 @@ export class AssetManager implements IAssetManager
|
|||||||
{
|
{
|
||||||
private _textures: Map<string, Texture> = new Map();
|
private _textures: Map<string, Texture> = new Map();
|
||||||
private _collections: Map<string, IGraphicAssetCollection> = new Map();
|
private _collections: Map<string, IGraphicAssetCollection> = new Map();
|
||||||
|
private _missingAssetNames: Set<string> = new Set();
|
||||||
|
|
||||||
public getTexture(name: string): Texture
|
public getTexture(name: string): Texture
|
||||||
{
|
{
|
||||||
@@ -30,6 +31,8 @@ export class AssetManager implements IAssetManager
|
|||||||
{
|
{
|
||||||
if(!name) return null;
|
if(!name) return null;
|
||||||
|
|
||||||
|
if(this._missingAssetNames.has(name)) return null;
|
||||||
|
|
||||||
for(const collection of this._collections.values())
|
for(const collection of this._collections.values())
|
||||||
{
|
{
|
||||||
if(!collection) continue;
|
if(!collection) continue;
|
||||||
@@ -41,6 +44,8 @@ export class AssetManager implements IAssetManager
|
|||||||
return existing;
|
return existing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._missingAssetNames.add(name);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,6 +75,8 @@ export class AssetManager implements IAssetManager
|
|||||||
|
|
||||||
this._collections.set(collection.name, collection);
|
this._collections.set(collection.name, collection);
|
||||||
|
|
||||||
|
if(this._missingAssetNames.size > 0) this._missingAssetNames.clear();
|
||||||
|
|
||||||
return collection;
|
return collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user