Code updates
This commit is contained in:
parent
a430310324
commit
393de5e06a
14 changed files with 216 additions and 31 deletions
21
Patches/MainMenuManager_Awake_Patch.cs
Normal file
21
Patches/MainMenuManager_Awake_Patch.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using HarmonyLib;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SpacemarketSimulator.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(MainMenuManager), "Awake")]
|
||||
public static class MainMenuManager_Awake_Patch
|
||||
{
|
||||
public static void Postfix(MainMenuManager __instance)
|
||||
{
|
||||
var bg = new Texture2D(1920, 1080);
|
||||
bg.LoadImage(Properties.Resources.bg);
|
||||
var image = __instance.gameObject.transform.GetChild(0).gameObject.GetComponent<Image>();
|
||||
Console.WriteLine(image == null);
|
||||
image.sprite = Sprite.Create(bg, new Rect(0, 0, bg.width, bg.height), new Vector2(0.5f, 0.5f)); ;
|
||||
__instance.gameObject.transform.GetChild(1).gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue