- Home /
Game-wide Variables
So on my project there will be an options menu where you will be able to select things like language. When I change the language from, for example English to french, how to I change a variable that says the language is now this, so play the music language instead of this one?
Answer by getyour411 · Mar 25, 2014 at 10:32 PM
localization is a discipline beyond the scope to cover in this space. In general though, "game-wide" could be something you declare as static and not necessarily inherit from Mono. A class might have
class myGameWideClass
public static string currentLanguage
which any class/script could read from and use with
myGameWideClass.currentLanguage
without needing to establish a GetComponent reference.
Your answer
Follow this Question
Related Questions
Why did my Transform Component stop using degrees for rotation 2 Answers
How can I stop the variable values reverting to its default values after being built? 1 Answer
How to call variable from java script to c# Script? :( 2 Answers
Assigning/accessing different scripts from the same spot in another script 1 Answer
How to declare multiple variables using a for loop in class declaration? 0 Answers