Exemplo n.º 1
0
        public SpeechLine(int[] idArray, string _scene, string _text, int _languagues, AC_TextType _textType)
        {
            // Update id based on array
            lineID = 0;

            foreach (int _id in idArray)
            {
                if (lineID == _id)
                {
                    lineID++;
                }
            }

            scene       = _scene;
            owner       = "";
            text        = _text;
            textType    = _textType;
            description = "";
            isPlayer    = false;

            translationText = new List <string>();
            for (int i = 0; i < _languagues; i++)
            {
                translationText.Add(_text);
            }
        }
Exemplo n.º 2
0
        /**
         * A constructor for speech text in which a unique ID number is assigned based on an array of already-used values.
         */
        public SpeechLine(int[] idArray, string _scene, string _owner, string _text, int _languagues, AC_TextType _textType, bool _isPlayer = false)
        {
            // Update id based on array
            lineID = 0;
            foreach (int _id in idArray)
            {
                if (lineID == _id)
                {
                    lineID++;
                }
            }

            scene                         = _scene;
            owner                         = _owner;
            text                          = _text;
            description                   = "";
            textType                      = _textType;
            isPlayer                      = _isPlayer;
            customAudioClip               = null;
            customLipsyncFile             = null;
            customTranslationAudioClips   = new List <AudioClip>();
            customTranslationLipsyncFiles = new List <TextAsset>();

            translationText = new List <string>();
            for (int i = 0; i < _languagues; i++)
            {
                translationText.Add(_text);
            }
        }
        /**
         * A constructor for speech text in which the ID number is explicitly defined.
         */
        public SpeechLine(int _id, string _scene, string _owner, string _text, int _languagues, AC_TextType _textType, bool _isPlayer)
        {
            lineID                        = _id;
            scene                         = _scene;
            owner                         = _owner;
            text                          = _text;
            textType                      = _textType;
            description                   = string.Empty;
            isPlayer                      = _isPlayer;
            customAudioClip               = null;
            customLipsyncFile             = null;
            customTranslationAudioClips   = new List <AudioClip>();
            customTranslationLipsyncFiles = new List <Object>();
            tagID                         = -1;

            translationText = new List <string>();
            for (int i = 0; i < _languagues; i++)
            {
                translationText.Add(_text);
            }

                        #if UNITY_EDITOR
            orderID     = -1;
            orderPrefix = string.Empty;
                        #endif
        }
Exemplo n.º 4
0
        private bool IsTextTypeFiltered(AC_TextType textType)
        {
            int s1          = (int)textType;
            int s1_modified = (int)Mathf.Pow(2f, (float)s1);
            int s2          = (int)textTypeFilters;

            return((s1_modified & s2) != 0);
        }
Exemplo n.º 5
0
 /**
  * <summary>Gets the translation of a line of text.</summary>
  * <param name = "originalText">The line in its original language.</param>
  * <param name = "_lineID">The translation ID number generated by SpeechManager's PopulateList() function</param>
  * <param name = "language">The index number of the language to return the line in, where 0 = the game's original language.</param>
  * <param name = "textType">The type of text to translatable.</param>
  * <returns>The translation of the line, if it exists. If a translation does not exist, or the given textType is not translatable, then the original line will be returned.</returns>
  */
 public string GetTranslation(string originalText, int _lineID, int language, AC_TextType textType)
 {
     if (KickStarter.speechManager == null || KickStarter.speechManager.IsTextTypeTranslatable(textType))
     {
         return(GetTranslation(originalText, _lineID, language));
     }
     return(originalText);
 }
Exemplo n.º 6
0
		public SpeechLine ()
		{
			lineID = 0;
			scene = "";
			owner = "";
			text = "";
			translationText = new List<string> ();
			textType = AC_TextType.Speech;
		}
Exemplo n.º 7
0
 public SpeechLine()
 {
     lineID = 0;
     scene = "";
     owner = "";
     text = "";
     description = "";
     isPlayer = false;
     translationText = new List<string> ();
     textType = AC_TextType.Speech;
 }
Exemplo n.º 8
0
 public SpeechLine()
 {
     lineID          = 0;
     scene           = "";
     owner           = "";
     text            = "";
     description     = "";
     isPlayer        = false;
     translationText = new List <string> ();
     textType        = AC_TextType.Speech;
 }
Exemplo n.º 9
0
		public SpeechLine (int _id, string _scene, string _text, int _languagues, AC_TextType _textType)
		{
			lineID = _id;
			scene = _scene;
			owner = "";
			text = _text;
			textType = _textType;
			
			translationText = new List<string>();
			for (int i=0; i<_languagues; i++)
			{
				translationText.Add (_text);
			}
		}
