Add instance reference to Main and update asset bundle loading in PrefabManager
This commit is contained in:
3
Main.cs
3
Main.cs
@@ -49,6 +49,7 @@ namespace KCM
|
|||||||
{
|
{
|
||||||
public class Main : MonoBehaviour
|
public class Main : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public static Main instance;
|
||||||
public static KCModHelper helper;
|
public static KCModHelper helper;
|
||||||
public static MenuState menuState = (MenuState)MainMenuMode.State.Uninitialized;
|
public static MenuState menuState = (MenuState)MainMenuMode.State.Uninitialized;
|
||||||
|
|
||||||
@@ -229,6 +230,8 @@ namespace KCM
|
|||||||
|
|
||||||
private void Preload(KCModHelper helper)
|
private void Preload(KCModHelper helper)
|
||||||
{
|
{
|
||||||
|
instance = this;
|
||||||
|
|
||||||
helper.Log("Preload start in main");
|
helper.Log("Preload start in main");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ namespace KCM
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
assetBundle = helper.LoadAssetBundle(helper.modPath, "serverbrowserpkg");
|
// LoadAssetBundle is a static method, so we call it on the class, not the instance.
|
||||||
|
// We pass the modPath from the helper instance we have.
|
||||||
|
assetBundle = KCModHelper.LoadAssetBundle(helper.modPath, "serverbrowserpkg");
|
||||||
|
|
||||||
if (assetBundle == null)
|
if (assetBundle == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user