Пример #1
0
        private void Awake()
        {
            // Set the maximum number of simultaneous tweens
            LeanTween.init(30000);

            _navigation  = GameObject.FindGameObjectWithTag("Navigation").GetComponent <NavigationScript>();
            _moveDisplay = GameObject.FindGameObjectWithTag("MoveDisplay").GetComponent <MoveDisplay>();
            _gameAudio   = GameObject.FindGameObjectWithTag("GameAudio").GetComponent <GameAudio>();

            // Set the game's strings to their localized versions
            var language = Levels.CurrentLanguage;

            if (language.Equals("default"))
            {
                return;
            }

            try {
                var map = new Dictionary <string, string> {
                    ["MusicToggleText"] = "music",
                    ["SfxToggleText"]   = "sfx",
                    ["CreditText"]      = "credit",
                    ["VersionText"]     = "version"
                };

                foreach (var entry in map)
                {
                    var textDisplay = GameObject.FindGameObjectWithTag(entry.Key).GetComponent <Text>();
                    textDisplay.text = Levels.Localization[language][entry.Value];
                }
            } catch (Exception e) {
                Debug.LogWarning("Failed to apply localization for " + language + "\n" + e);
            }
        }
Пример #2
0
        private void Awake()
        {
            // Set the maximum number of simultaneous tweens
            LeanTween.init(30000);

            _navigation  = GameObject.FindGameObjectWithTag("Navigation").GetComponent <NavigationScript>();
            _moveDisplay = GameObject.FindGameObjectWithTag("MoveDisplay").GetComponent <MoveDisplay>();
            _gameAudio   = GameObject.FindGameObjectWithTag("GameAudio").GetComponent <GameAudio>();
        }