Added BaseLifetimescope and gameplay scene

This commit is contained in:
Savya Bikram Shah
2026-05-26 18:59:54 +05:45
parent a1ba052ece
commit 0b4aeb8fd8
24 changed files with 647 additions and 133 deletions

View File

@@ -0,0 +1,18 @@
using Darkmatter.Libs.Installers;
using UnityEngine;
using VContainer;
using VContainer.Unity;
public abstract class BaseLifetimeScope : 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: 14a5b12dfbd0540478508a72b0bcc3cc

View File

@@ -0,0 +1,8 @@
using VContainer;
public class GameLifetimeScope : BaseLifetimeScope
{
protected override void Configure(IContainerBuilder builder)
{
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 4ca410c053f074e1cba2f7041f500d34

View File

@@ -1,18 +1,9 @@
using Darkmatter.Libs.Installers;
using UnityEngine;
using VContainer;
using VContainer.Unity;
public class RootLifetimeScope : LifetimeScope
public class RootLifetimeScope : BaseLifetimeScope
{
[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,8 @@
fileFormatVersion: 2
guid: 1f91f821f605f4d1ba438f41e4232df0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
using UnityEngine;
namespace Darkmatter.Core.Contracts.Paper
{
public interface IArtInputBridge
{
bool TryScreenToArtWorld(Vector2 screenPos, out Vector2 artWorldPos);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 39f0c8bfbf53c4b299d6beb0a01fd32b

View File

@@ -0,0 +1,13 @@
using UnityEngine;
namespace Darkmatter.Core.Contracts.Paper
{
public interface IPaperRig
{
Camera ArtCamera { get; }
RenderTexture Surface { get; }
Vector2Int SurfaceSize { get; }
float DesignHalfSize { get; }
Transform PaperRoot { get; }
}
}

View File

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

View File

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

View File

@@ -0,0 +1,12 @@
using System.Threading;
using Cysharp.Threading.Tasks;
namespace Darkmatter.Core.Contracts.Services.Capture
{
public interface ICaptureService
{
UniTask<byte[]> CapturePngAsync(CancellationToken cancellationToken = default);
UniTask<byte[]> CaptureThumbnailPngAsync(int size, CancellationToken cancellationToken = default);
}
}

View File

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

View File

@@ -3,6 +3,7 @@ namespace Darkmatter.Core.Enums.Services.Camera
public enum CameraType
{
MainCamera,
UICamera
UICamera,
ArtCamera
}
}

View File

@@ -17,9 +17,9 @@ namespace Darkmatter.Services.Camera.Installers
var cameras = new Dictionary<CameraType, UnityEngine.Camera>
{
{ CameraType.MainCamera, mainCamera },
{ CameraType.UICamera, uiCamera },
{ CameraType.UICamera, uiCamera }
};
builder.Register<ICameraService, CameraService>(Lifetime.Singleton);
builder.Register<ICameraService, CameraService>(Lifetime.Singleton).WithParameter(cameras);
}
}
}