added simple UI
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
using VContainer;
|
||||
using VContainer.Unity;
|
||||
|
||||
namespace Darkmatter.App.LifetimeScopes
|
||||
{
|
||||
public class MainmenuLifetimeScope : BaseLifetimeScope
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b33198f3d36da52499636d20521cef9c
|
||||
8
Assets/Darkmatter/Code/Features/MainMenu.meta
Normal file
8
Assets/Darkmatter/Code/Features/MainMenu.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 99f56c35c78a8df4c864137f645cb7fa
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "Features.Mainmenu",
|
||||
"rootNamespace": "Darkmatter.Features.Mainmenu",
|
||||
"references": [
|
||||
"GUID:6a0a834eb41764f12ba55c3fb04a40cb",
|
||||
"GUID:c1c03c0e5b2f4412b9f2be1c20d6a9b1",
|
||||
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc",
|
||||
"GUID:68765d262e2128e4ab49c983f3411946"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24689bdd721a690468786e8d3718a343
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Darkmatter/Code/Features/MainMenu/Installers.meta
Normal file
8
Assets/Darkmatter/Code/Features/MainMenu/Installers.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 897e6d60e776fc648870bdd8e37d1bf0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
using Darkmatter.Libs.Installers;
|
||||
using UnityEngine;
|
||||
using VContainer;
|
||||
using VContainer.Unity;
|
||||
|
||||
namespace Darkmatter.Features.Mainmenu
|
||||
{
|
||||
public class MainmenuServiceModule: MonoBehaviour, IServiceModule
|
||||
{
|
||||
[SerializeField] private MainmenuView mainmenuView;
|
||||
public void Register(IContainerBuilder builder)
|
||||
{
|
||||
if(mainmenuView!= null)
|
||||
{
|
||||
builder.RegisterEntryPoint<MainmenuPresenter>().WithParameter(mainmenuView);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 11551a88f8a7aed4ea3d9b1333736a95
|
||||
8
Assets/Darkmatter/Code/Features/MainMenu/Mascot.meta
Normal file
8
Assets/Darkmatter/Code/Features/MainMenu/Mascot.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b253e003d7c03b74e8a92292c3597830
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using VContainer.Unity;
|
||||
|
||||
namespace Darkmatter.Features.Mainmenu
|
||||
{
|
||||
public class MainmenuPresenter : IStartable, IDisposable
|
||||
{
|
||||
private readonly MainmenuView _view;
|
||||
|
||||
public MainmenuPresenter(MainmenuView view)
|
||||
{
|
||||
_view = view;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
_view.OnPlayBtnClickedEvent += OnPlayBtnClicked;
|
||||
}
|
||||
|
||||
private void OnPlayBtnClicked()
|
||||
{
|
||||
Debug.Log("Play Btn Clicked");
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_view.OnPlayBtnClickedEvent -= OnPlayBtnClicked;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8133519fbded9f44e8500998f6f84a9d
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Darkmatter.Features.Mainmenu
|
||||
{
|
||||
public class MainmenuView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Button playBtn;
|
||||
public event Action OnPlayBtnClickedEvent;
|
||||
private void Start()
|
||||
{
|
||||
playBtn.onClick.AddListener(OnPlayBtnClicked);
|
||||
}
|
||||
|
||||
private void OnPlayBtnClicked()
|
||||
{
|
||||
OnPlayBtnClickedEvent?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2e90f858cdbce54abda9b9150c05a27
|
||||
Reference in New Issue
Block a user