Commit 85f88069cabbc245d1df633b1ec9ce03348d0b55

Authored by Mateus Lustosa
1 parent 95688158

Fix animations watcher; Fix avatar-z

Assets/Scenes/Main.unity
... ... @@ -5156,7 +5156,7 @@ Prefab:
5156 5156 objectReference: {fileID: 0}
5157 5157 - target: {fileID: 400002, guid: 714c639770278b249bb7d0850bac50fc, type: 3}
5158 5158 propertyPath: m_LocalPosition.z
5159   - value: 4
  5159 + value: 3
5160 5160 objectReference: {fileID: 0}
5161 5161 - target: {fileID: 400002, guid: 714c639770278b249bb7d0850bac50fc, type: 3}
5162 5162 propertyPath: m_LocalRotation.x
... ... @@ -6279,131 +6279,6 @@ CanvasRenderer:
6279 6279 m_PrefabParentObject: {fileID: 0}
6280 6280 m_PrefabInternal: {fileID: 0}
6281 6281 m_GameObject: {fileID: 1031720608}
6282   ---- !u!1 &1048863672
6283   -GameObject:
6284   - m_ObjectHideFlags: 0
6285   - m_PrefabParentObject: {fileID: 133698, guid: 5ccb0ba277304a14b9bb8d4e34161675, type: 2}
6286   - m_PrefabInternal: {fileID: 0}
6287   - serializedVersion: 4
6288   - m_Component:
6289   - - 224: {fileID: 1048863673}
6290   - - 222: {fileID: 1048863676}
6291   - - 114: {fileID: 1048863674}
6292   - - 114: {fileID: 1048863675}
6293   - m_Layer: 5
6294   - m_Name: b_info
6295   - m_TagString: Untagged
6296   - m_Icon: {fileID: 0}
6297   - m_NavMeshLayer: 0
6298   - m_StaticEditorFlags: 0
6299   - m_IsActive: 0
6300   ---- !u!224 &1048863673
6301   -RectTransform:
6302   - m_ObjectHideFlags: 0
6303   - m_PrefabParentObject: {fileID: 22435842, guid: 5ccb0ba277304a14b9bb8d4e34161675,
6304   - type: 2}
6305   - m_PrefabInternal: {fileID: 0}
6306   - m_GameObject: {fileID: 1048863672}
6307   - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
6308   - m_LocalPosition: {x: 0, y: 0, z: 0}
6309   - m_LocalScale: {x: 1, y: 1, z: 1}
6310   - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
6311   - m_Children: []
6312   - m_Father: {fileID: 1357627304}
6313   - m_RootOrder: 4
6314   - m_AnchorMin: {x: 0, y: 1}
6315   - m_AnchorMax: {x: 0, y: 1}
6316   - m_AnchoredPosition: {x: 203.972, y: -24.257143}
6317   - m_SizeDelta: {x: 22.215998, y: 38.514286}
6318   - m_Pivot: {x: 0.5, y: 0.5}
6319   ---- !u!114 &1048863674
6320   -MonoBehaviour:
6321   - m_ObjectHideFlags: 0
6322   - m_PrefabParentObject: {fileID: 11447224, guid: 5ccb0ba277304a14b9bb8d4e34161675,
6323   - type: 2}
6324   - m_PrefabInternal: {fileID: 0}
6325   - m_GameObject: {fileID: 1048863672}
6326   - m_Enabled: 1
6327   - m_EditorHideFlags: 0
6328   - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
6329   - m_Name:
6330   - m_EditorClassIdentifier:
6331   - m_Material: {fileID: 0}
6332   - m_Color: {r: 1, g: 1, b: 1, a: 0.3019608}
6333   - m_RaycastTarget: 1
6334   - m_OnCullStateChanged:
6335   - m_PersistentCalls:
6336   - m_Calls: []
6337   - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
6338   - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
6339   - m_Sprite: {fileID: 21300000, guid: 9d4cc4cb9b7a7e44ab610fb91451883b, type: 3}
6340   - m_Type: 0
6341   - m_PreserveAspect: 1
6342   - m_FillCenter: 1
6343   - m_FillMethod: 4
6344   - m_FillAmount: 1
6345   - m_FillClockwise: 1
6346   - m_FillOrigin: 0
6347   ---- !u!114 &1048863675
6348   -MonoBehaviour:
6349   - m_ObjectHideFlags: 0
6350   - m_PrefabParentObject: {fileID: 11487520, guid: 5ccb0ba277304a14b9bb8d4e34161675,
6351   - type: 2}
6352   - m_PrefabInternal: {fileID: 0}
6353   - m_GameObject: {fileID: 1048863672}
6354   - m_Enabled: 1
6355   - m_EditorHideFlags: 0
6356   - m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
6357   - m_Name:
6358   - m_EditorClassIdentifier:
6359   - m_Navigation:
6360   - m_Mode: 3
6361   - m_SelectOnUp: {fileID: 0}
6362   - m_SelectOnDown: {fileID: 0}
6363   - m_SelectOnLeft: {fileID: 0}
6364   - m_SelectOnRight: {fileID: 0}
6365   - m_Transition: 1
6366   - m_Colors:
6367   - m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
6368   - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
6369   - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
6370   - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
6371   - m_ColorMultiplier: 1
6372   - m_FadeDuration: 0.1
6373   - m_SpriteState:
6374   - m_HighlightedSprite: {fileID: 0}
6375   - m_PressedSprite: {fileID: 0}
6376   - m_DisabledSprite: {fileID: 0}
6377   - m_AnimationTriggers:
6378   - m_NormalTrigger: Normal
6379   - m_HighlightedTrigger: Highlighted
6380   - m_PressedTrigger: Pressed
6381   - m_DisabledTrigger: Disabled
6382   - m_Interactable: 1
6383   - m_TargetGraphic: {fileID: 45157148}
6384   - m_OnClick:
6385   - m_PersistentCalls:
6386   - m_Calls:
6387   - - m_Target: {fileID: 228512395}
6388   - m_MethodName: select
6389   - m_Mode: 3
6390   - m_Arguments:
6391   - m_ObjectArgument: {fileID: 0}
6392   - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
6393   - m_IntArgument: 4
6394   - m_FloatArgument: 0
6395   - m_StringArgument:
6396   - m_BoolArgument: 0
6397   - m_CallState: 2
6398   - m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
6399   - Culture=neutral, PublicKeyToken=null
6400   ---- !u!222 &1048863676
6401   -CanvasRenderer:
6402   - m_ObjectHideFlags: 0
6403   - m_PrefabParentObject: {fileID: 22201970, guid: 5ccb0ba277304a14b9bb8d4e34161675,
6404   - type: 2}
6405   - m_PrefabInternal: {fileID: 0}
6406   - m_GameObject: {fileID: 1048863672}
6407 6282 --- !u!1 &1053934344
6408 6283 GameObject:
6409 6284 m_ObjectHideFlags: 0
... ... @@ -6697,7 +6572,7 @@ MonoBehaviour:
6697 6572 m_HorizontalOverflow: 0
6698 6573 m_VerticalOverflow: 0
6699 6574 m_LineSpacing: 1
6700   - m_Text: Version 3.0.36
  6575 + m_Text: Version 3.0.40
