Skip to content

Commit

Permalink
Added manually initialize cheats module api.
Browse files Browse the repository at this point in the history
  • Loading branch information
wanakubwa committed Mar 18, 2023
1 parent e9ab92c commit 83dedda
Showing 1 changed file with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ private KeyCode TriggerKey
set;
}

private bool OneClick { get; set; } = false;
private float TimerForDoubleClick { get; set; }
private float DoubleClickDelay { get; set; } = 0.2f;

#endregion


Expand Down Expand Up @@ -95,6 +91,29 @@ private static void AutoInitialize()
}
}

public static void InitializeManually()
{
// BOB was initialized before.
if (Instance != null)
{
Debug.LogWarning("[BOBCheats] Is already initialized check your code!");
return;
}

GameObject go = new GameObject("BOBCheatManager");
BOBCheatsManager bob = go.AddComponent<BOBCheatsManager>();

GameObject cheatsMenuObj = Resources.Load("GUI/BOBCheatsGUI") as GameObject;
GameObject cheatsDesktopMenuObj = Resources.Load("GUI/BOBCheatsGUI_Desktop") as GameObject;

bob.CheatMenuGUIPrefab = cheatsMenuObj.GetComponent<CheatsMenuController>();
bob.cheatDesktopMenuGUIPrefab = cheatsDesktopMenuObj.GetComponent<CheatsMenuController>();

GameObject.DontDestroyOnLoad(go);

Debug.Log("[BOBCheats] Manually initialized!");
}

public void ToggleCheatMenuGUI()
{
if (CurrentCheatGUI != null)
Expand Down

0 comments on commit 83dedda

Please sign in to comment.