diff --git a/.gitignore b/.gitignore index 46b5bb0..841079d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ /[Tt]emp/ /[Oo]bj/ /[Bb]uild/ +BUILDS/ +DESIGN/ + # Autogenerated VS/MD solution and project files *.csproj diff --git a/Assets/Resources/GUI/b_pause.png b/Assets/Resources/GUI/b_pause.png new file mode 100644 index 0000000..eff5ebb Binary files /dev/null and b/Assets/Resources/GUI/b_pause.png differ diff --git a/Assets/Resources/GUI/b_pause.png.meta b/Assets/Resources/GUI/b_pause.png.meta new file mode 100644 index 0000000..c8cee2f --- /dev/null +++ b/Assets/Resources/GUI/b_pause.png.meta @@ -0,0 +1,56 @@ +fileFormatVersion: 2 +guid: e80dac29e3ea8be489d3260b48c99a15 +timeCreated: 1455582769 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index af07334..096f728 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -959,10 +959,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1024302432} m_RootOrder: 2 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} - m_AnchoredPosition: {x: 100, y: 0} - m_SizeDelta: {x: 47, y: 56} + m_AnchorMin: {x: .675000012, y: .100000001} + m_AnchorMax: {x: .975000024, y: .899999976} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: -16} m_Pivot: {x: .5, y: .5} --- !u!114 &112837685 MonoBehaviour: @@ -1026,7 +1026,7 @@ MonoBehaviour: Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_Sprite: {fileID: 21300000, guid: fbf55ea1f2e12da4799c1ac527f37b6e, type: 3} m_Type: 0 - m_PreserveAspect: 0 + m_PreserveAspect: 1 m_FillCenter: 1 m_FillMethod: 4 m_FillAmount: 1 @@ -3785,6 +3785,136 @@ CanvasRenderer: type: 2} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 434826652} +--- !u!1 &440527253 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 143932, guid: 6506218ed7927bf45b508ebbec0c1222, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 440527254} + - 222: {fileID: 440527258} + - 114: {fileID: 440527257} + - 114: {fileID: 440527256} + - 114: {fileID: 440527255} + m_Layer: 5 + m_Name: b_pause + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &440527254 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22461782, guid: 6506218ed7927bf45b508ebbec0c1222, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 440527253} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2045088296} + m_RootOrder: 1 + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 12.0960007, y: -25.3714294} + m_SizeDelta: {x: 24.1920013, y: 40.7428589} + m_Pivot: {x: .5, y: .5} +--- !u!114 &440527255 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 440527253} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5ea7adaac15fb3545b8ae42d73c16908, type: 3} + m_Name: + m_EditorClassIdentifier: + image: {fileID: 440527257} + isEnabled: 0 + updateReference: {fileID: 0} + enabledColor: {r: .310000002, g: .75, b: .912999988, a: 1} + disabledColor: {r: .666666687, g: .666666687, b: .666666687, a: 1} +--- !u!114 &440527256 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11446444, guid: 6506218ed7927bf45b508ebbec0c1222, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 440527253} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} + m_PressedColor: {r: .572549045, g: .752941251, b: .811764777, a: 1} + m_DisabledColor: {r: .792156875, g: .792156875, b: .792156875, a: 1} + m_ColorMultiplier: 1 + m_FadeDuration: .100000001 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 440527257} + m_OnClick: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &440527257 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11458508, guid: 6506218ed7927bf45b508ebbec0c1222, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 440527253} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: .666666687, g: .666666687, b: .666666687, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: e80dac29e3ea8be489d3260b48c99a15, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &440527258 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22296198, guid: 6506218ed7927bf45b508ebbec0c1222, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 440527253} --- !u!1 &460696035 GameObject: m_ObjectHideFlags: 0 @@ -5366,7 +5496,7 @@ RectTransform: m_AnchorMin: {x: .0500000007, y: .699999988} m_AnchorMax: {x: .949999988, y: .879999995} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: -61.4925079} m_Pivot: {x: .5, y: 1} --- !u!114 &568220611 MonoBehaviour: @@ -5507,6 +5637,9 @@ MonoBehaviour: loading_snippet: {fileID: 1439902017} INFIELD: {fileID: 1886290661} canvas_connection_error: {fileID: 1164416490} + textButton: {fileID: 0} + pauseButton: {fileID: 0} + pauseMenu: {fileID: 1024302431} --- !u!114 &578311383 MonoBehaviour: m_ObjectHideFlags: 0 @@ -8051,7 +8184,7 @@ MonoBehaviour: isEnabled: 0 updateReference: {fileID: 0} enabledColor: {r: .310000002, g: .75, b: .912999988, a: 1} - disabledColor: {r: .792156875, g: .792156875, b: .792156875, a: 1} + disabledColor: {r: .666666687, g: .666666687, b: .666666687, a: 1} --- !u!114 &930426945 MonoBehaviour: m_ObjectHideFlags: 0 @@ -8072,7 +8205,7 @@ MonoBehaviour: m_SelectOnRight: {fileID: 0} m_Transition: 1 m_Colors: - m_NormalColor: {r: .792156875, g: .792156875, b: .792156875, a: 1} + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} m_PressedColor: {r: .572549045, g: .752941251, b: .811764777, a: 1} m_DisabledColor: {r: .792156875, g: .792156875, b: .792156875, a: 1} @@ -8129,7 +8262,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: .904411793, g: .904411793, b: .904411793, a: 1} + m_Color: {r: .666666687, g: .666666687, b: .666666687, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: @@ -8609,7 +8742,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &951727302 RectTransform: m_ObjectHideFlags: 0 @@ -9247,17 +9380,17 @@ RectTransform: m_GameObject: {fileID: 1024302431} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: .800000012, y: .800000012, z: 0} + m_LocalScale: {x: 1, y: 1, z: 0} m_Children: - {fileID: 1525727530} - {fileID: 1085279172} - {fileID: 112837684} m_Father: {fileID: 1252650593} m_RootOrder: 11 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} + m_AnchorMin: {x: .100000001, y: .419999987} + m_AnchorMax: {x: .899999976, y: .579999983} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 451, y: 139} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: .5, y: .5} --- !u!114 &1024302433 MonoBehaviour: @@ -10141,14 +10274,14 @@ RectTransform: m_GameObject: {fileID: 1085279171} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: .949999988, y: .949999988, z: 1} m_Children: [] m_Father: {fileID: 1024302432} m_RootOrder: 1 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} + m_AnchorMin: {x: .349999994, y: .100000001} + m_AnchorMax: {x: .649999976, y: .899999976} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 55, y: 67} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: .5, y: .5} --- !u!114 &1085279173 MonoBehaviour: @@ -10212,7 +10345,7 @@ MonoBehaviour: Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_Sprite: {fileID: 21300000, guid: 5324882cb6bf20141b5cff66b4764ffb, type: 3} m_Type: 0 - m_PreserveAspect: 0 + m_PreserveAspect: 1 m_FillCenter: 1 m_FillMethod: 4 m_FillAmount: 1 @@ -10997,7 +11130,7 @@ RectTransform: m_AnchorMin: {x: .0500000007, y: .200000003} m_AnchorMax: {x: .949999988, y: .879999995} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: -341.992493} m_Pivot: {x: .5, y: 1} --- !u!114 &1149571752 MonoBehaviour: @@ -15281,14 +15414,14 @@ RectTransform: m_GameObject: {fileID: 1525727529} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: .899999976, y: .899999976, z: 1} m_Children: [] m_Father: {fileID: 1024302432} m_RootOrder: 0 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} - m_AnchoredPosition: {x: -100, y: 0} - m_SizeDelta: {x: 47, y: 56} + m_AnchorMin: {x: .0250000004, y: .100000001} + m_AnchorMax: {x: .324999988, y: .899999976} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: .5, y: .5} --- !u!114 &1525727531 MonoBehaviour: @@ -15352,9 +15485,9 @@ MonoBehaviour: Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_Sprite: {fileID: 21300000, guid: 72a95df012b6995419d116db373691db, type: 3} m_Type: 0 - m_PreserveAspect: 0 + m_PreserveAspect: 1 m_FillCenter: 1 - m_FillMethod: 4 + m_FillMethod: 2 m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 @@ -16791,7 +16924,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 2045088296} - m_RootOrder: 2 + m_RootOrder: 3 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -16812,7 +16945,7 @@ MonoBehaviour: isEnabled: 0 updateReference: {fileID: 1649730297} enabledColor: {r: .310000002, g: .75, b: .912999988, a: 1} - disabledColor: {r: .792156875, g: .792156875, b: .792156875, a: 1} + disabledColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &1649730300 MonoBehaviour: m_ObjectHideFlags: 0 @@ -16833,7 +16966,7 @@ MonoBehaviour: m_SelectOnRight: {fileID: 0} m_Transition: 1 m_Colors: - m_NormalColor: {r: .792156875, g: .792156875, b: .792156875, a: 1} + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} m_PressedColor: {r: .600000024, g: .823529482, b: .898039281, a: 1} m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} @@ -16879,7 +17012,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: .904411793, g: .904411793, b: .904411793, a: 1} + m_Color: {r: .666666687, g: .666666687, b: .666666687, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: @@ -17671,7 +17804,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 2045088296} - m_RootOrder: 3 + m_RootOrder: 4 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -17692,7 +17825,7 @@ MonoBehaviour: isEnabled: 1 updateReference: {fileID: 1728688478} enabledColor: {r: .310000002, g: .75, b: .912999988, a: 1} - disabledColor: {r: .792156875, g: .792156875, b: .792156875, a: 1} + disabledColor: {r: .666666687, g: .666666687, b: .666666687, a: 1} --- !u!114 &1728688481 MonoBehaviour: m_ObjectHideFlags: 0 @@ -17713,7 +17846,7 @@ MonoBehaviour: m_SelectOnRight: {fileID: 0} m_Transition: 1 m_Colors: - m_NormalColor: {r: .79411763, g: .79411763, b: .79411763, a: 1} + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} m_PressedColor: {r: .600000024, g: .823529482, b: .898039281, a: 1} m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} @@ -20014,7 +20147,7 @@ RectTransform: m_Father: {fileID: 1079363870} m_RootOrder: 0 m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 20, y: 20} m_Pivot: {x: .5, y: .5} @@ -21151,6 +21284,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 930426943} + - {fileID: 440527254} - {fileID: 2083881766} - {fileID: 1649730298} - {fileID: 1728688479} @@ -21409,7 +21543,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 2045088296} - m_RootOrder: 4 + m_RootOrder: 5 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -21430,7 +21564,7 @@ MonoBehaviour: isEnabled: 0 updateReference: {fileID: 0} enabledColor: {r: .310000002, g: .75, b: .912999988, a: 1} - disabledColor: {r: .792156875, g: .792156875, b: .792156875, a: 1} + disabledColor: {r: .666666687, g: .666666687, b: .666666687, a: 1} --- !u!114 &2079280006 MonoBehaviour: m_ObjectHideFlags: 0 @@ -21451,7 +21585,7 @@ MonoBehaviour: m_SelectOnRight: {fileID: 0} m_Transition: 1 m_Colors: - m_NormalColor: {r: .792156875, g: .792156875, b: .792156875, a: 1} + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} m_PressedColor: {r: .592156887, g: .815686345, b: .890196145, a: 1} m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} @@ -21508,7 +21642,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: .904411793, g: .904411793, b: .904411793, a: 1} + m_Color: {r: .666666687, g: .666666687, b: .666666687, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: @@ -21560,7 +21694,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 2045088296} - m_RootOrder: 1 + m_RootOrder: 2 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -21586,7 +21720,7 @@ MonoBehaviour: m_SelectOnRight: {fileID: 0} m_Transition: 1 m_Colors: - m_NormalColor: {r: .792156875, g: .792156875, b: .792156875, a: 1} + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} m_PressedColor: {r: .588235319, g: .80392164, b: .878431439, a: 1} m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} @@ -21632,7 +21766,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: .904411793, g: .904411793, b: .904411793, a: 1} + m_Color: {r: .666666687, g: .666666687, b: .666666687, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: diff --git a/Assets/Scripts/Animation List/ListManager.cs b/Assets/Scripts/Animation List/ListManager.cs index 286ae5a..9cc58dd 100644 --- a/Assets/Scripts/Animation List/ListManager.cs +++ b/Assets/Scripts/Animation List/ListManager.cs @@ -148,8 +148,6 @@ public class ListManager : MonoBehaviour { private void changeLoadingState(bool active) { - Debug.Log(active ? "Loading..." : "Done"); - if (isLoading != active) { this.loadingItem.transform.SetParent(active ? contentPanel : null); diff --git a/Assets/Scripts/Animation List/SampleItem.cs b/Assets/Scripts/Animation List/SampleItem.cs index 9b0b17f..17bf3f5 100644 --- a/Assets/Scripts/Animation List/SampleItem.cs +++ b/Assets/Scripts/Animation List/SampleItem.cs @@ -9,7 +9,7 @@ public class SampleItem : MonoBehaviour { public void StartAnimation() { - GameObject.FindGameObjectWithTag("PlayerManager").GetComponent().start_inputfield_play(title.text); + GameObject.FindGameObjectWithTag("PlayerManager").GetComponent().playDictWord(title.text); } } diff --git a/Assets/Scripts/Player Manager/GenericPlayerManager.cs b/Assets/Scripts/Player Manager/GenericPlayerManager.cs index 151bf93..10907ad 100644 --- a/Assets/Scripts/Player Manager/GenericPlayerManager.cs +++ b/Assets/Scripts/Player Manager/GenericPlayerManager.cs @@ -117,7 +117,7 @@ public abstract class GenericPlayerManager : MonoBehaviour { } - public void stop_animations() + public void stopAll() { StopCoroutine("loadAndPlay"); loading = false; @@ -188,7 +188,7 @@ public abstract class GenericPlayerManager : MonoBehaviour { protected abstract void onPlayingStateChange(); - public void switchPauseState(bool paused) + public void setPauseState(bool paused) { if (this.paused != paused) { @@ -201,15 +201,11 @@ public abstract class GenericPlayerManager : MonoBehaviour { onPlayingStateChange(); } } - public void switchPauseState() - { - switchPauseState( ! paused); - } public bool play() { if (playing) - switchPauseState(); + setPauseState( ! paused); else play(true, true, true); @@ -228,7 +224,7 @@ public abstract class GenericPlayerManager : MonoBehaviour { if (loading) { if (stopLoading) - stop_animations(); + stopAll(); else return false; } @@ -371,28 +367,19 @@ public abstract class GenericPlayerManager : MonoBehaviour { spelled = false; } - //bool isFlag = false; - - //if (aniName[0] == '[') - //{ - if (flags.Contains(aniName)) - { - //isFlag = true; - lastAnimationSubtitle = ""; - playAnimation(Subtitle.TYPE_WORD, aniName, ""); - } - else - { - lastAnimationSubtitle = aniName; - playAnimation(Subtitle.TYPE_WORD, aniName); - } - //} - - /*if (isFlag) + if (flags.Contains(aniName)) + { + //isFlag = true; + lastAnimationSubtitle = ""; playAnimation(Subtitle.TYPE_WORD, aniName, ""); + } else - playAnimation(Subtitle.TYPE_WORD, aniName);*/ + { + lastAnimationSubtitle = aniName; + playAnimation(Subtitle.TYPE_WORD, aniName); + } } + // Soletra palavra else { diff --git a/Assets/Scripts/PlayerManager.cs b/Assets/Scripts/PlayerManager.cs index 0052104..4b1aaab 100644 --- a/Assets/Scripts/PlayerManager.cs +++ b/Assets/Scripts/PlayerManager.cs @@ -1,4 +1,4 @@ -//Log Dir http://docs.unity3d.com/Manual/LogFiles.html +//Log Dir http://docs.unity3d.com/Manual/LogFiles.html // requisiçao http get no unity // vlibras.lavid.ufpb.br:5000/glosa?texto=CASA%LAVID%123 @@ -23,45 +23,56 @@ public class PlayerManager : GenericPlayerManager { //private const string BASE_URL = "http://150.165.205.9/anims/AssetBundles/0_DefaultBundles/"; public InputField INFIELD; private int version = 1; - private bool thereIsConnection; public Canvas canvas_connection_error; private string[] randomAnimationNames = new string[] { "[BOCEJAR]", "[COCHILAR]", "[ESPREGUIÇADA]", - "[RELAXAR]" + //"[RELAXAR]" }; + public GameObject textButton; + public GameObject pauseButton; + public GameObject pauseMenu; + private SwitchImageAttribute pauseButtonImage; + public override void Start() { + this.pauseButtonImage = this.pauseButton.GetComponent(); + + if (this.pauseButtonImage == null) + Debug.Log("Could not retrieve SwitchImageAttribute from pauseButton"); + else + Debug.Log("SwitchImageAttribute from pauseButton retrieved"); + base.setRandomAnimations(new RandomAnimations(this, randomAnimationNames, 2, 1F), randomAnimationNames); base.Start(); - Application.ExternalCall("onLoadPlayer");//var onLoadPlayer = function(){} + // DEBUG: var onLoadPlayer = function(){} + Application.ExternalCall("onLoadPlayer"); voiceRecognizer = new VoiceRecognition(); Screen.fullScreen = false; } public void start_play() { - try { - base.play(); - } catch(Exception e) { - e.ToString();//Debug.Log(e+" :: Ops!"); - } + base.play(); } public void start_play(string glosa) { - try { - if (base.isLoading() || base.isPlaying()) - base.stop_animations(); + base.play(glosa); + } - base.play(glosa); - } catch(Exception e) { - e.ToString();//Debug.Log(e+" :: Ops!"); - } + public void playDictWord(string glosa) + { + base.glosa = glosa; + + // Stop loading, if loading + // Don't stop animations, if playing + // Load glosa, enqueue animations + base.play(true, false, true); } protected override WWW loadAssetBundle(string aniName) @@ -84,119 +95,122 @@ public class PlayerManager : GenericPlayerManager { return WWW.LoadFromCacheOrDownload(BASE_URL + aniName, version); } - protected override void onPlayingStateChange() {} - - IEnumerator translate() + protected override void onPlayingStateChange() { - WWW glosaRequest = new WWW(SERVER_URL + WWW.EscapeURL(base.glosa)); + Debug.Log("onPlayingStateChange"); - try { - waitForRequest(glosaRequest); - } catch (Exception e) { e.ToString(); } - - if (glosaRequest != null) + if (base.isPlaying()) { - loading_snippet.SetActive(true); - yield return glosaRequest; - loading_snippet.SetActive(false); + Debug.Log("isPlaying"); + this.textButton.SetActive(false); + this.pauseButton.SetActive(true); - if ( ! String.IsNullOrEmpty(glosaRequest.text)) + if (base.isPaused()) { - base.glosa = glosaRequest.text; - Debug.Log("Server answer: " + glosa); + Debug.Log("~~~ isPaused"); + this.pauseButtonImage.switchAttribute(false); } else { - base.glosa = base.glosa.ToUpper(); - Debug.Log("No answer: " + glosa); + Debug.Log("~~~ isPaused FALSE"); + this.pauseButtonImage.switchAttribute(true); } } - else Debug.Log ("eita"); + else + { + Debug.Log("isPlaying FALSE"); + this.textButton.SetActive(true); + this.pauseButton.SetActive(false); + } - base.play(); + Debug.Log("onPlayingStateChange END"); } - public void start_inputfield_play(string glosa) + // Called from microphone icon at main interface + public void callVoiceRecognizer() { - try { - base.glosa = glosa; - StartCoroutine("translate"); - } - catch (Exception e) { - Debug.Log (e+" :: Exception StartCourr"); - } + StartCoroutine("CallVoiceRecognizer"); } - public void start_inputfield_web_play() - { - try { - base.glosa = INFIELD.text; - StartCoroutine("translate"); - } - catch (Exception e) { - Debug.Log (e+" :: Exception StartCourr"); - } - } + private bool thereIsConnection = false; - protected IEnumerator waitForRequest(WWW www) + private IEnumerator CallVoiceRecognizer() { - yield return www.isDone; + if ( ! this.thereIsConnection) + { + this.thereIsConnection = true; - // check for errors - if (www.error == null) - Debug.Log("WWW Ok!: " + www.text); - else - Debug.Log("WWW Error: "+ www.error); - } + float timeTaken = 0.0F; + float maxTime = 2.0F; + + Ping testPing = new Ping("https://www.google.com.br"); - // Called from microphone icon at main interface - public void callVoiceRecognizer() - { - CheckConnection(); - if(thereIsConnection) - { - base.glosa = voiceRecognizer.callRecognition(); - if(!base.glosa.Equals("")) + while ( ! testPing.isDone) { - StartCoroutine(translate ()); + timeTaken += Time.deltaTime; + + if (timeTaken > maxTime) + { + this.thereIsConnection = false; + break; + } + + yield return null; } } - else + + if (this.thereIsConnection) { + string glosa = voiceRecognizer.callRecognition(); - Debug.Log("NO NET"); - DisplayConnectionError(); - //base.voiceRecognizer.callConnectionError(); - //base.voiceRecognizer.callConnectionError(); + if ( ! glosa.Equals("")) + StartCoroutine("translate", glosa); } - //base.voiceRecognizer.callConnectionError();*/ + else setConnectionErrorMessageStatus(true); } - void CheckConnection() + private IEnumerator translate(string glosa) { - thereIsConnection = false; - WWW www = new WWW("https://www.google.com.br"); - waitForRequest(www); + WWW glosaRequest = new WWW(SERVER_URL + WWW.EscapeURL(glosa)); + glosa = glosa.ToUpper(); - if(www.bytesDownloaded > 0){ - thereIsConnection = true; - //Debug.Log("connection ok"); - } - else{ - Debug.Log("no connection"); - thereIsConnection = false; - + if (glosaRequest != null) + { + loading_snippet.SetActive(true); + yield return glosaRequest.isDone; + loading_snippet.SetActive(false); + + if (glosaRequest.error != null) + { + if ( ! String.IsNullOrEmpty(glosaRequest.text)) + { + Debug.Log("Server answer: " + glosaRequest.text); + glosa = glosaRequest.text; + } + else Debug.Log("Error at PlayerManager.translate: empty answer."); + } + else Debug.Log("Error at PlayerManager.translate: (WWW) glosaRequest: " + glosaRequest.error); } - } + else Debug.Log ("Error at PlayerManager.translate: (WWW) glosaRequest is NULL."); - void DisplayConnectionError(){ - canvas_connection_error.enabled = true; - SetAvatarCollider(false); - ScreenReferences.HOME_SCREEN = false; + base.play(); } - public void HideConnectionError(){ - canvas_connection_error.enabled = false; - SetAvatarCollider(true); - ScreenReferences.HOME_SCREEN = true; + + /*private void CheckConnection() + { + this.thereIsConnection = false; + + WWW www = new WWW("https://www.google.com.br"); + waitForRequest(www); + + this.thereIsConnection = www.bytesDownloaded > 0; + }*/ + + private void setConnectionErrorMessageStatus(bool enabled) + { + canvas_connection_error.enabled = enabled; + SetAvatarCollider( ! enabled); + ScreenReferences.HOME_SCREEN = ! enabled; } + } diff --git a/Assets/Scripts/UI/SwitchImageColor.cs b/Assets/Scripts/UI/SwitchImageColor.cs index 9a6282d..c1e45fe 100644 --- a/Assets/Scripts/UI/SwitchImageColor.cs +++ b/Assets/Scripts/UI/SwitchImageColor.cs @@ -6,9 +6,6 @@ public class SwitchImageColor : SwitchImageAttribute { public Color enabledColor = new Color(0.31F, 0.75F, 0.913F, 1F); public Color disabledColor = new Color(1F, 1F, 1F, 1F); - - private Graphic buttonGraphic; - public override void updateAttribute() { diff --git a/Assets/Scripts/VoiceRecognition.cs b/Assets/Scripts/VoiceRecognition.cs index 85f5140..44f83c0 100644 --- a/Assets/Scripts/VoiceRecognition.cs +++ b/Assets/Scripts/VoiceRecognition.cs @@ -25,28 +25,26 @@ using System.Collections; using UnityEngine.UI; using System; -public class VoiceRecognition{ +public class VoiceRecognition { AndroidJavaClass unity; AndroidJavaObject currentActivity; string voiceText = ""; - - // Constructor public VoiceRecognition() { - #if !UNITY_EDITOR - unity = new AndroidJavaClass ("com.unity3d.player.UnityPlayer"); - currentActivity = unity.GetStatic ("currentActivity"); - #endif +#if !UNITY_EDITOR + unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); + currentActivity = unity.GetStatic("currentActivity"); +#endif } // Calls Google Speech from plugin method and returns recognized text public string callRecognition() { #if !UNITY_EDITOR - voiceText = currentActivity.Call ("callGoogleSpeech"); + voiceText = currentActivity.Call("callGoogleSpeech"); #endif return voiceText; -- libgit2 0.21.2