Commit 9fce4727b42e0f30cc7db299474be670d0d043c8
1 parent
1f82cfb4
Exists in
master
and in
3 other branches
Fix invalid characters search on trie [ExportVideo-issue]
Showing
4 changed files
with
80 additions
and
104 deletions
Show diff stats
Assets/Scenes/Main.unity
... | ... | @@ -3478,53 +3478,53 @@ Animation: |
3478 | 3478 | m_GameObject: {fileID: 535548070} |
3479 | 3479 | m_Enabled: 1 |
3480 | 3480 | serializedVersion: 3 |
3481 | - m_Animation: {fileID: 7400000, guid: de64c0fa1d9645d49b708f1d83901ea4, type: 2} | |
3481 | + m_Animation: {fileID: 7400000, guid: d7ed17c702b9a5f429a0d0f911deb512, type: 2} | |
3482 | 3482 | m_Animations: |
3483 | - - {fileID: 7400000, guid: 1dd9ca1ea9832c84f925d6966514ea10, type: 2} | |
3484 | - - {fileID: 7400000, guid: 1f00c2efd7d952948a095cc7b244b3da, type: 2} | |
3485 | - - {fileID: 7400000, guid: 21546d4c40c79c444a3433872ae02f47, type: 2} | |
3486 | - - {fileID: 7400000, guid: 307688a214159614c986c4eef2fdd3ca, type: 2} | |
3487 | - - {fileID: 7400000, guid: 31afcc1709953c841ad6830467719274, type: 2} | |
3488 | - - {fileID: 7400000, guid: 32f5f26286dce6c4c8adc4db846b2917, type: 2} | |
3489 | - - {fileID: 7400000, guid: 347a80b2751fdec43bd370644d77d715, type: 2} | |
3490 | - - {fileID: 7400000, guid: 45ebce76c19794a4db997ddc0dfb9cef, type: 2} | |
3491 | - - {fileID: 7400000, guid: 4ccd911b507228142bd1af00f3ff7951, type: 2} | |
3492 | - - {fileID: 7400000, guid: 58b910c043caf62448498305d225147e, type: 2} | |
3493 | - - {fileID: 7400000, guid: 5ad0a39b27f863146a9190c7da98a869, type: 2} | |
3494 | - - {fileID: 7400000, guid: 6256158aa94c1024aa0d3df8c189a45c, type: 2} | |
3495 | - - {fileID: 7400000, guid: 67e0074be207cda4f9b1659e5804e150, type: 2} | |
3496 | - - {fileID: 7400000, guid: 6a9ef1c3d9c5c1d43b12e4666a60ce1b, type: 2} | |
3497 | - - {fileID: 7400000, guid: 7057c403ed5c03647999c2d733853f09, type: 2} | |
3498 | - - {fileID: 7400000, guid: 71de1b41e3743564caa444f671f788bd, type: 2} | |
3499 | - - {fileID: 7400000, guid: 7cc44263843fba34a80de9b8c4237cf2, type: 2} | |
3500 | - - {fileID: 7400000, guid: 8aa7f1df5e160b64697225307d6a7f40, type: 2} | |
3501 | - - {fileID: 7400000, guid: 90c5138976138a24aabc9adcd845d4e2, type: 2} | |
3502 | - - {fileID: 7400000, guid: 9467d12da5bf1ac4f968f30a559719a6, type: 2} | |
3503 | - - {fileID: 7400000, guid: 9a1503120426eb045a4183eb8e19a667, type: 2} | |
3504 | - - {fileID: 7400000, guid: a06c83cfdce1bd94f9d45389bd7c7be2, type: 2} | |
3505 | - - {fileID: 7400000, guid: a1a06509f94157f48bb98e6ca1ad3292, type: 2} | |
3506 | - - {fileID: 7400000, guid: a59244a17ccb8244d8756e172607e1c6, type: 2} | |
3507 | - - {fileID: 7400000, guid: b9c4bda4be1638342bf1771c0b1e7248, type: 2} | |
3508 | - - {fileID: 7400000, guid: c0b938d84bc5252489e705f3cd08b759, type: 2} | |
3509 | - - {fileID: 7400000, guid: c3a729bc8a27a6947b9112e2f6346b65, type: 2} | |
3510 | - - {fileID: 7400000, guid: c4958f5087108484b8f543ce9e996370, type: 2} | |
3511 | - - {fileID: 7400000, guid: c6c86b24b4fb40b47b26ea516e19faa9, type: 2} | |
3512 | - - {fileID: 7400000, guid: c993e3be9ca60ee4ca7b15f37a7fcd2a, type: 2} | |
3513 | - - {fileID: 7400000, guid: ca40f58313f31424d9fd1769a3e5774a, type: 2} | |
3514 | - - {fileID: 7400000, guid: d74f71708ac46db419d4c522777a345d, type: 2} | |
3515 | - - {fileID: 7400000, guid: de64c0fa1d9645d49b708f1d83901ea4, type: 2} | |
3516 | - - {fileID: 7400000, guid: e32fe46e8cffaeb4cb6a62f978c1b410, type: 2} | |
3517 | - - {fileID: 7400000, guid: eb705a803d7fb8640a867411fd800c66, type: 2} | |
3518 | - - {fileID: 7400000, guid: ed1db151ae8c10c49b18540f872c0c5c, type: 2} | |
3519 | - - {fileID: 7400000, guid: ef2cb27aa8cdde54381352d2bcca99f0, type: 2} | |
3520 | - - {fileID: 7400000, guid: f0543498cd1a2c341892821659fe80ac, type: 2} | |
3521 | - - {fileID: 7400000, guid: f171712ad3e7fe74e971317bb3e32097, type: 2} | |
3522 | - - {fileID: 7400000, guid: f19b2078601165740871780ee356923d, type: 2} | |
3523 | - - {fileID: 7400000, guid: f56dcc9eabf6dde4bb77cb3825dc562e, type: 2} | |
3524 | - - {fileID: 7400000, guid: f876b4a97f1ac934594d6a710a840b03, type: 2} | |
3525 | - - {fileID: 7400000, guid: f8b9421c26ef3dc46b80b9c26707bc84, type: 2} | |
3526 | - - {fileID: 7400000, guid: fcf62432db0b0b446bf621b6b707e0ab, type: 2} | |
3527 | - - {fileID: 7400000, guid: fd7ba644b8685174fb0f9b382297c7ad, type: 2} | |
3483 | + - {fileID: 7400000, guid: c3116900301035d4d9ab965355a7d2da, type: 2} | |
3484 | + - {fileID: 7400000, guid: bbc708a006c53b247950ec8d5e9d13ca, type: 2} | |
3485 | + - {fileID: 7400000, guid: 41aad2b17985ec44f950327c98de3a61, type: 2} | |
3486 | + - {fileID: 7400000, guid: 1bcb5872b8a9bfd4f99715b6b9a30ed1, type: 2} | |
3487 | + - {fileID: 7400000, guid: b8cd2882336a803428d076ed421784cc, type: 2} | |
3488 | + - {fileID: 7400000, guid: b9bc2da25c0a4bd4abce7e4102cc6840, type: 2} | |
3489 | + - {fileID: 7400000, guid: 435cc9d222543014c95bdb031557363c, type: 2} | |
3490 | + - {fileID: 7400000, guid: 81d578e216e55a74792ebd7ff24572a6, type: 2} | |
3491 | + - {fileID: 7400000, guid: e01ded23bec2edf4e993362444d0c9f3, type: 2} | |
3492 | + - {fileID: 7400000, guid: 2b852a34df329ad47ae0de994304272b, type: 2} | |
3493 | + - {fileID: 7400000, guid: e261cb657cadf544ab682441cdf6daa2, type: 2} | |
3494 | + - {fileID: 7400000, guid: 8171ffb55afebb248ae9dfec89dfa6d3, type: 2} | |
3495 | + - {fileID: 7400000, guid: c3ee01c5c4f7fa844b4cbff88640774a, type: 2} | |
3496 | + - {fileID: 7400000, guid: c89c2ac5fdcc7134e9fea639bfa0d3ee, type: 2} | |
3497 | + - {fileID: 7400000, guid: 827c0be57e23e654693b18e8be4b9aa6, type: 2} | |
3498 | + - {fileID: 7400000, guid: 5b096066f65f50543847312c860bdde0, type: 2} | |
3499 | + - {fileID: 7400000, guid: ee10f576fd52c224fbb94ef465f0eca9, type: 2} | |
3500 | + - {fileID: 7400000, guid: 0b8210c664cb429459b3b143ab958271, type: 2} | |
3501 | + - {fileID: 7400000, guid: 1d8184f650080c94f8eb61c051fa3068, type: 2} | |
3502 | + - {fileID: 7400000, guid: c5af08f6a6b63b64f97fa60213bae749, type: 2} | |
3503 | + - {fileID: 7400000, guid: 76ee87d8ead47e540a41e8f816214a19, type: 2} | |
3504 | + - {fileID: 7400000, guid: a2e5047999f55454a95de53a2576f181, type: 2} | |
3505 | + - {fileID: 7400000, guid: a2f76c1a91828fb42853b4dbcf0b883d, type: 2} | |
3506 | + - {fileID: 7400000, guid: 0966c5eae482c8e4c925ce47e1cc6b50, type: 2} | |
3507 | + - {fileID: 7400000, guid: 275f1dfa6460f8c4191e7b93826387c4, type: 2} | |
3508 | + - {fileID: 7400000, guid: c08d534bc615ee244a6e357018332fdb, type: 2} | |
3509 | + - {fileID: 7400000, guid: 8c7eb97b053e0854987a526faa03b12b, type: 2} | |
3510 | + - {fileID: 7400000, guid: 3bd4e3dbcfd03a643a9d714a4b878cd7, type: 2} | |
3511 | + - {fileID: 7400000, guid: f077ebeba29221b4592ba5e2cd4a008b, type: 2} | |
3512 | + - {fileID: 7400000, guid: b216803c06badb44ebd515779f3bcfbc, type: 2} | |
3513 | + - {fileID: 7400000, guid: 99acc6dc112fda943a2dcec036c68d9a, type: 2} | |
3514 | + - {fileID: 7400000, guid: a2fdbfdc90f3a2e4aafa769025f30bd8, type: 2} | |
3515 | + - {fileID: 7400000, guid: 34a9ee8dd38b0e74dbea96b7b2dffe60, type: 2} | |
3516 | + - {fileID: 7400000, guid: 029da2add803b0c44a3b2844b0aabf98, type: 2} | |
3517 | + - {fileID: 7400000, guid: 9a27c7adf2e14834fba322b71ec6d32d, type: 2} | |
3518 | + - {fileID: 7400000, guid: c3e17dadf693a9e4fac16a26cc85809d, type: 2} | |
3519 | + - {fileID: 7400000, guid: 41bb63bd8f199f747997bfc6866e1985, type: 2} | |
3520 | + - {fileID: 7400000, guid: 1bccc94e1444f2f43b6500725e036d99, type: 2} | |
3521 | + - {fileID: 7400000, guid: 92290e8e121f9aa42a8105896870497c, type: 2} | |
3522 | + - {fileID: 7400000, guid: c695109e70aa1eb46a341994fbe77947, type: 2} | |
3523 | + - {fileID: 7400000, guid: bc2299fe63314e14397f7ea049cc5813, type: 2} | |
3524 | + - {fileID: 7400000, guid: 4b04975fc39e6d1499f44e0de7ad5b51, type: 2} | |
3525 | + - {fileID: 7400000, guid: 6cffd5bfbb65bc740b10b09610162a79, type: 2} | |
3526 | + - {fileID: 7400000, guid: 07d58fffb535d124d8714c6a4504f95c, type: 2} | |
3527 | + - {fileID: 7400000, guid: d7ed17c702b9a5f429a0d0f911deb512, type: 2} | |
3528 | 3528 | m_WrapMode: 0 |
3529 | 3529 | m_PlayAutomatically: 1 |
3530 | 3530 | m_AnimatePhysics: 0 | ... | ... |
Assets/Scripts/Player Manager/GenericPlayerManager.cs
... | ... | @@ -78,6 +78,15 @@ public abstract class GenericPlayerManager : MonoBehaviour { |
78 | 78 | private Subtitle subtitles = null; |
79 | 79 | |
80 | 80 | private bool[] lastLetterAnimations = new bool[256]; |
81 | + | |
82 | + protected readonly HashSet<string> ValidLetters = new HashSet<string>() { | |
83 | + "A", "B", "C", "Ç", "D", "E", "F", "G", "H", | |
84 | + "I", "J", "K", "L", "M", "N", "O", "P", "Q", | |
85 | + "R", "S", "T", "U", "V", "W", "X", "Y", "Z", | |
86 | + "0", "1", "2", "3", "4", | |
87 | + "5", "6", "7", "8", "9", | |
88 | + "," | |
89 | + }; | |
81 | 90 | |
82 | 91 | public virtual void Start() |
83 | 92 | { |
... | ... | @@ -100,20 +109,11 @@ public abstract class GenericPlayerManager : MonoBehaviour { |
100 | 109 | foreach (string flag in flags) |
101 | 110 | this.flags.Add(flag); |
102 | 111 | |
103 | - string[] preloadedAnims = new string[] { | |
104 | - "A", "B", "C", "Ç", "D", "E", "F", "G", "H", "I", | |
105 | - "J", "K", "L", "M", "N", "O", "P", "Q", "R", | |
106 | - "S", "T", "U", "V", "W", "X", "Y", "Z", | |
107 | - "0", "1", "2", "3", "4", | |
108 | - "5", "6", "7", "8", "9", | |
109 | - "," | |
110 | - }; | |
111 | - | |
112 | 112 | // Duplica sinais para diferenciar quando há repetidos |
113 | - foreach (string anim in preloadedAnims) | |
113 | + foreach (string anim in this.ValidLetters) | |
114 | 114 | COMPONENT_ANIMATION.AddClip(COMPONENT_ANIMATION[anim].clip, "d_" + anim); |
115 | 115 | |
116 | - foreach (string anim in preloadedAnims) | |
116 | + foreach (string anim in this.ValidLetters) | |
117 | 117 | this.loadedAssetBundles.Add(anim); |
118 | 118 | |
119 | 119 | // Cria novo _default chamado _default_middle para pausas dentro de uma glosa |
... | ... | @@ -133,6 +133,10 @@ public abstract class GenericPlayerManager : MonoBehaviour { |
133 | 133 | this.subtitles.setText(text); |
134 | 134 | } |
135 | 135 | |
136 | + public bool IsSpecialSign(string word) { | |
137 | + return flags.Contains(word); | |
138 | + } | |
139 | + | |
136 | 140 | /* Configura as animações de intervalo */ |
137 | 141 | public void setRandomAnimations(string[] intervalAnimations) |
138 | 142 | { |
... | ... | @@ -476,12 +480,12 @@ public abstract class GenericPlayerManager : MonoBehaviour { |
476 | 480 | bool playingStarted = false; |
477 | 481 | |
478 | 482 | String[] stringPos = gloss.Split(' '); |
479 | - foreach (string aniName in stringPos) | |
483 | + foreach (string sub in stringPos) | |
480 | 484 | { |
485 | + string aniName = sub; | |
481 | 486 | if (String.IsNullOrEmpty(aniName)) continue; |
482 | 487 | |
483 | 488 | bool loaded = loadedAssetBundles.Contains(aniName); |
484 | - | |
485 | 489 | if ( ! loaded) |
486 | 490 | { |
487 | 491 | WWW bundleRequest = loadAssetBundle(aniName); | ... | ... |
Assets/Scripts/PlayerManager.cs
... | ... | @@ -9,6 +9,7 @@ using LAViD.Structures; |
9 | 9 | using System.Diagnostics; |
10 | 10 | using LAViD.Unity.Utils; |
11 | 11 | using LAViD.VLibras.Dictionary; |
12 | +using System.Collections.Generic; | |
12 | 13 | |
13 | 14 | public class PlayerManager : GenericPlayerManager { |
14 | 15 | |
... | ... | @@ -140,8 +141,18 @@ public class PlayerManager : GenericPlayerManager { |
140 | 141 | |
141 | 142 | protected override WWW loadAssetBundle(string aniName) |
142 | 143 | { |
143 | - if (this.regionHash == 1 && this.signs != null && !this.signs.Contains(aniName)) | |
144 | - return null; | |
144 | + UnityEngine.Debug.Log("PM.lAB: Checking " + aniName); | |
145 | + | |
146 | + if (this.regionHash == 1 && this.signs != null && !base.IsSpecialSign(aniName)) | |
147 | + { | |
148 | + try { | |
149 | + if (!this.signs.Contains(aniName)) | |
150 | + return null; | |
151 | + } | |
152 | + catch (KeyNotFoundException) { | |
153 | + return null; | |
154 | + } | |
155 | + } | |
145 | 156 | |
146 | 157 | string address = BASE_URL + this.regionPath + WWW.EscapeURL(aniName); |
147 | 158 | |
... | ... | @@ -177,47 +188,8 @@ public class PlayerManager : GenericPlayerManager { |
177 | 188 | this.screenManager.switchScreen("translate"); |
178 | 189 | } |
179 | 190 | |
180 | - protected override WWW getCheckConnectionRequest() | |
181 | - { | |
191 | + protected override WWW getCheckConnectionRequest() { | |
182 | 192 | return new WWW(BASE_URL); |
183 | - | |
184 | - | |
185 | - /*WWW connection = new WWW(SERVER_URL); | |
186 | - yield return connection; | |
187 | - //while (!glossRequest.isDone) | |
188 | - | |
189 | - if (connection.error == null) | |
190 | - { | |
191 | - if (connection.responseHeaders.Count > 0) | |
192 | - PlayerLogger.Log(connection.responseHeaders["STATUS"]); | |
193 | - else | |
194 | - PlayerLogger.Log("No STATUS"); | |
195 | - } | |
196 | - else PlayerLogger.Log("ERROR: " + connection.error); | |
197 | - | |
198 | - return false;*/ | |
199 | - | |
200 | - | |
201 | - /*HttpWebRequest request = (HttpWebRequest)WebRequest.Create(BASE_URL); | |
202 | - request.Method = "HEAD"; | |
203 | - request.Timeout = 2000; | |
204 | - | |
205 | - try { | |
206 | - HttpWebResponse response = (HttpWebResponse) request.GetResponse(); | |
207 | - } | |
208 | - catch (WebException e) | |
209 | - { | |
210 | - if (e.Response != null) | |
211 | - { | |
212 | - PlayerLogger.Log(((HttpWebResponse)e.Response).StatusCode); | |
213 | - return ((HttpWebResponse)e.Response).StatusCode == HttpStatusCode.NotFound; | |
214 | - } | |
215 | - } | |
216 | - catch (Exception) | |
217 | - { | |
218 | - } | |
219 | - | |
220 | - return false;*/ | |
221 | 193 | } |
222 | 194 | |
223 | 195 | public IEnumerator WaitForResponse(WWW www, Events.RequestSuccess success, Events.RequestError error) |
... | ... | @@ -286,12 +258,12 @@ public class PlayerManager : GenericPlayerManager { |
286 | 258 | |
287 | 259 | yield break; |
288 | 260 | } |
289 | - | |
261 | + | |
262 | + // Allows the gloss to be played when the dialog is closed | |
290 | 263 | base.gloss = gloss.ToUpper(); |
291 | 264 | } |
292 | 265 | finally |
293 | 266 | { |
294 | - | |
295 | 267 | this.screenManager.setLoadingSnippetState(false); |
296 | 268 | base.randomAnimations.unlockFor("translate"); |
297 | 269 | } | ... | ... |
ProjectSettings/ProjectSettings.asset