Commit a351b966262f9c3f7aff2723ea9c759858029542

Authored by Mateus Lustosa
1 parent e6b2f819
Exists in master

Adição de animações de inatividade; Correção da legenda para caracteres repetidos na soletração.

AssetBundles/newClip 0 → 100644
No preview for this file type
Assets/Avatar/Avatar.blend.meta
... ... @@ -208,7 +208,7 @@ ModelImporter:
208 208 animationImportWarnings:
209 209 animationRetargetingWarnings:
210 210 animationDoRetargetingWarnings: 0
211   - animationCompression: 1
  211 + animationCompression: 2
212 212 animationRotationError: .5
213 213 animationPositionError: .5
214 214 animationScaleError: .5
... ...
Assets/Bundles/[BOCEJAR] 0 → 100644
No preview for this file type
Assets/Bundles/[BOCEJAR_01] 0 → 100644
No preview for this file type
Assets/Bundles/[COCHILAR] 0 → 100644
No preview for this file type
Assets/Bundles/[COCHILAR_01] 0 → 100644
No preview for this file type
Assets/Bundles/[IAE]
No preview for this file type
Assets/Bundles/[OI]
No preview for this file type
Assets/Bundles/[PISCADA] 0 → 100644
No preview for this file type
Assets/Bundles/[PISCADA_01] 0 → 100644
No preview for this file type
Assets/Bundles/[PISCADA_02] 0 → 100644
No preview for this file type
Assets/Bundles/[PISCADA_03] 0 → 100644
No preview for this file type
Assets/Bundles/[RELAXAR] 0 → 100644
No preview for this file type
Assets/Bundles/[RELAXAR_01] 0 → 100644
No preview for this file type
Assets/Bundles/_[ESPREGUIÇADA]
No preview for this file type
Assets/Materials.meta 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +fileFormatVersion: 2
  2 +guid: 00f7fa573e5e1ce41876de36e0d1f4bf
  3 +folderAsset: yes
  4 +timeCreated: 1453731137
  5 +licenseType: Pro
  6 +DefaultImporter:
  7 + userData:
  8 + assetBundleName:
  9 + assetBundleVariant:
... ...
Assets/Scenes/Scene.unity
... ... @@ -347,6 +347,10 @@ Prefab:
347 347 m_Modification:
348 348 m_TransformParent: {fileID: 0}
349 349 m_Modifications:
  350 + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2}
  351 + propertyPath: m_Animations.Array.size
  352 + value: 40
  353 + objectReference: {fileID: 0}
350 354 - target: {fileID: 491010, guid: 00197fc9877daa14c963e5917de36124, type: 2}
351 355 propertyPath: m_LocalPosition.x
352 356 value: 0
... ... @@ -425,8 +429,40 @@ Prefab:
425 429 objectReference: {fileID: 2100000, guid: 3e98fe09c9ac4ae4dbe731872ff7687a, type: 2}
426 430 - target: {fileID: 11474732, guid: 00197fc9877daa14c963e5917de36124, type: 2}
427 431 propertyPath: m_Enabled
  432 + value: 1
  433 + objectReference: {fileID: 0}
  434 + - target: {fileID: 13781646, guid: 00197fc9877daa14c963e5917de36124, type: 2}
  435 + propertyPath: m_BlendShapeWeights.Array.data[3]
  436 + value: 0
  437 + objectReference: {fileID: 0}
  438 + - target: {fileID: 13781646, guid: 00197fc9877daa14c963e5917de36124, type: 2}
  439 + propertyPath: m_BlendShapeWeights.Array.data[14]
428 440 value: 0
429 441 objectReference: {fileID: 0}
  442 + - target: {fileID: 13781646, guid: 00197fc9877daa14c963e5917de36124, type: 2}
  443 + propertyPath: m_BlendShapeWeights.Array.data[20]
  444 + value: 0
  445 + objectReference: {fileID: 0}
  446 + - target: {fileID: 13781646, guid: 00197fc9877daa14c963e5917de36124, type: 2}
  447 + propertyPath: m_BlendShapeWeights.Array.data[18]
  448 + value: 0
  449 + objectReference: {fileID: 0}
  450 + - target: {fileID: 13781646, guid: 00197fc9877daa14c963e5917de36124, type: 2}
  451 + propertyPath: m_BlendShapeWeights.Array.data[10]
  452 + value: 0
  453 + objectReference: {fileID: 0}
  454 + - target: {fileID: 13781646, guid: 00197fc9877daa14c963e5917de36124, type: 2}
  455 + propertyPath: m_BlendShapeWeights.Array.data[4]
  456 + value: .0299999993
  457 + objectReference: {fileID: 0}
  458 + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2}
  459 + propertyPath: m_Animations.Array.data[40]
  460 + value:
  461 + objectReference: {fileID: 7400000, guid: bddeeddad8262394d836a5c042116341, type: 2}
  462 + - target: {fileID: 11171278, guid: 00197fc9877daa14c963e5917de36124, type: 2}
  463 + propertyPath: m_Animations.Array.data[41]
  464 + value:
  465 + objectReference: {fileID: 7400000, guid: d2d1cc8dbfcf80541b7a0d8614d76337, type: 2}
430 466 m_RemovedComponents: []
431 467 m_ParentPrefab: {fileID: 100100000, guid: 00197fc9877daa14c963e5917de36124, type: 2}
432 468 m_IsPrefabParent: 0
... ... @@ -1398,23 +1434,23 @@ Prefab:
1398 1434 objectReference: {fileID: 138791195}
1399 1435 - target: {fileID: 22412692, guid: 12db97f21fb2a7d4cb537ec5395de1b9, type: 2}
1400 1436 propertyPath: m_AnchorMax.x
1401   - value: 0
  1437 + value: .444444448
1402 1438 objectReference: {fileID: 0}
1403 1439 - target: {fileID: 22412692, guid: 12db97f21fb2a7d4cb537ec5395de1b9, type: 2}
1404 1440 propertyPath: m_AnchorMax.y
1405   - value: 0
  1441 + value: 1
1406 1442 objectReference: {fileID: 0}
1407 1443 - target: {fileID: 22452678, guid: 12db97f21fb2a7d4cb537ec5395de1b9, type: 2}
1408 1444 propertyPath: m_AnchorMin.x
1409   - value: 0
  1445 + value: .444444448
1410 1446 objectReference: {fileID: 0}
1411 1447 - target: {fileID: 22452678, guid: 12db97f21fb2a7d4cb537ec5395de1b9, type: 2}
1412 1448 propertyPath: m_AnchorMax.x
1413   - value: 0
  1449 + value: .444444448
1414 1450 objectReference: {fileID: 0}
1415 1451 - target: {fileID: 22452678, guid: 12db97f21fb2a7d4cb537ec5395de1b9, type: 2}
1416 1452 propertyPath: m_AnchorMax.y
1417   - value: 0
  1453 + value: 1
1418 1454 objectReference: {fileID: 0}
1419 1455 - target: {fileID: 131276, guid: 12db97f21fb2a7d4cb537ec5395de1b9, type: 2}
1420 1456 propertyPath: m_IsActive
... ...
Assets/Scripts/Player Manager/GenericPlayerManager.cs
... ... @@ -59,6 +59,18 @@ public abstract class GenericPlayerManager : MonoBehaviour {
59 59 "[INTERROGACAO]",
60 60 "[EXCLAMACAO]"
61 61 });
  62 +
  63 + string[] toDuplicate = new string[] {
  64 + "A", "B", "C", "D", "E", "F", "G", "H", "I",
  65 + "J", "K", "L", "M", "N", "O", "P", "Q", "R",
  66 + "S", "T", "U", "V", "W", "X", "Y", "Z",
  67 + "0", "1", "2", "3", "4",
  68 + "5", "6", "7", "8", "9",
  69 + ","
  70 + };
  71 +
  72 + foreach (string anim in toDuplicate)
  73 + COMPONENT_ANIMATION.AddClip(COMPONENT_ANIMATION[anim].clip, "d_" + anim);
62 74 }
63 75  
64 76 public bool isLoadingSingleAnimation() { return loadingSingleAnimation; }
... ... @@ -259,23 +271,29 @@ public abstract class GenericPlayerManager : MonoBehaviour {
259 271 // A reprodução da primeira letra deve ser longa para não ser cortada no fade
260 272 subtitle.updateLetterSpeed();
261 273  
  274 + string lastAnim = "";
  275 +
262 276 for (int i = 0; i < word.Length; i++)
263 277 {
264   - char second = word[i];
265 278 lastAnimationSubtitle = Subtitle.highlight(word, i);
266 279  
  280 + string anim = word[i].ToString();
  281 + lastAnim = anim.Equals(lastAnim) ? "d_" + anim : anim;
  282 +
  283 + short type;
  284 +
267 285 // Se for uma letra
268   - if (second >= 65 && second <= 90)
269   - playAnimation(Subtitle.TYPE_LETTER, second.ToString(), lastAnimationSubtitle, subtitle.LetterSpeed);
  286 + if (word[i] >= 65 && word[i] <= 90)
  287 + type = Subtitle.TYPE_LETTER;
270 288  
271 289 // Se for um número
272   - else if (second >= 48 && second <= 57)
273   - playAnimation(Subtitle.TYPE_NUMBER, second.ToString(), lastAnimationSubtitle, subtitle.NumberSpeed);
274   -
  290 + else if (word[i] >= 48 && word[i] <= 57)
  291 + type = Subtitle.TYPE_NUMBER;
  292 +
275 293 // Se for uma vírgula
276   - else if (second == 44)
277   - playAnimation(Subtitle.TYPE_WORD, second.ToString(), lastAnimationSubtitle);
278   -
  294 + else if (word[i] == 44)
  295 + type = Subtitle.TYPE_WORD;
  296 +
279 297 // Não há animação
280 298 else
281 299 {
... ... @@ -289,9 +307,11 @@ public abstract class GenericPlayerManager : MonoBehaviour {
289 307 subtitle.updateLetterSpeed();
290 308 }
291 309  
292   - UnityEngine.Debug.Log("Animação \"" + second + "\" inexistente.");
  310 + UnityEngine.Debug.Log("Animação \"" + word[i] + "\" inexistente.");
293 311 continue;
294 312 }
  313 +
  314 + playAnimation(type, lastAnim, lastAnimationSubtitle);
295 315  
296 316 defaultPlayed = false;
297 317 subtitle.updateLetterSpeed();
... ... @@ -300,47 +320,6 @@ public abstract class GenericPlayerManager : MonoBehaviour {
300 320 return lastAnimationSubtitle;
301 321 }
302 322  
303   -
304   - protected IEnumerator loadAnimation(string name)
305   - {
306   - loadingSingleAnimation = true;
307   -
308   - // Função loadAssetBundle é definida pela classe filha
309   - WWW www = loadAssetBundle(name);
310   -
311   - if (www != null)
312   - {
313   - yield return www;
314   -
315   - AssetBundle bundle = null;
316   -
317   - if (www.error == null)
318   - bundle = www.assetBundle;
319   -
320   - if (bundle != null && ! String.IsNullOrEmpty(bundle.mainAsset.name))
321   - {
322   - AnimationClip aniClip = bundle.mainAsset as AnimationClip;
323   - bundle.Unload(false);
324   -
325   - if (aniClip)
326   - {
327   - COMPONENT_ANIMATION.AddClip(aniClip, name);
328   -
329   - // Reproduz palavra
330   - loadedAssetBundles.Add(name);
331   - yield break;
332   - }
333   - else UnityEngine.Debug.Log ("Sinal \"" + name + "\" não carregado corretamente.");
334   - }
335   - }
336   -
337   - // Soletra palavra
338   - nonexistentAssetBundles.Add(name);
339   -
340   - loadingSingleAnimation = false;
341   - }
342   -
343   -
344 323 private IEnumerator loadAndPlay()
345 324 {
346 325 loading = true;
... ...
Assets/Scripts/Player Manager/RandomAnimations.cs
... ... @@ -32,11 +32,6 @@ public class RandomAnimations {
32 32 playerManager.Invoke("playRandomAnimations", this.time);
33 33 }
34 34  
35   - private void playAnimation(string glosa)
36   - {
37   - this.playerManager.play(glosa);
38   - }
39   -
40 35 public void playRandom()
41 36 {
42 37 if (running)
... ... @@ -48,7 +43,7 @@ public class RandomAnimations {
48 43 if (index == lastIndex)
49 44 index = sortIndex();
50 45  
51   - playAnimation(this.names[index]);
  46 + this.playerManager.play(this.names[index]);
52 47 }
53 48  
54 49 playerManager.Invoke("playRandomAnimations", this.time);
... ...
Assets/Scripts/Player Manager/Subtitle.cs
... ... @@ -104,28 +104,16 @@ public class Subtitle {
104 104 public static string highlight(string word, int index)
105 105 {
106 106 string subtitle = "";
107   - int last = 0;
108 107  
109   - if (index == 0)
110   - subtitle += "<b><color=white>" + word[0] + "</color></b>";
111   - else
112   - subtitle += word[0];
113   -
114   - for (int i = 1; i < word.Length; i++)
  108 + for (int i = 0; i < word.Length; i++)
115 109 {
116   - if ((word[i] >= 65 && word[i] <= 90) || (word[i] >= 48 && word[i] <= 57))
  110 + if (i > 0 && ((word[i] >= 65 && word[i] <= 90) || (word[i] >= 48 && word[i] <= 57)))
117 111 subtitle += "-";
118 112  
119   - if (i == index || (last == index && word[i] == word[last]))
120   - {
  113 + if (i == index)
121 114 subtitle += "<b><color=white>" + word[i] + "</color></b>";
122   - if (i == index) last = i;
123   - }
124 115 else
125   - {
126 116 subtitle += word[i];
127   - last = i;
128   - }
129 117 }
130 118  
131 119 return subtitle;
... ...
Assets/Scripts/PlayerManager.cs
... ... @@ -25,9 +25,18 @@ public class PlayerManager : GenericPlayerManager {
25 25 private Color disabledAlpha = new Color(1F, 1F, 1F, 0.5F);
26 26  
27 27 private string[] randomAnimationNames = new string[] {
28   - "[OLA]",
  28 + //"[OLA]",
29 29 "[ESPREGUIÇADA]",
30   - //"[IAE]"
  30 + //"[BOCEJAR]",
  31 + "[BOCEJAR_01]",
  32 + //"[COCHILAR]",
  33 + "[COCHILAR_01]",
  34 + //"[PISCADA]",
  35 + //"[PISCADA_01]",
  36 + //"[PISCADA_02]",
  37 + //"[PISCADA_03]",
  38 + //"[RELAXAR]",
  39 + //"[RELAXAR_01]"
31 40 };
32 41  
33 42 //InputField INFIELD;
... ... @@ -46,7 +55,7 @@ public class PlayerManager : GenericPlayerManager {
46 55 stopButtonGraphic = stopButton.GetComponent<Graphic>();
47 56 stopButtonGraphic.color = disabledAlpha;
48 57  
49   - base.setRandomAnimations(new RandomAnimations(this, randomAnimationNames, 2, 1F), randomAnimationNames);
  58 + base.setRandomAnimations(new RandomAnimations(this, randomAnimationNames, 6, 0.5F), randomAnimationNames);
50 59 base.Start();
51 60 }
52 61  
... ...