While you already seem to have solved your problem, I’m leaving an answer to clarify things a little bit. When you write code like the following:
public static void Initialize()
{
int admin_gold = 1000;
}
The variable admin_gold is only usable inside that function. When Initialize() is finished, that variable effectively disappears. That’s because all variables have what’s called a Scope, that determines where they can be accessed from and how long they exist for.
You weren’t wrong thinking that you should be able to access your variables by calling LevelManager.admin_gold, the only problem was that the variables were defined in the wrong place. For you to be able to access those variables like that, your code should have looked like this:
public class LevelManager
{
public static int admin_gold;
public static int admin1_gold;
public static void Initialize()
{
admin_gold = 1000;
admin1_gold = 5000;
}
}
The only difference is that now those variables live in the LevelManager class, not the Initialize method. You can now access and assign values to those variables from anywhere else in your game using LevelManager.admin_gold, just make sure that you call LevelManager.Initialize() before you try to access them!