Initial Setup

This commit is contained in:
Savya Bikram Shah
2026-05-26 18:45:12 +05:45
parent 8d599a6396
commit a1ba052ece
48 changed files with 2393 additions and 781 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 90f7514f0c81b4f4e93a85a4b4279914
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,20 @@
{
"name": "Darkmatter.App",
"rootNamespace": "",
"references": [
"GUID:6a0a834eb41764f12ba55c3fb04a40cb",
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc",
"GUID:f51ebe6a0ceec4240a699833d6309b23",
"GUID:c1c03c0e5b2f4412b9f2be1c20d6a9b1",
"GUID:80ecb87cae9c44d19824e70ea7229748"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4a17b34a5422c458ea460613a87c5a08
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8e8bdb018476d4d6e8c40e4241d86c61
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,18 @@
using Darkmatter.Libs.Installers;
using UnityEngine;
using VContainer;
using VContainer.Unity;
public class RootLifetimeScope : LifetimeScope
{
[SerializeField] private MonoBehaviour[] serviceModules;
protected override void Configure(IContainerBuilder builder)
{
foreach (var module in serviceModules)
{
if (module is IServiceModule serviceModule)
serviceModule.Register(builder);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: cdbf68f1689a84f7588ae13b63f7a3c9

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7c319c820c1ff4a589f48c8057958005
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,10 @@
using Darkmatter.Core.Enums.Services.Camera;
namespace Darkmatter.Core.Contracts.Services.Camera
{
public interface ICameraService
{
void RegisterCamera(UnityEngine.Camera camera, CameraType type);
UnityEngine.Camera GetCamera(CameraType type = CameraType.MainCamera);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6a548291923054b1eafd9f7421415924

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f8c5a5b38d3aa43adae4dd7df1b8184c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,12 @@
using System;
using UnityEngine;
namespace Darkmatter.Core.Contracts.Services.Inputs
{
public interface IInputReader
{
Vector2 TouchPosition { get; }
event Action OnTouchStart;
event Action OnTouchEnd;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 882d89c37a9f543c09ebe4b15395da7d

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ce4ae8007dffc4bd5834c1b1df2ca060
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
namespace Darkmatter.Core.Enums.Services.Camera
{
public enum CameraType
{
MainCamera,
UICamera
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 99aa5bc838df3456b9f2ab1acb2d52a3

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3ef8ad108b40144fd97398adf29630d2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8341b25664e9a41bab38767a0705869f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,25 @@
using System.Collections.Generic;
using Darkmatter.Core.Contracts.Services.Camera;
using Darkmatter.Libs.Installers;
using UnityEngine;
using VContainer;
using CameraType = Darkmatter.Core.Enums.Services.Camera.CameraType;
namespace Darkmatter.Services.Camera.Installers
{
public class CameraServiceModule : MonoBehaviour, IServiceModule
{
[SerializeField] private UnityEngine.Camera mainCamera;
[SerializeField] private UnityEngine.Camera uiCamera;
public void Register(IContainerBuilder builder)
{
var cameras = new Dictionary<CameraType, UnityEngine.Camera>
{
{ CameraType.MainCamera, mainCamera },
{ CameraType.UICamera, uiCamera },
};
builder.Register<ICameraService, CameraService>(Lifetime.Singleton);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d739bbb9f94e0441abcf2a1e7c1fca80

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2fd5ef07de078438f89d978864c339ad
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
using System.Collections.Generic;
using Darkmatter.Core.Contracts.Services.Camera;
using Darkmatter.Core.Enums.Services.Camera;
namespace Darkmatter.Services.Camera
{
public class CameraService : ICameraService
{
private readonly Dictionary<CameraType, UnityEngine.Camera> _cameras = new();
public void RegisterCamera(UnityEngine.Camera camera, CameraType type) => _cameras.Add(type, camera);
public CameraService(Dictionary<CameraType, UnityEngine.Camera> cameras)
{
_cameras = cameras;
}
public UnityEngine.Camera GetCamera(CameraType type = CameraType.MainCamera)
{
return _cameras.GetValueOrDefault(type);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 19e142c4ae83144e6a3d391d744786bc

View File

@@ -0,0 +1,18 @@
{
"name": "Services.Camera",
"rootNamespace": "Darkmatter.Services.Camera",
"references": [
"GUID:6a0a834eb41764f12ba55c3fb04a40cb",
"GUID:c1c03c0e5b2f4412b9f2be1c20d6a9b1",
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5250d5b552ecf4265adb8b45c180280b
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d54fa8b2c22014496a84c508d897dcdd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 88abeaac3da9d499288f8b5a1830cebc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6cc101d67503b4fc09ebcac4fecbcea9

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 588d1c926497b491c96d2f405876b176
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,19 @@
using Darkmatter.Core.Contracts.Services.Inputs;
using Darkmatter.Libs.Installers;
using Darkmatter.Services.Inputs.Readers;
using UnityEngine;
using VContainer;
using VContainer.Unity;
namespace Darkmatter.Services.Inputs
{
public class InputServiceModule : MonoBehaviour, IServiceModule
{
[SerializeField] private InputReaderSO inputReaderSO;
public void Register(IContainerBuilder builder)
{
builder.RegisterComponent<IInputReader>(inputReaderSO);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1b23ca8ea5ee647ddba0712811953811

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2e8e28c4942b5410d962cbff40ac302f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
using System;
using Darkmatter.Core.Contracts.Services.Inputs;
using UnityEngine;
using UnityEngine.InputSystem;
namespace Darkmatter.Services.Inputs.Readers
{
[CreateAssetMenu(menuName = "Darkmatter/Inputs/New Input Reader")]
public class InputReaderSO : ScriptableObject, IInputReader, GameInputs.IPlayerActions
{
public Vector2 TouchPosition { get; private set; }
public event Action OnTouchStart;
public event Action OnTouchEnd;
private GameInputs _gameInputActions;
private void OnEnable()
{
_gameInputActions = new GameInputs();
_gameInputActions.Player.SetCallbacks(this);
_gameInputActions.Enable();
}
public void OnTouchPosition(InputAction.CallbackContext context)
{
TouchPosition = context.ReadValue<Vector2>();
}
public void OnTouched(InputAction.CallbackContext context)
{
if(context.started)
OnTouchStart?.Invoke();
else if(context.canceled)
OnTouchEnd?.Invoke();
}
private void OnDisable()
{
if (_gameInputActions != null)
{
_gameInputActions.Disable();
_gameInputActions.Dispose();
_gameInputActions = null;
}
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c7a7f36a3426c43b7a1ceeaa853bdc3e

View File

@@ -0,0 +1,19 @@
{
"name": "Services.Inputs",
"rootNamespace": "Darkmatter.Services.Inputs",
"references": [
"GUID:6a0a834eb41764f12ba55c3fb04a40cb",
"GUID:c1c03c0e5b2f4412b9f2be1c20d6a9b1",
"GUID:75469ad4d38634e559750d17036d5f7c",
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 68042734671ce4660bff89e042777454
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: