feat: Setup MVP
This commit is contained in:
parent
14fdd4558e
commit
1dd490b7ed
27 changed files with 555 additions and 52 deletions
|
@ -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}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
8
Assets/Scripts/Domain.meta
Normal file
8
Assets/Scripts/Domain.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 31f569b778d15a1458d7cd3c75abb2a8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
13
Assets/Scripts/Domain/Model.cs
Normal file
13
Assets/Scripts/Domain/Model.cs
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
3
Assets/Scripts/Domain/Model.cs.meta
Normal file
3
Assets/Scripts/Domain/Model.cs.meta
Normal file
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6de5729981004dd98a2b547a5acf3bb2
|
||||
timeCreated: 1712931104
|
3
Assets/Scripts/Domain/SantJordi.Domain.asmdef
Normal file
3
Assets/Scripts/Domain/SantJordi.Domain.asmdef
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"name": "SantJordi.Domain"
|
||||
}
|
7
Assets/Scripts/Domain/SantJordi.Domain.asmdef.meta
Normal file
7
Assets/Scripts/Domain/SantJordi.Domain.asmdef.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 23c7c01f8c5436c429399011615ce636
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
29
Assets/Scripts/Domain/Win32API.cs
Normal file
29
Assets/Scripts/Domain/Win32API.cs
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
3
Assets/Scripts/Presenter.meta
Normal file
3
Assets/Scripts/Presenter.meta
Normal file
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a8f42965ba1e4258a0b35587e17f86db
|
||||
timeCreated: 1712930859
|
18
Assets/Scripts/Presenter/CTrencadaClick.cs
Normal file
18
Assets/Scripts/Presenter/CTrencadaClick.cs
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
3
Assets/Scripts/Presenter/CTrencadaClick.cs.meta
Normal file
3
Assets/Scripts/Presenter/CTrencadaClick.cs.meta
Normal file
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6cbffd8965b14583b8d2b3d4dc852e8d
|
||||
timeCreated: 1712930886
|
5
Assets/Scripts/Presenter/ICTrencadaInput.cs
Normal file
5
Assets/Scripts/Presenter/ICTrencadaInput.cs
Normal file
|
@ -0,0 +1,5 @@
|
|||
namespace Presenter {
|
||||
public interface ICTrencadaInput {
|
||||
void UpdateView(int score);
|
||||
}
|
||||
}
|
3
Assets/Scripts/Presenter/ICTrencadaInput.cs.meta
Normal file
3
Assets/Scripts/Presenter/ICTrencadaInput.cs.meta
Normal file
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ad480317372b4bde9e61c8cf5b56ba72
|
||||
timeCreated: 1712931293
|
4
Assets/Scripts/Presenter/SantJordi.Presenter.asmdef
Normal file
4
Assets/Scripts/Presenter/SantJordi.Presenter.asmdef
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "SantJordi.Presenter",
|
||||
"references":[ "GUID:23c7c01f8c5436c429399011615ce636" ]
|
||||
}
|
7
Assets/Scripts/Presenter/SantJordi.Presenter.asmdef.meta
Normal file
7
Assets/Scripts/Presenter/SantJordi.Presenter.asmdef.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d9011953b32919841a6c357880a50fb3
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/View.meta
Normal file
8
Assets/Scripts/View.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c9bbab33dc7baf84c96e55ad7ae6f129
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
32
Assets/Scripts/View/CTrencadaInput.cs
Normal file
32
Assets/Scripts/View/CTrencadaInput.cs
Normal file
|
@ -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<Dependencies>().CTrencadaClick;
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
CheckInput();
|
||||
}
|
||||
|
||||
private void CheckInput() {
|
||||
Win32API.UpdateInput();
|
||||
if (Win32API.CTrencadaDown())
|
||||
_click.Execute();
|
||||
}
|
||||
|
||||
public void UpdateView(int score) {
|
||||
text.text = score.ToString();
|
||||
}
|
||||
}
|
||||
}
|
20
Assets/Scripts/View/CloseButton.cs
Normal file
20
Assets/Scripts/View/CloseButton.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace View {
|
||||
public class CloseButton : MonoBehaviour {
|
||||
private Button _button;
|
||||
|
||||
private void Start() {
|
||||
_button = GetComponent<Button>();
|
||||
_button.onClick.AddListener(CloseClicked);
|
||||
}
|
||||
|
||||
private void CloseClicked() {
|
||||
#if UNITY_EDITOR
|
||||
Debug.Log("Quit");
|
||||
#endif
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/View/CloseButton.cs.meta
Normal file
11
Assets/Scripts/View/CloseButton.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f297a9343fac1cf42b0de26c43db994f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
18
Assets/Scripts/View/Dependencies.cs
Normal file
18
Assets/Scripts/View/Dependencies.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using Domain;
|
||||
using Presenter;
|
||||
using UnityEngine;
|
||||
|
||||
namespace View {
|
||||
public class Dependencies : MonoBehaviour {
|
||||
public CTrencadaClick CTrencadaClick { private set; get; }
|
||||
public Model Model { private set; get; }
|
||||
|
||||
private void Awake() {
|
||||
Model = new Model(0);
|
||||
|
||||
ICTrencadaInput input = FindObjectOfType<CTrencadaInput>();
|
||||
CTrencadaClick = new CTrencadaClick(Model, input);
|
||||
}
|
||||
}
|
||||
}
|
3
Assets/Scripts/View/Dependencies.cs.meta
Normal file
3
Assets/Scripts/View/Dependencies.cs.meta
Normal file
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2892d40567e945b585f5986911ae2bcd
|
||||
timeCreated: 1712931517
|
19
Assets/Scripts/View/SantJordi.View.asmdef
Normal file
19
Assets/Scripts/View/SantJordi.View.asmdef
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "SantJordi.View",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:23c7c01f8c5436c429399011615ce636",
|
||||
"GUID:d9011953b32919841a6c357880a50fb3",
|
||||
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
||||
"GUID:1220ccfff01d26041a9bb8cd7ae584af"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
7
Assets/Scripts/View/SantJordi.View.asmdef.meta
Normal file
7
Assets/Scripts/View/SantJordi.View.asmdef.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fcb674ef5c27916468ce43c3ae3e4ccd
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,6 +0,0 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
public static class Win32API {
|
||||
[DllImport("User32.dll")]
|
||||
public static extern short GetAsyncKeyState(int vKey);
|
||||
}
|
|
@ -43,7 +43,7 @@ PlayerSettings:
|
|||
m_VirtualRealitySplashScreen: {fileID: 0}
|
||||
m_HolographicTrackingLossScreen: {fileID: 0}
|
||||
defaultScreenWidth: 480
|
||||
defaultScreenHeight: 480
|
||||
defaultScreenHeight: 850
|
||||
defaultScreenWidthWeb: 960
|
||||
defaultScreenHeightWeb: 600
|
||||
m_StereoRenderingPath: 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue