diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 4b5c9b6..9a2bd05 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -123,6 +123,140 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &17752608 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 17752609} + - component: {fileID: 17752611} + - component: {fileID: 17752610} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &17752609 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 17752608} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 439702000} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &17752610 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 17752608} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: X + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4281479730 + m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &17752611 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 17752608} + m_CullTransparentMesh: 1 --- !u!1 &311490068 GameObject: m_ObjectHideFlags: 0 @@ -135,6 +269,7 @@ GameObject: - component: {fileID: 311490071} - component: {fileID: 311490070} - component: {fileID: 311490069} + - component: {fileID: 311490073} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -218,6 +353,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 379057221} + - {fileID: 439702000} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -225,6 +361,19 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} +--- !u!114 &311490073 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 311490068} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a6ab8726a3100840b7f1ba17e278262, type: 3} + m_Name: + m_EditorClassIdentifier: + text: {fileID: 379057222} --- !u!1 &379057220 GameObject: m_ObjectHideFlags: 0 @@ -309,10 +458,10 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 276.84 + m_fontSize: 72 m_fontSizeBase: 276.84 m_fontWeight: 400 - m_enableAutoSizing: 0 + m_enableAutoSizing: 1 m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 @@ -359,6 +508,140 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 379057220} m_CullTransparentMesh: 1 +--- !u!1 &439701999 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 439702000} + - component: {fileID: 439702004} + - component: {fileID: 439702003} + - component: {fileID: 439702002} + - component: {fileID: 439702001} + m_Layer: 5 + m_Name: CloseButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &439702000 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 439701999} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 17752609} + m_Father: {fileID: 311490072} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 30, y: 30} + m_Pivot: {x: 1, y: 1} +--- !u!114 &439702001 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 439701999} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f297a9343fac1cf42b0de26c43db994f, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &439702002 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 439701999} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + 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: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 439702003} + m_OnClick: + m_PersistentCalls: + m_Calls: [] +--- !u!114 &439702003 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 439701999} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &439702004 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 439701999} + m_CullTransparentMesh: 1 --- !u!1 &501733675 GameObject: m_ObjectHideFlags: 0 @@ -370,7 +653,6 @@ GameObject: - component: {fileID: 501733678} - component: {fileID: 501733677} - component: {fileID: 501733676} - - component: {fileID: 501733679} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -452,19 +734,6 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &501733679 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 501733675} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7a6ab8726a3100840b7f1ba17e278262, type: 3} - m_Name: - m_EditorClassIdentifier: - text: {fileID: 379057222} --- !u!1 &1333164885 GameObject: m_ObjectHideFlags: 0 @@ -533,6 +802,50 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1652443526 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1652443528} + - component: {fileID: 1652443527} + m_Layer: 0 + m_Name: Dependencies + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1652443527 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1652443526} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2892d40567e945b585f5986911ae2bcd, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1652443528 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1652443526} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 @@ -540,3 +853,4 @@ SceneRoots: - {fileID: 501733678} - {fileID: 311490072} - {fileID: 1333164888} + - {fileID: 1652443528} diff --git a/Assets/Scripts/ClickTest.cs b/Assets/Scripts/ClickTest.cs deleted file mode 100644 index 1e9ae69..0000000 --- a/Assets/Scripts/ClickTest.cs +++ /dev/null @@ -1,29 +0,0 @@ -using SatorImaging.AppWindowUtility; -using TMPro; -using UnityEngine; - -public class ClickTest : MonoBehaviour { - [SerializeField] private TMP_Text text; - private int _presses; - private bool _pressed; - - //VK_OEM_2 = 0xBF | cedilla - //https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes - private const int Key = 0xBF; - - private void OnEnable() { - AppWindowUtility.AlwaysOnTop = true; - } - - private void Update() { - if (_pressed && Win32API.GetAsyncKeyState(Key) == 0) { - _pressed = false; - return; - } - if (!_pressed && Win32API.GetAsyncKeyState(Key) != 0) { - _presses++; - text.text = _presses.ToString(); - _pressed = true; - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Domain.meta b/Assets/Scripts/Domain.meta new file mode 100644 index 0000000..4c6b995 --- /dev/null +++ b/Assets/Scripts/Domain.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 31f569b778d15a1458d7cd3c75abb2a8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Domain/Model.cs b/Assets/Scripts/Domain/Model.cs new file mode 100644 index 0000000..eb7d1de --- /dev/null +++ b/Assets/Scripts/Domain/Model.cs @@ -0,0 +1,13 @@ +namespace Domain { + public class Model { + public int Score { private set; get; } + + public Model(int score) { + Score = score; + } + + public void AddScore(int score) { + Score += score; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Domain/Model.cs.meta b/Assets/Scripts/Domain/Model.cs.meta new file mode 100644 index 0000000..1c1bd6b --- /dev/null +++ b/Assets/Scripts/Domain/Model.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6de5729981004dd98a2b547a5acf3bb2 +timeCreated: 1712931104 \ No newline at end of file diff --git a/Assets/Scripts/Domain/SantJordi.Domain.asmdef b/Assets/Scripts/Domain/SantJordi.Domain.asmdef new file mode 100644 index 0000000..ee23999 --- /dev/null +++ b/Assets/Scripts/Domain/SantJordi.Domain.asmdef @@ -0,0 +1,3 @@ +{ + "name": "SantJordi.Domain" +} diff --git a/Assets/Scripts/Domain/SantJordi.Domain.asmdef.meta b/Assets/Scripts/Domain/SantJordi.Domain.asmdef.meta new file mode 100644 index 0000000..49dd07c --- /dev/null +++ b/Assets/Scripts/Domain/SantJordi.Domain.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 23c7c01f8c5436c429399011615ce636 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Domain/Win32API.cs b/Assets/Scripts/Domain/Win32API.cs new file mode 100644 index 0000000..67b3ad3 --- /dev/null +++ b/Assets/Scripts/Domain/Win32API.cs @@ -0,0 +1,29 @@ +using System.Runtime.InteropServices; + +namespace Domain { + public static class Win32API { + private static bool _cTrencadaWasPressed; + private static bool _cTrencadaPressed; + //VK_OEM_2 = 0xBF | cedilla + //https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes + private const int Key = 0xBF; + + public static void UpdateInput() { + _cTrencadaWasPressed = _cTrencadaPressed; + if (_cTrencadaPressed && GetAsyncKeyState(Key) == 0) { + _cTrencadaPressed = false; + return; + } + if (!_cTrencadaPressed && GetAsyncKeyState(Key) != 0) { + _cTrencadaPressed = true; + } + } + + public static bool CTrencadaDown() { + return _cTrencadaPressed && !_cTrencadaWasPressed; + } + + [DllImport("User32.dll")] + private static extern short GetAsyncKeyState(int vKey); + } +} \ No newline at end of file diff --git a/Assets/Scripts/Win32API.cs.meta b/Assets/Scripts/Domain/Win32API.cs.meta similarity index 100% rename from Assets/Scripts/Win32API.cs.meta rename to Assets/Scripts/Domain/Win32API.cs.meta diff --git a/Assets/Scripts/Presenter.meta b/Assets/Scripts/Presenter.meta new file mode 100644 index 0000000..6b85ce8 --- /dev/null +++ b/Assets/Scripts/Presenter.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a8f42965ba1e4258a0b35587e17f86db +timeCreated: 1712930859 \ No newline at end of file diff --git a/Assets/Scripts/Presenter/CTrencadaClick.cs b/Assets/Scripts/Presenter/CTrencadaClick.cs new file mode 100644 index 0000000..11279c4 --- /dev/null +++ b/Assets/Scripts/Presenter/CTrencadaClick.cs @@ -0,0 +1,18 @@ +using Domain; + +namespace Presenter { + public class CTrencadaClick { + private readonly Model _model; + private readonly ICTrencadaInput _view; + + public CTrencadaClick(Model model, ICTrencadaInput view) { + _model = model; + _view = view; + } + + public void Execute() { + _model.AddScore(1); + _view.UpdateView(_model.Score); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Presenter/CTrencadaClick.cs.meta b/Assets/Scripts/Presenter/CTrencadaClick.cs.meta new file mode 100644 index 0000000..4cb98e2 --- /dev/null +++ b/Assets/Scripts/Presenter/CTrencadaClick.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6cbffd8965b14583b8d2b3d4dc852e8d +timeCreated: 1712930886 \ No newline at end of file diff --git a/Assets/Scripts/Presenter/ICTrencadaInput.cs b/Assets/Scripts/Presenter/ICTrencadaInput.cs new file mode 100644 index 0000000..6d137ba --- /dev/null +++ b/Assets/Scripts/Presenter/ICTrencadaInput.cs @@ -0,0 +1,5 @@ +namespace Presenter { + public interface ICTrencadaInput { + void UpdateView(int score); + } +} \ No newline at end of file diff --git a/Assets/Scripts/Presenter/ICTrencadaInput.cs.meta b/Assets/Scripts/Presenter/ICTrencadaInput.cs.meta new file mode 100644 index 0000000..6e8dfaf --- /dev/null +++ b/Assets/Scripts/Presenter/ICTrencadaInput.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ad480317372b4bde9e61c8cf5b56ba72 +timeCreated: 1712931293 \ No newline at end of file diff --git a/Assets/Scripts/Presenter/SantJordi.Presenter.asmdef b/Assets/Scripts/Presenter/SantJordi.Presenter.asmdef new file mode 100644 index 0000000..0020ad1 --- /dev/null +++ b/Assets/Scripts/Presenter/SantJordi.Presenter.asmdef @@ -0,0 +1,4 @@ +{ + "name": "SantJordi.Presenter", + "references":[ "GUID:23c7c01f8c5436c429399011615ce636" ] +} diff --git a/Assets/Scripts/Presenter/SantJordi.Presenter.asmdef.meta b/Assets/Scripts/Presenter/SantJordi.Presenter.asmdef.meta new file mode 100644 index 0000000..0e7abe1 --- /dev/null +++ b/Assets/Scripts/Presenter/SantJordi.Presenter.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d9011953b32919841a6c357880a50fb3 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/View.meta b/Assets/Scripts/View.meta new file mode 100644 index 0000000..94ffd87 --- /dev/null +++ b/Assets/Scripts/View.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c9bbab33dc7baf84c96e55ad7ae6f129 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/View/CTrencadaInput.cs b/Assets/Scripts/View/CTrencadaInput.cs new file mode 100644 index 0000000..11acba3 --- /dev/null +++ b/Assets/Scripts/View/CTrencadaInput.cs @@ -0,0 +1,32 @@ +using Domain; +using Presenter; +using SatorImaging.AppWindowUtility; +using TMPro; +using UnityEngine; + +namespace View { + public class CTrencadaInput : MonoBehaviour, ICTrencadaInput { + [SerializeField] private TMP_Text text; + private CTrencadaClick _click; + + private void Start() { + AppWindowUtility.AlwaysOnTop = true; + + _click = FindObjectOfType().CTrencadaClick; + } + + private void Update() { + CheckInput(); + } + + private void CheckInput() { + Win32API.UpdateInput(); + if (Win32API.CTrencadaDown()) + _click.Execute(); + } + + public void UpdateView(int score) { + text.text = score.ToString(); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/ClickTest.cs.meta b/Assets/Scripts/View/CTrencadaInput.cs.meta similarity index 100% rename from Assets/Scripts/ClickTest.cs.meta rename to Assets/Scripts/View/CTrencadaInput.cs.meta diff --git a/Assets/Scripts/View/CloseButton.cs b/Assets/Scripts/View/CloseButton.cs new file mode 100644 index 0000000..fcd3fbc --- /dev/null +++ b/Assets/Scripts/View/CloseButton.cs @@ -0,0 +1,20 @@ +using UnityEngine; +using UnityEngine.UI; + +namespace View { + public class CloseButton : MonoBehaviour { + private Button _button; + + private void Start() { + _button = GetComponent