Added BaseLifetimescope and gameplay scene
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14a5b12dfbd0540478508a72b0bcc3cc
|
||||
@@ -0,0 +1,8 @@
|
||||
using VContainer;
|
||||
|
||||
public class GameLifetimeScope : BaseLifetimeScope
|
||||
{
|
||||
protected override void Configure(IContainerBuilder builder)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ca410c053f074e1cba2f7041f500d34
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
8
Assets/Darkmatter/Code/Core/Contracts/Paper.meta
Normal file
8
Assets/Darkmatter/Code/Core/Contracts/Paper.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1f91f821f605f4d1ba438f41e4232df0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Darkmatter.Core.Contracts.Paper
|
||||
{
|
||||
public interface IArtInputBridge
|
||||
{
|
||||
bool TryScreenToArtWorld(Vector2 screenPos, out Vector2 artWorldPos);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39f0c8bfbf53c4b299d6beb0a01fd32b
|
||||
13
Assets/Darkmatter/Code/Core/Contracts/Paper/IPaperRig.cs
Normal file
13
Assets/Darkmatter/Code/Core/Contracts/Paper/IPaperRig.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a51496fa9463b41f7baeb4ff40055835
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf985c17631794cc8ba5e0b581de7b4e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bffc27fabc18d4014bee348129b73cf7
|
||||
@@ -3,6 +3,7 @@ namespace Darkmatter.Core.Enums.Services.Camera
|
||||
public enum CameraType
|
||||
{
|
||||
MainCamera,
|
||||
UICamera
|
||||
UICamera,
|
||||
ArtCamera
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user