Exemple #1
0
        private string GetOptionLabel(int index)
        {
                        #if UNITY_EDITOR
            if (!Application.isPlaying && cycleType == AC_CycleType.Language)
            {
                optionsArray = AdvGame.GetReferences().speechManager.languages;
            }
                        #endif

            if (index >= 0 && index < GetNumOptions())
            {
                if (cycleType == AC_CycleType.Variable && linkedVariable != null && linkedVariable.type == VariableType.PopUp)
                {
                    return(linkedVariable.GetPopUpForIndex(index, Options.GetLanguage()));
                }
                return(optionsArray [index]);
            }

            if (Application.isPlaying)
            {
                ACDebug.Log("Could not gather options for MenuCycle " + label);
                return(string.Empty);
            }
            return("Default option");
        }
        /**
         * <summary>Returns the value of a global Popup variable.</summary>
         * <param name = "_id">The ID number of the variable</param>
         * <param name = "synchronise">If True, then the variable's value will be synchronised with any external link it may have.</param>
         * <param name = "languageNumber">The index number of the game's current language</param>
         * <returns>The string value of the variable</returns>
         */
        public static string GetPopupValue(int _id, bool synchronise = true, int languageNumber = 0)
        {
            GVar var = GetVariable(_id, synchronise);

            if (var != null)
            {
                return(var.GetPopUpForIndex(var.val, languageNumber));
            }

            ACDebug.LogWarning("Variable with ID=" + _id + " not found!");
            return(string.Empty);
        }