Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Removed unneeded icon loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Korty (Lily) committed Jun 20, 2021
1 parent b18892b commit 06d3797
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Resources/ResourceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace AMMusic.Resources
class ResourceManager
{
static AssetBundle Bundle;
public static Texture2D Menu, Play, Pause, Next, Back, VolUp, VolDown, VolMute;
public static Texture2D Menu, Play, Next, Back, VolUp, VolDown, VolMute;

static Texture2D LoadTexture(string Texture)
{
Expand All @@ -31,15 +31,12 @@ public static IEnumerator LoadResources()
{
// Came from UIExpansionKit (https://github.com/knah/VRCMods/blob/master/UIExpansionKit)
MelonLogger.Msg("Loading AssetBundle...");
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AMMusic.Resources.ammusic.lily"))
{
using (var memoryStream = new MemoryStream((int)stream.Length))
{
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AMMusic.Resources.ammusic.lily")) {
using (var memoryStream = new MemoryStream((int)stream.Length)) {
stream.CopyTo(memoryStream);
Bundle = AssetBundle.LoadFromMemory_Internal(memoryStream.ToArray(), 0);
try { Menu = LoadTexture("Menu.png"); } catch { MelonLogger.Error("Failed to load image from asset bundle: Menu"); }
try { Play = LoadTexture("Play.png"); } catch { MelonLogger.Error("Failed to load image from asset bundle: Play"); }
try { Pause = LoadTexture("Pause.png"); } catch { MelonLogger.Error("Failed to load image from asset bundle: Pause"); }
try { Next = LoadTexture("Foward.png"); } catch { MelonLogger.Error("Failed to load image from asset bundle: Foward"); }
try { Back = LoadTexture("Back.png"); } catch { MelonLogger.Error("Failed to load image from asset bundle: Back"); }
try { VolUp = LoadTexture("VolUp.png"); } catch { MelonLogger.Error("Failed to load image from asset bundle: VolUp"); }
Expand Down

0 comments on commit 06d3797

Please sign in to comment.