feat: Setup MVP
This commit is contained in:
parent
14fdd4558e
commit
1dd490b7ed
27 changed files with 555 additions and 52 deletions
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();
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/View/CTrencadaInput.cs.meta
Normal file
11
Assets/Scripts/View/CTrencadaInput.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7a6ab8726a3100840b7f1ba17e278262
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
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:
|
Loading…
Add table
Add a link
Reference in a new issue