6701 6576 --- !u!222 &1071047506
6702 6577 CanvasRenderer:
6703 6578 m_ObjectHideFlags: 0
... ... @@ -8633,7 +8508,6 @@ RectTransform:
8633 8508 - {fileID: 510126319}
8634 8509 - {fileID: 395548682}
8635 8510 - {fileID: 630366171}
8636   - - {fileID: 1048863673}
8637 8511 m_Father: {fileID: 1798565573}
8638 8512 m_RootOrder: 0
8639 8513 m_AnchorMin: {x: 0.12, y: 0}
... ... @@ -13717,7 +13591,7 @@ MonoBehaviour:
13717 13591 m_Arguments:
13718 13592 m_ObjectArgument: {fileID: 0}
13719 13593 m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
13720   - m_IntArgument: 5
  13594 + m_IntArgument: 4
13721 13595 m_FloatArgument: 0
13722 13596 m_StringArgument:
13723 13597 m_BoolArgument: 0
... ... @@ -13955,7 +13829,7 @@ GameObject:
13955 13829 m_Icon: {fileID: 0}
13956 13830 m_NavMeshLayer: 0
13957 13831 m_StaticEditorFlags: 0
13958   - m_IsActive: 0
  13832 + m_IsActive: 1
13959 13833 --- !u!224 &2099411279
13960 13834 RectTransform:
13961 13835 m_ObjectHideFlags: 0
... ... @@ -13970,10 +13844,10 @@ RectTransform:
13970 13844 m_Children: []
13971 13845 m_Father: {fileID: 702185295}
13972 13846 m_RootOrder: 2
13973   - m_AnchorMin: {x: 0, y: 1}
13974   - m_AnchorMax: {x: 0, y: 1}
13975   - m_AnchoredPosition: {x: 260.71997, y: -76.62858}
13976   - m_SizeDelta: {x: 106, y: 106}
  13847 + m_AnchorMin: {x: 0, y: 0}
  13848 + m_AnchorMax: {x: 0, y: 0}
  13849 + m_AnchoredPosition: {x: 0, y: 0}
  13850 + m_SizeDelta: {x: 0, y: 0}
13977 13851 m_Pivot: {x: 0.5, y: 0.5}
13978 13852 --- !u!114 &2099411280
13979 13853 MonoBehaviour:
... ...
Assets/Scripts/Player Manager/GenericPlayerManager.cs
... ... @@ -88,6 +88,7 @@ public abstract class GenericPlayerManager : MonoBehaviour {
88 88 subtitles.DefaultFirstLetterSpeed = new DefaultSignSpeed(2.1F, 2.8F);
89 89 subtitles.DefaultLetterSpeed = new DefaultSignSpeed(3F, 4.3F);
90 90 subtitles.DefaultNumberSpeed = new DefaultSignSpeed(1.5F, 2.9F);
  91 + PlayerLogger.Log("Subtitles object: " + subtitles);
91 92  
92 93 AVATAR = GameObject.FindGameObjectWithTag("avatar");
93 94 COMPONENT_ANIMATION = AVATAR.GetComponent<Animation>();
... ... @@ -120,6 +121,8 @@ public abstract class GenericPlayerManager : MonoBehaviour {
120 121 // Cria novo _default chamado _default_middle para pausas dentro de uma glosa
121 122 // Impede que a animação default seja confundida com não-reprodução na UI
122 123 COMPONENT_ANIMATION.AddClip(COMPONENT_ANIMATION[DEFAULT_ANIMATION].clip, DEFAULT_ANIMATION_MIDDLE);
  124 +
  125 + StartCoroutine(AnimationsWatcher());
123 126 }
124 127  
125 128 public bool isPlayingIntervalAnimation() { return intervalAnimationState != null; }
... ... @@ -187,11 +190,10 @@ public abstract class GenericPlayerManager : MonoBehaviour {
187 190 /* Para animações */
188 191 public void stopAnimations()
189 192 {
190   - StopCoroutine("AnimationsWatcher");
191 193 this.randomAnimations.unlockFor("AnimationsWatcher");
  194 + this.animQueue.Clear();
192 195 this.subtitles.setText("");
193 196  
194   - lock (this.animQueue) { this.animQueue.Clear(); }
195 197 COMPONENT_ANIMATION.CrossFadeQueued(DEFAULT_ANIMATION, fadeLength, QueueMode.PlayNow);
196 198  
197 199 resetStates();
... ... @@ -621,61 +623,73 @@ public abstract class GenericPlayerManager : MonoBehaviour {
621 623  
622 624 while (true)
623 625 {
624   - if (this.animQueue.Count > 0)
625   - {
626   - if (!this.playing)
627   - {
628   - PlayerLogger.Log("GPM", "AW", "Playing.");
  626 + if (this.animQueue.Count > 0)
  627 + {
  628 + if (!this.playing)
  629 + {
  630 + PlayerLogger.Log("GPM", "AW", "Playing.");
629 631  
630   - this.playing = true;
631   - onPlayingStateChange();
  632 + this.playing = true;
  633 + onPlayingStateChange();
632 634  
633   - this.randomAnimations.lockFor("AnimationsWatcher");
634   - }
  635 + this.randomAnimations.lockFor("AnimationsWatcher");
  636 + }
635 637  
636   - // Gets first animation
637   - AnimationReference reference = this.animQueue.Peek();
638   -
639   - if (COMPONENT_ANIMATION.IsPlaying(reference.name))
640   - {
641   - this.animationPlaying = this.animQueue.Dequeue();
642   - this.subtitles.setText(reference.subtitle);
643   -
644   - // Watches transition between current and next animation
645   - while (true)
646   - {
647   - yield return new WaitForEndOfFrame();
648   -
649   - // Gets next animation
650   - AnimationReference next = this.animQueue.Count > 0 ? this.animQueue.Peek() : null;
651   -
652   - if (next != null && COMPONENT_ANIMATION.IsPlaying(next.name))
653   - {
654   - // Waits next animation starts
655   - while (!COMPONENT_ANIMATION.IsPlaying(next.name))
656   - yield return new WaitForEndOfFrame();
657   -
658   - // Waits half fade
659   - yield return new WaitForSeconds(this.fadeLength / 2);
660   - break;
661   - }
662   - else if (!COMPONENT_ANIMATION.IsPlaying(reference.name)) break;
663   - }
664   - }
  638 + // Gets first animation
  639 + AnimationReference reference = this.animQueue.Peek();
  640 + PlayerLogger.Log("GPM", "AW", "Got " + reference.name + ".");
665 641  
666   - // Animation played but was not tracked
667   - if (reference.state == null)
668   - this.animQueue.Dequeue();
669   - }
670   - else if (this.playing && !this.loading)
671   - {
672   - PlayerLogger.Log("GPM", "AW", "Not playing.");
  642 + if (COMPONENT_ANIMATION.IsPlaying(reference.name))
  643 + {
  644 + PlayerLogger.Log("GPM", "AW", "And its playing!");
673 645  
674   - resetStates();
  646 + this.animationPlaying = this.animQueue.Dequeue();
  647 + this.subtitles.setText(reference.subtitle);
675 648  
676   - this.subtitles.setText("");
677   - this.randomAnimations.unlockFor("AnimationsWatcher");
678   - }
  649 + // Watches transition between current and next animation
  650 + while (true)
  651 + {
  652 + PlayerLogger.Log("GPM", "AW", "Wating for it to end.");
  653 +
  654 + yield return new WaitForEndOfFrame();
  655 +
  656 + // Gets next animation
  657 + AnimationReference next = this.animQueue.Count > 0 ? this.animQueue.Peek() : null;
  658 +
  659 + if (next != null && COMPONENT_ANIMATION.IsPlaying(next.name))
  660 + {
  661 + PlayerLogger.Log("GPM", "AW", "It has a next.");
  662 +
  663 + // Waits next animation starts
  664 + while (!COMPONENT_ANIMATION.IsPlaying(next.name))
  665 + yield return new WaitForEndOfFrame();
  666 +
  667 + // Waits half fade
  668 + yield return new WaitForSeconds(this.fadeLength / 2);
  669 + break;
  670 + }
  671 + else if (!COMPONENT_ANIMATION.IsPlaying(reference.name)) break;
  672 + }
  673 + }
  674 + // Animation played but was not tracked
  675 + else
  676 + {
  677 + if (reference.state == null)
  678 + this.animQueue.Dequeue();
  679 +
  680 + yield return new WaitForEndOfFrame();
  681 + }
  682 + }
  683 + else if (this.playing && !this.loading)
  684 + {
  685 + PlayerLogger.Log("GPM", "AW", "Not playing.");
  686 +
  687 + resetStates();
  688 +
  689 + this.subtitles.setText("");
  690 + this.randomAnimations.unlockFor("AnimationsWatcher");
  691 + }
  692 + else yield return new WaitForEndOfFrame();
679 693 }
680 694 }
681 695  
... ...
Assets/Scripts/TutorialManager.cs
... ... @@ -24,6 +24,8 @@ public class TutorialManager : MonoBehaviour {
24 24 "Barra de velocidade\n\nNa barra você pode escolher a velocidade que deseja visualizar o sinal",
25 25 };
26 26  
  27 + private Image[] buttons;
  28 +
27 29 protected void Start ()
28 30 {
29 31 if (Screen.dpi < 140)
... ... @@ -53,23 +55,22 @@ public class TutorialManager : MonoBehaviour {
53 55 {
54 56 this.description.fontSize = 14;
55 57 }
  58 +
  59 + this.buttons = new Image[] {
  60 + this.translateImage,
  61 + this.micImage,
  62 + this.dictionaryImage,
  63 + this.subtitlesImage
  64 + };
56 65 }
57 66  
58   - private Image getButton()
59   - {
60   - switch (this.index)
61   - {
62   - case 0: return this.translateImage;
63   - case 1: return this.micImage;
64   - case 2: return this.dictionaryImage;
65   - case 3: return this.subtitlesImage;
66   - default: return null;
67   - }
  67 + private Image getButton() {
  68 + return this.index <= 3 ? this.buttons[this.index] : null;
68 69 }
69 70  
70 71 public void next()
71 72 {
72   - if (index == 4)
  73 + if (this.index == 4)
73 74 {
74 75 this.screenManager.hideScreen();
75 76 select(0);
... ... @@ -77,14 +78,15 @@ public class TutorialManager : MonoBehaviour {
77 78 else
78 79 {
79 80 #if UNITY_IOS
80   - if (this.index == 0)
81   - this.index++;
  81 + // Jump mic
  82 + select(this.index == 0 ? 2 : this.index + 1);
  83 +#else
  84 + select(this.index + 1);
82 85 #endif
83   - select(this.index + 1);
84   - }
85   - }
  86 + }
  87 + }
86 88  
87   - public void select(int index)
  89 + public void select(int index)
88 90 {
89 91 if (this.index <= 3)
90 92 getButton().color = disabledColor;
... ... @@ -94,15 +96,11 @@ public class TutorialManager : MonoBehaviour {
94 96 this.index = index;
95 97  
96 98 if (this.index <= 3)
97   - {
98 99 getButton().color = enabledColor;
99   - this.description.text = this.descriptions[index];
100   - }
101 100 else
102   - {
103   - this.sliderShadow.SetActive(false);
104   - this.description.text = this.descriptions[index];
105   - }
  101 + this.sliderShadow.SetActive(false);
  102 +
  103 + this.description.text = this.descriptions[index];
106 104 }
107 105  
108 106 }
109 107 \ No newline at end of file
... ...
Assets/Scripts/UI/Resizers/BarResizer.cs
... ... @@ -17,15 +17,15 @@ public class BarResizer : MonoBehaviour {
17 17  
18 18 // 240
19 19 else if (Screen.width < 500)
20   - this.barBottomLayout.spacing = 116;
  20 + this.barBottomLayout.spacing = 106;
21 21  
22 22 // 320
23 23 else if (Screen.width < 620)
24   - this.barBottomLayout.spacing = 142;
  24 + this.barBottomLayout.spacing = 132;
25 25  
26 26 // 480
27 27 else if (Screen.width < 840)
28   - this.barBottomLayout.spacing = 190;
  28 + this.barBottomLayout.spacing = 180;
29 29  
30 30 else
31 31 this.barBottomLayout.spacing = 210;
... ...