Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 0432c6d

Browse files
committed
3.1.5
* Integrate PR from js6pak
1 parent 8c34aa2 commit 0432c6d

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,13 @@
5050
0. Install [BepInEx](https://github.com/BepInEx/BepInEx) for your game.
5151
1. Download the UnityExplorer release for BepInEx IL2CPP or Mono above.
5252
2. Take the `UnityExplorer.BIE.___.dll` file and put it in `[GameFolder]\BepInEx\plugins\`
53-
3. Take the `UnityExplorer\` folder (with `explorerui.bundle`) and put it in `[GameFolder]\Mods\`, so it looks like `[GameFolder]\Mods\UnityExplorer\explorerui.bundle`.
54-
4. In IL2CPP, it is highly recommended to get the base Unity libs for the game's Unity version and put them in the `BepInEx\unhollowed\base\` folder.
53+
3. In IL2CPP, it is highly recommended to get the base Unity libs for the game's Unity version and put them in the `BepInEx\unhollowed\base\` folder.
5554

5655
### MelonLoader
5756

5857
0. Install [MelonLoader](https://github.com/HerpDerpinstine/MelonLoader) for your game.
5958
1. Download the UnityExplorer release for MelonLoader IL2CPP or Mono above.
60-
2. Take the contents of the release and put it in the `[GameFolder]\Mods\` folder. It should look like `[GameFolder]\Mods\UnityExplorer.ML.___.dll` and `[GameFolder]\Mods\UnityExplorer\explorerui.bundle`.
59+
2. Take the contents of the release and put it in the `[GameFolder]\Mods\` folder. It should look like `[GameFolder]\Mods\UnityExplorer.ML.___.dll`
6160

6261
## Mod Config
6362

src/ExplorerCore.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.IO;
3-
using BepInEx;
43
using UnityEngine;
54
using UnityEngine.SceneManagement;
65
using UnityExplorer.Config;
@@ -17,14 +16,14 @@ namespace UnityExplorer
1716
public class ExplorerCore
1817
{
1918
public const string NAME = "UnityExplorer";
20-
public const string VERSION = "3.1.4";
19+
public const string VERSION = "3.1.5";
2120
public const string AUTHOR = "Sinai";
2221
public const string GUID = "com.sinai.unityexplorer";
2322

2423
#if ML
2524
public const string EXPLORER_FOLDER = @"Mods\UnityExplorer";
2625
#elif BIE
27-
public static string EXPLORER_FOLDER = Path.Combine(Paths.ConfigPath, "UnityExplorer");
26+
public static string EXPLORER_FOLDER = Path.Combine(BepInEx.Paths.ConfigPath, "UnityExplorer");
2827
#endif
2928

3029
public static ExplorerCore Instance { get; private set; }

src/Helpers/Texture2DHelpers.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ public static Texture2D Copy(Texture2D orig, Rect rect)
7171
pixels = orig.GetPixels((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
7272

7373
// use full constructor for better compatibility
74+
#if CPP
7475
var _newTex = new Texture2D((int)rect.width, (int)rect.height, TextureFormat.RGBA32, Texture.GenerateAllMips, false, IntPtr.Zero);
76+
#else
77+
var _newTex = new Texture2D((int)rect.width, (int)rect.height);
78+
#endif
7579
_newTex.SetPixels(pixels);
7680

7781
return _newTex;

src/UI/UIManager.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,24 @@ public static void Update()
8888
}
8989
}
9090

91+
private static AssetBundle LoadExplorerUi(string id)
92+
{
93+
return AssetBundle.LoadFromMemory(ReadFully(typeof(ExplorerCore).Assembly.GetManifestResourceStream($"UnityExplorer.Resources.explorerui.{id}.bundle")));
94+
}
95+
9196
private static byte[] ReadFully(this Stream input)
9297
{
9398
using (var ms = new MemoryStream())
9499
{
95-
input.CopyTo(ms);
100+
byte[] buffer = new byte[81920];
101+
int read;
102+
while ((read = input.Read(buffer, 0, buffer.Length)) != 0)
103+
ms.Write(buffer, 0, read);
104+
96105
return ms.ToArray();
97106
}
98107
}
99108

100-
private static AssetBundle LoadExplorerUi(string id)
101-
{
102-
return AssetBundle.LoadFromMemory(ReadFully(typeof(ExplorerCore).Assembly.GetManifestResourceStream($"UnityExplorer.Resources.explorerui.{id}.bundle")));
103-
}
104-
105109
private static void LoadBundle()
106110
{
107111
AssetBundle bundle = null;

0 commit comments

Comments
 (0)