Exemplo n.º 10
0
 /**
  * A Constructor that copies all values from another SpeechLine.
  * This way ensures that no connection remains to the original class.
  */
 public SpeechLine(SpeechLine _speechLine)
 {
     isPlayer                      = _speechLine.isPlayer;
     lineID                        = _speechLine.lineID;
     scene                         = _speechLine.scene;
     owner                         = _speechLine.owner;
     text                          = _speechLine.text;
     description                   = _speechLine.description;
     textType                      = _speechLine.textType;
     translationText               = _speechLine.translationText;
     customAudioClip               = _speechLine.customAudioClip;
     customLipsyncFile             = _speechLine.customLipsyncFile;
     customTranslationAudioClips   = _speechLine.customTranslationAudioClips;
     customTranslationLipsyncFiles = _speechLine.customTranslationLipsyncFiles;
 }
Exemplo n.º 11
0
        public SpeechLine(int _id, string _scene, string _text, int _languagues, AC_TextType _textType)
        {
            lineID      = _id;
            scene       = _scene;
            owner       = "";
            text        = _text;
            textType    = _textType;
            description = "";
            isPlayer    = false;

            translationText = new List <string>();
            for (int i = 0; i < _languagues; i++)
            {
                translationText.Add(_text);
            }
        }
Exemplo n.º 12
0
        /**
         * A constructor for non-speech text in which the ID number is explicitly defined.
         */
        public SpeechLine(int _id, string _scene, string _text, int _languagues, AC_TextType _textType)
        {
            lineID = _id;
            scene = _scene;
            owner = "";
            text = _text;
            textType = _textType;
            description = "";
            isPlayer = false;
            customAudioClip = null;
            customLipsyncFile = null;
            customTranslationAudioClips = new List<AudioClip>();
            customTranslationLipsyncFiles = new List<TextAsset>();

            translationText = new List<string>();
            for (int i=0; i<_languagues; i++)
            {
                translationText.Add (_text);
            }
        }
Exemplo n.º 13
0
        /**
         * A constructor for non-speech text in which the ID number is explicitly defined.
         */
        public SpeechLine(int _id, string _scene, string _text, int _languagues, AC_TextType _textType)
        {
            lineID                        = _id;
            scene                         = _scene;
            owner                         = "";
            text                          = _text;
            textType                      = _textType;
            description                   = "";
            isPlayer                      = false;
            customAudioClip               = null;
            customLipsyncFile             = null;
            customTranslationAudioClips   = new List <AudioClip>();
            customTranslationLipsyncFiles = new List <TextAsset>();

            translationText = new List <string>();
            for (int i = 0; i < _languagues; i++)
            {
                translationText.Add(_text);
            }
        }
        public SpeechLine(SpeechLine _speechLine, int voiceLanguage)
        {
            isPlayer                      = _speechLine.isPlayer;
            lineID                        = _speechLine.lineID;
            scene                         = _speechLine.scene;
            owner                         = _speechLine.owner;
            text                          = _speechLine.text;
            description                   = _speechLine.description;
            textType                      = _speechLine.textType;
            translationText               = _speechLine.translationText;
            customAudioClip               = (voiceLanguage == 0 || KickStarter.speechManager.fallbackAudio) ? _speechLine.customAudioClip : null;
            customLipsyncFile             = (voiceLanguage == 0 || KickStarter.speechManager.fallbackAudio) ? _speechLine.customLipsyncFile : null;
            customTranslationAudioClips   = GetAudioListForTranslation(_speechLine.customTranslationAudioClips, voiceLanguage);
            customTranslationLipsyncFiles = GetLipsyncListForTranslation(_speechLine.customTranslationLipsyncFiles, voiceLanguage);
            tagID                         = _speechLine.tagID;

                        #if UNITY_EDITOR
            orderID     = _speechLine.orderID;
            orderPrefix = _speechLine.orderPrefix;
                        #endif
        }
        /**
         * A Constructor that copies all values from another SpeechLine.
         * This way ensures that no connection remains to the original class.
         */
        public SpeechLine(SpeechLine _speechLine)
        {
            isPlayer                      = _speechLine.isPlayer;
            lineID                        = _speechLine.lineID;
            scene                         = _speechLine.scene;
            owner                         = _speechLine.owner;
            text                          = _speechLine.text;
            description                   = _speechLine.description;
            textType                      = _speechLine.textType;
            translationText               = _speechLine.translationText;
            customAudioClip               = _speechLine.customAudioClip;
            customLipsyncFile             = _speechLine.customLipsyncFile;
            customTranslationAudioClips   = _speechLine.customTranslationAudioClips;
            customTranslationLipsyncFiles = _speechLine.customTranslationLipsyncFiles;
            tagID                         = _speechLine.tagID;

                        #if UNITY_EDITOR
            orderID     = _speechLine.orderID;
            orderPrefix = _speechLine.orderPrefix;
                        #endif
        }
Exemplo n.º 16
0
		public SpeechLine (int[] idArray, string _scene, string _text, int _languagues, AC_TextType _textType)
		{
			// Update id based on array
			lineID = 0;

			foreach (int _id in idArray)
			{
				if (lineID == _id)
					lineID ++;
			}

			scene = _scene;
			owner = "";
			text = _text;
			textType = _textType;
			
			translationText = new List<string>();
			for (int i=0; i<_languagues; i++)
			{
				translationText.Add (_text);
			}
		}
