239 lines
10 KiB
C#
239 lines
10 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Cpp2IlInjected;
|
|
using MEC;
|
|
using UnityEngine;
|
|
|
|
// Token: 0x02000133 RID: 307
|
|
[Token(Token = "0x2000133")]
|
|
public sealed class GameAssetManager
|
|
{
|
|
// Token: 0x06000FA6 RID: 4006 RVA: 0x00024764 File Offset: 0x00022964
|
|
[Token(Token = "0x6000FA6")]
|
|
[Address(RVA = "0x36A130", Offset = "0x369130", VA = "0x18036A130")]
|
|
public void Init()
|
|
{
|
|
AssetLoader assetLoader = new AssetLoader();
|
|
Action<AssetRequestBase, UnityEngine.Object[]> action = new Action(this.OnAssetLoaded);
|
|
assetLoader.<OnFinished>k__BackingField = action;
|
|
this.assetLoader = assetLoader;
|
|
Queue<AssetRequestBase> queue = new Queue();
|
|
this.handlingRequests = queue;
|
|
List<AssetRequestBase> list = new List();
|
|
this.pendingRequests = list;
|
|
Dictionary<string, UnityEngine.Object[]> dictionary = new Dictionary();
|
|
this.assetsCache = dictionary;
|
|
int num;
|
|
GameAssetManager.<Tick>d__20 <Tick>d__ = new GameAssetManager.<Tick>d__20(num);
|
|
num = 0;
|
|
<Tick>d__.<>4__this = this;
|
|
CoroutineHandle coroutineHandle = MECExtensionMethods1.RunCoroutine(<Tick>d__);
|
|
this.assetRequestProcessor = coroutineHandle;
|
|
}
|
|
|
|
// Token: 0x06000FA7 RID: 4007 RVA: 0x000247E8 File Offset: 0x000229E8
|
|
[Token(Token = "0x6000FA7")]
|
|
[Address(RVA = "0x369EF0", Offset = "0x368EF0", VA = "0x180369EF0")]
|
|
public void BindAssetRequestUpdateHandler(Action<float> handler)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06000FA7)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void GameAssetManager::BindAssetRequestUpdateHandler(System.Action`1<System.Single>)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{; Block_0:; stfld:class [mscorlib]System.Action`1<float32>(GameAssetManager::updateHandler, ldloc:GameAssetManager(this), ldloc:class [mscorlib]System.Action`1<float32>(handler)); };
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1810
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 344
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x06000FA8 RID: 4008 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FA8")]
|
|
[Address(RVA = "0x36A420", Offset = "0x369420", VA = "0x18036A420")]
|
|
public void LoadAllPendingAssetAsync(Action handler)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FA9 RID: 4009 RVA: 0x000247FC File Offset: 0x000229FC
|
|
[Token(Token = "0x6000FA9")]
|
|
[Address(RVA = "0x369E90", Offset = "0x368E90", VA = "0x180369E90")]
|
|
public void AddAssetRequest(AssetRequestBase req)
|
|
{
|
|
this.pendingRequests.Add(req);
|
|
}
|
|
|
|
// Token: 0x06000FAA RID: 4010 RVA: 0x0002481C File Offset: 0x00022A1C
|
|
[Token(Token = "0x6000FAA")]
|
|
[Address(RVA = "0x36A650", Offset = "0x369650", VA = "0x18036A650")]
|
|
public void LoadAssetAsync(AssetRequestBase req)
|
|
{
|
|
this.handlingRequests.Enqueue(req);
|
|
}
|
|
|
|
// Token: 0x06000FAB RID: 4011 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FAB")]
|
|
[Address(RVA = "0x36A6B0", Offset = "0x3696B0", VA = "0x18036A6B0")]
|
|
public void LoadAsset(AssetRequestBase req)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FAC RID: 4012 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FAC")]
|
|
[Address(RVA = "0x39B650", Offset = "0x39A650", VA = "0x18039B650")]
|
|
public T GetAsset<T>(int assetType, string assetName) where T : UnityEngine.Object
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FAD RID: 4013 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FAD")]
|
|
[Address(RVA = "0x39B7B0", Offset = "0x39A7B0", VA = "0x18039B7B0")]
|
|
public T GetSubAsset<T>(int assetType, string assetName, string subAssetName) where T : UnityEngine.Object
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FAE RID: 4014 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FAE")]
|
|
[Address(RVA = "0x39B440", Offset = "0x39A440", VA = "0x18039B440")]
|
|
public T[] GetAllAssets<T>(int assetType, string assetName) where T : UnityEngine.Object
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FAF RID: 4015 RVA: 0x0002483C File Offset: 0x00022A3C
|
|
[Token(Token = "0x6000FAF")]
|
|
[Address(RVA = "0x36AB10", Offset = "0x369B10", VA = "0x18036AB10")]
|
|
public void UnloadUnusedAssets()
|
|
{
|
|
this.assetsCache.Clear();
|
|
AsyncOperation asyncOperation = Resources.UnloadUnusedAssets();
|
|
}
|
|
|
|
// Token: 0x06000FB0 RID: 4016 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FB0")]
|
|
[Address(RVA = "0x36A8F0", Offset = "0x3698F0", VA = "0x18036A8F0")]
|
|
public void UnloadAssetsCache(string resType)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FB1 RID: 4017 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FB1")]
|
|
[Address(RVA = "0x369F00", Offset = "0x368F00", VA = "0x180369F00")]
|
|
public void Dispose()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FB2 RID: 4018 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FB2")]
|
|
[Address(RVA = "0x36A880", Offset = "0x369880", VA = "0x18036A880")]
|
|
private IEnumerator<float> Tick()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FB3 RID: 4019 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FB3")]
|
|
[Address(RVA = "0x36AB60", Offset = "0x369B60", VA = "0x18036AB60")]
|
|
private IEnumerator<float> WaitForAllHandlingRequest()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FB4 RID: 4020 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FB4")]
|
|
[Address(RVA = "0x36A080", Offset = "0x369080", VA = "0x18036A080")]
|
|
private void HandleRequests()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FB5 RID: 4021 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FB5")]
|
|
[Address(RVA = "0x369FB0", Offset = "0x368FB0", VA = "0x180369FB0")]
|
|
private UnityEngine.Object[] GetAssetFromCache(string assetKey)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FB6 RID: 4022 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FB6")]
|
|
[Address(RVA = "0x36A330", Offset = "0x369330", VA = "0x18036A330")]
|
|
private bool IsRequestHandled(AssetRequestBase req)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FB7 RID: 4023 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FB7")]
|
|
[Address(RVA = "0x36A790", Offset = "0x369790", VA = "0x18036A790")]
|
|
private void OnAssetLoaded(AssetRequestBase req, UnityEngine.Object[] assetObjs)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FB8 RID: 4024 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000FB8")]
|
|
[Address(RVA = "0x36A030", Offset = "0x369030", VA = "0x18036A030")]
|
|
private string GetCacheKey(int resType, string assetName)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000FB9 RID: 4025 RVA: 0x00024864 File Offset: 0x00022A64
|
|
[Token(Token = "0x6000FB9")]
|
|
[Address(RVA = "0x36ABD0", Offset = "0x369BD0", VA = "0x18036ABD0")]
|
|
public GameAssetManager()
|
|
{
|
|
}
|
|
|
|
// Token: 0x04001A15 RID: 6677
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4001A15")]
|
|
private AssetLoader assetLoader;
|
|
|
|
// Token: 0x04001A16 RID: 6678
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4001A16")]
|
|
private Queue<AssetRequestBase> handlingRequests;
|
|
|
|
// Token: 0x04001A17 RID: 6679
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4001A17")]
|
|
private List<AssetRequestBase> pendingRequests;
|
|
|
|
// Token: 0x04001A18 RID: 6680
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4001A18")]
|
|
private Dictionary<string, UnityEngine.Object[]> assetsCache;
|
|
|
|
// Token: 0x04001A19 RID: 6681
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4001A19")]
|
|
private CoroutineHandle assetRequestProcessor;
|
|
|
|
// Token: 0x04001A1A RID: 6682
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4001A1A")]
|
|
private Action<float> updateHandler;
|
|
|
|
// Token: 0x04001A1B RID: 6683
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4001A1B")]
|
|
private Action completeHandler;
|
|
|
|
// Token: 0x04001A1C RID: 6684
|
|
[Token(Token = "0x4001A1C")]
|
|
private const int ASSET_REQUEST_HANDLING_RATE = 8;
|
|
}
|