Removed Unnecessary stuff
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f555e5ed9c45e44cd804a598d08efc6c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f26c384b6ed9f482b8b3f325ba5e06f5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,15 +0,0 @@
|
||||
using System;
|
||||
using Darkmatter.Core.Contracts.Features.Paper;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Darkmatter.Features.PaperRig
|
||||
{
|
||||
[Serializable]
|
||||
public class PaperRig : IPaperRig
|
||||
{
|
||||
[SerializeField] private Camera artCamera;
|
||||
[SerializeField] private RectTransform displayRect;
|
||||
public Camera ArtCamera => artCamera;
|
||||
public RectTransform DisplayRect => displayRect;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd7db17694325451c8441d824b221199
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"name": "Features.PaperRig",
|
||||
"rootNamespace": "Darkmatter.Features.PaperRig",
|
||||
"references": [
|
||||
"GUID:6a0a834eb41764f12ba55c3fb04a40cb",
|
||||
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc",
|
||||
"GUID:c1c03c0e5b2f4412b9f2be1c20d6a9b1"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c54b3e6267ecb41b68cc06079d4b39f2
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0156c96d959344bfbf0c1212ea68d473
|
||||
timeCreated: 1779859615
|
||||
@@ -1,45 +0,0 @@
|
||||
using Darkmatter.Core.Contracts.Features.Paper;
|
||||
using Darkmatter.Core.Contracts.Services.Camera;
|
||||
using UnityEngine;
|
||||
using CameraType = Darkmatter.Core.Enums.Services.Camera.CameraType;
|
||||
|
||||
namespace Darkmatter.Features.PaperRig.Darkmatter.Code.Features.PaperRig.Input
|
||||
{
|
||||
public class ArtInputBridge : IArtInputBridge
|
||||
{
|
||||
private readonly IPaperRig _paperRig;
|
||||
private ICameraService _cameraService;
|
||||
|
||||
public ArtInputBridge(IPaperRig paperRig, ICameraService cameraService)
|
||||
{
|
||||
_paperRig = paperRig;
|
||||
_cameraService = cameraService;
|
||||
}
|
||||
|
||||
public bool TryScreenToArtWorld(Vector2 screenPos, out Vector2 artWorldPos)
|
||||
{
|
||||
var rectT = _paperRig.DisplayRect;
|
||||
var uiCamera = _cameraService.GetCamera(CameraType.UICamera);
|
||||
if (!RectTransformUtility.ScreenPointToLocalPointInRectangle(
|
||||
rectT, screenPos, uiCamera, out var local))
|
||||
{
|
||||
artWorldPos = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
var rect = rectT.rect;
|
||||
var uv = new Vector2(
|
||||
(local.x - rect.xMin) / rect.width,
|
||||
(local.y - rect.yMin) / rect.height);
|
||||
|
||||
if (uv.x < 0 || uv.x > 1 || uv.y < 0 || uv.y > 1)
|
||||
{
|
||||
artWorldPos = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
artWorldPos = _paperRig.ArtCamera.ViewportToWorldPoint(uv);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0337c48e57934443887873de8e382d4e
|
||||
timeCreated: 1779859625
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ecba85ae080a44ef9b1a1d55f3f86659
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,20 +0,0 @@
|
||||
using Darkmatter.Core.Contracts.Features.Paper;
|
||||
using Darkmatter.Features.PaperRig.Darkmatter.Code.Features.PaperRig.Input;
|
||||
using Darkmatter.Libs.Installers;
|
||||
using UnityEngine;
|
||||
using VContainer;
|
||||
using VContainer.Unity;
|
||||
|
||||
namespace Darkmatter.Features.PaperRig
|
||||
{
|
||||
public class PaperRigServiceModule : MonoBehaviour, IServiceModule
|
||||
{
|
||||
[SerializeField] private PaperRig paperRig;
|
||||
|
||||
public void Register(IContainerBuilder builder)
|
||||
{
|
||||
builder.RegisterComponent<IPaperRig>(paperRig);
|
||||
builder.Register<IArtInputBridge, ArtInputBridge>(Lifetime.Singleton);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef7eaa67fc66d48c88c8ec12d27f9b14
|
||||
Reference in New Issue
Block a user