Exemplo n.º 17
0
 /**
  * A Constructor that copies all values from another SpeechLine.
  * This way ensures that no connection remains to the original class.
  */
 public SpeechLine(SpeechLine _speechLine)
 {
     isPlayer = _speechLine.isPlayer;
     lineID = _speechLine.lineID;
     scene = _speechLine.scene;
     owner = _speechLine.owner;
     text = _speechLine.text;
     description = _speechLine.description;
     textType = _speechLine.textType;
     translationText = _speechLine.translationText;
 }
Exemplo n.º 18
0
        /**
         * A constructor for speech text in which the ID number is explicitly defined.
         */
        public SpeechLine(int _id, string _scene, string _owner, string _text, int _languagues, AC_TextType _textType, bool _isPlayer = false)
        {
            lineID = _id;
            scene = _scene;
            owner = _owner;
            text = _text;
            textType = _textType;
            description = "";
            isPlayer = _isPlayer;

            translationText = new List<string>();
            for (int i=0; i<_languagues; i++)
            {
                translationText.Add (_text);
            }
        }
Exemplo n.º 19
0
        /**
         * A constructor for speech text in which a unique ID number is assigned based on an array of already-used values.
         */
        public SpeechLine(int[] idArray, string _scene, string _owner, string _text, int _languagues, AC_TextType _textType,  bool _isPlayer = false)
        {
            // Update id based on array
            lineID = 0;
            foreach (int _id in idArray)
            {
                if (lineID == _id)
                    lineID ++;
            }

            scene = _scene;
            owner = _owner;
            text = _text;
            description = "";
            textType = _textType;
            isPlayer = _isPlayer;
            customAudioClip = null;
            customLipsyncFile = null;
            customTranslationAudioClips = new List<AudioClip>();
            customTranslationLipsyncFiles = new List<TextAsset>();

            translationText = new List<string>();
            for (int i=0; i<_languagues; i++)
            {
                translationText.Add (_text);
            }
        }
Exemplo n.º 20
0
 /**
  * A Constructor that copies all values from another SpeechLine.
  * This way ensures that no connection remains to the original class.
  */
 public SpeechLine(SpeechLine _speechLine)
 {
     isPlayer = _speechLine.isPlayer;
     lineID = _speechLine.lineID;
     scene = _speechLine.scene;
     owner = _speechLine.owner;
     text = _speechLine.text;
     description = _speechLine.description;
     textType = _speechLine.textType;
     translationText = _speechLine.translationText;
     customAudioClip = _speechLine.customAudioClip;
     customLipsyncFile = _speechLine.customLipsyncFile;
     customTranslationAudioClips = _speechLine.customTranslationAudioClips;
     customTranslationLipsyncFiles = _speechLine.customTranslationLipsyncFiles;
 }
Exemplo n.º 21
0
        private void ShowRowsGUI()
        {
            EditorGUILayout.LabelField("Row filtering", CustomStyles.subHeader);
            EditorGUILayout.Space();

            filterByType = EditorGUILayout.Toggle("Filter by type?", filterByType);
            if (filterByType)
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("-> Limit to type:", GUILayout.Width(100f));
                typeFilter = (AC_TextType)EditorGUILayout.EnumPopup(typeFilter);
                EditorGUILayout.EndHorizontal();
            }

            filterByScene = EditorGUILayout.Toggle("Filter by scene?", filterByScene);
            if (filterByScene)
            {
                string[] sceneNames = speechManager.GetSceneNames();
                if (sceneNames != null && sceneNames.Length > 0)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("-> Limit to scene:", GUILayout.Width(100f));
                    sceneFilter = EditorGUILayout.Popup(sceneFilter, sceneNames);
                    EditorGUILayout.EndHorizontal();
                }
            }

            filterByText = EditorGUILayout.Toggle("Filter by text:", filterByText);
            if (filterByText)
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("-> Limit to text:", GUILayout.Width(100f));
                filterSpeechLine = (FilterSpeechLine)EditorGUILayout.EnumPopup(filterSpeechLine, GUILayout.MaxWidth(100f));
                textFilter       = EditorGUILayout.TextField(textFilter);
                EditorGUILayout.EndHorizontal();
            }

            filterByTag = EditorGUILayout.Toggle("Filter by tag:", filterByTag);
            if (filterByTag)
            {
                if (typeFilter == AC_TextType.Speech && speechManager.useSpeechTags && speechManager.speechTags != null && speechManager.speechTags.Count > 1)
                {
                    if (tagFilter == -1)
                    {
                        tagFilter = 0;
                    }

                    List <string> tagNames = new List <string>();
                    foreach (SpeechTag speechTag in speechManager.speechTags)
                    {
                        tagNames.Add(speechTag.label);
                    }

                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("-> Limit by tag:", GUILayout.Width(65f));
                    tagFilter = EditorGUILayout.Popup(tagFilter, tagNames.ToArray());
                    EditorGUILayout.EndHorizontal();
                }
                else
                {
                    tagFilter = -1;
                    EditorGUILayout.HelpBox("No tags defined - they can be created by clicking 'Edit speech tags' in the Speech Manager.", MessageType.Info);
                }
            }

            EditorGUILayout.Space();
        }