Beispiel #1
0
        public string GetQuestion(Language _targetLanguage)
        {
            SO_LanguageBasedString desiredLBS = null;

            desiredLBS = question.GetLanguageBasedString(_targetLanguage, this.name);
            return(desiredLBS.text);
        }
        [SerializeField] private List <SO_LanguageBasedString> languageBasedStrings_Lst;         // LBSs

        public SO_LanguageBasedString GetLanguageBasedString(Language _desiredLanguage, string _callerName)
        {
            SO_LanguageBasedString returnLBS = null;

            if (SO_LanguageBasedString.CheckListIntegrity(languageBasedStrings_Lst, _desiredLanguage, _callerName))
            {
                foreach (SO_LanguageBasedString LBS in languageBasedStrings_Lst)
                {
                    if (LBS.language == _desiredLanguage)
                    {
                        returnLBS = LBS;
                        break;
                    }
                }
            }
            else
            {
                return(null);
            }

            if (returnLBS)
            {
                return(returnLBS);
            }
            else
            {
                Debug.LogError("No LBS defined with the required language");
                return(null);
            }
        }
Beispiel #3
0
        public string GetSpeachBody(Language _targetLanguage)
        {
            SO_LanguageBasedString desiredLBS = null;

            desiredLBS = body.GetLanguageBasedString(_targetLanguage, this.name);

            return(desiredLBS.text);
        }
Beispiel #4
0
        public string GetAnswerBody(Language _targetLanguage)
        {
            /*
             * if (LanguageBasedString.CheckListIntegrity(answers,_targetLanguage,this.name))
             * {
             *  for (int i = 0; i < answers.Count; i++)
             *  {
             *      if (answers[i].language == _targetLanguage)
             *          return answers[i].text;
             *  }
             * }
             * return null;
             */

            SO_LanguageBasedString desiredLBS = null;

            desiredLBS = answer.GetLanguageBasedString(_targetLanguage, this.name);
            return(desiredLBS.text);
        }
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            SO_LanguageBasedString stringObject = target as SO_LanguageBasedString;


            if (stringObject.language is Language.NONE)
            {
                stringObject.Usable = false;

                helpMesage = "The object " + stringObject.name + " does not have a language defined : LANGUAGE = " + stringObject.language;

                EditorGUILayout.HelpBox(helpMesage, MessageType.Warning, true);
            }
            else
            {
                stringObject.Usable = true;
            }
        }