ShapeBuilder Done
This commit is contained in:
@@ -10,7 +10,7 @@ namespace Darkmatter.Core.Contracts.Features.DrawingCatalog
|
|||||||
string Id { get; }
|
string Id { get; }
|
||||||
string DisplayName { get; }
|
string DisplayName { get; }
|
||||||
Sprite DefaultThumbnail { get; }
|
Sprite DefaultThumbnail { get; }
|
||||||
Sprite PaperBackground { get; }
|
GameObject Prefab { get; }
|
||||||
IReadOnlyList<ShapeSO> Pieces { get; }
|
IReadOnlyList<ShapeSO> Pieces { get; }
|
||||||
IReadOnlyList<ColorRegionDTO> Regions { get; }
|
IReadOnlyList<ColorRegionDTO> Regions { get; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ddd3ece612334da5befd516d65ddc88c
|
||||||
|
timeCreated: 1779952530
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Darkmatter.Core.Contracts.Features.GameplayFlow;
|
||||||
|
|
||||||
|
public interface IGameplaySceneRefs
|
||||||
|
{
|
||||||
|
RectTransform PaperRoot { get; }
|
||||||
|
RectTransform SlotsParent { get; }
|
||||||
|
RectTransform PiecesParent { get; }
|
||||||
|
RectTransform RegionsParent { get; }
|
||||||
|
RectTransform HudRoot { get; }
|
||||||
|
RectTransform TrayPanel { get; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9794063828774e7e98d911a8252842c0
|
||||||
|
timeCreated: 1779952541
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 68c97391df7846648bbb6d7847dafb18
|
||||||
|
timeCreated: 1779950354
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading;
|
||||||
|
using Cysharp.Threading.Tasks;
|
||||||
|
using Darkmatter.Core.Contracts.Features.DrawingCatalog;
|
||||||
|
|
||||||
|
namespace Darkmatter.Core.Contracts.Features.ShapeBuilder;
|
||||||
|
|
||||||
|
public interface IShapeBuilderController
|
||||||
|
{
|
||||||
|
UniTask InitializeAsync(CancellationToken ct);
|
||||||
|
|
||||||
|
UniTask BuildAsync(IDrawingTemplate template,
|
||||||
|
IReadOnlyCollection<string> preSnappedIds, CancellationToken ct);
|
||||||
|
|
||||||
|
IReadOnlyCollection<string> GetSnappedPieceIds();
|
||||||
|
void Clear();
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 218237e181434d4983ad55d38db77c74
|
||||||
|
timeCreated: 1779950364
|
||||||
@@ -2,7 +2,8 @@
|
|||||||
"name": "Core",
|
"name": "Core",
|
||||||
"rootNamespace": "Darkmatter.Core",
|
"rootNamespace": "Darkmatter.Core",
|
||||||
"references": [
|
"references": [
|
||||||
"GUID:f51ebe6a0ceec4240a699833d6309b23"
|
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
||||||
|
"GUID:9e24947de15b9834991c9d8411ea37cf"
|
||||||
],
|
],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Darkmatter.Core.Data.Static.Features.DrawingTemplate
|
|||||||
[field: SerializeField] public string Id { get; private set; }
|
[field: SerializeField] public string Id { get; private set; }
|
||||||
[field: SerializeField] public string DisplayName { get; private set; }
|
[field: SerializeField] public string DisplayName { get; private set; }
|
||||||
[field: SerializeField] public Sprite DefaultThumbnail { get; private set; }
|
[field: SerializeField] public Sprite DefaultThumbnail { get; private set; }
|
||||||
[field: SerializeField] public Sprite PaperBackground { get; private set; }
|
[field: SerializeField] public GameObject Prefab { get; private set; }
|
||||||
[field: SerializeField] public IReadOnlyList<ShapeSO> Pieces { get; private set; }
|
[field: SerializeField] public IReadOnlyList<ShapeSO> Pieces { get; private set; }
|
||||||
[field: SerializeField] public IReadOnlyList<ColorRegionDTO> Regions { get; private set; }
|
[field: SerializeField] public IReadOnlyList<ColorRegionDTO> Regions { get; private set; }
|
||||||
}
|
}
|
||||||
|
|||||||
8
Assets/Darkmatter/Code/Features/AppBoot.meta
Normal file
8
Assets/Darkmatter/Code/Features/AppBoot.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3841157d2ef124a25b2c16956605ca40
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"name": "Features.AppBoot"
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a00b1d9e55c264fb785b78914db69e05
|
||||||
|
AssemblyDefinitionImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Darkmatter/Code/Features/GameplayFlow.meta
Normal file
8
Assets/Darkmatter/Code/Features/GameplayFlow.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8e69d4466105646aabc1668844cac5b7
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "Features.GameplayFlow",
|
||||||
|
"rootNamespace": "Darkmatter.Features.GameplayFlow",
|
||||||
|
"references": [
|
||||||
|
"GUID:6a0a834eb41764f12ba55c3fb04a40cb",
|
||||||
|
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc",
|
||||||
|
"GUID:c1c03c0e5b2f4412b9f2be1c20d6a9b1"
|
||||||
|
],
|
||||||
|
"includePlatforms": [],
|
||||||
|
"excludePlatforms": [],
|
||||||
|
"allowUnsafeCode": false,
|
||||||
|
"overrideReferences": false,
|
||||||
|
"precompiledReferences": [],
|
||||||
|
"autoReferenced": true,
|
||||||
|
"defineConstraints": [],
|
||||||
|
"versionDefines": [],
|
||||||
|
"noEngineReferences": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 995166e584dda4ff98501f62b07aa9cb
|
||||||
|
AssemblyDefinitionImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Darkmatter/Code/Features/GameplayFlow/Flow.meta
Normal file
8
Assets/Darkmatter/Code/Features/GameplayFlow/Flow.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: adb650c457f6843c2a5704f12bcd0160
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 46180d2f7b7a14e42b77afb776b3a129
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using Darkmatter.Core.Contracts.Features.GameplayFlow;
|
||||||
|
using Darkmatter.Features.GameplayFlow.SceneRefs;
|
||||||
|
using Darkmatter.Libs.Installers;
|
||||||
|
using UnityEngine;
|
||||||
|
using VContainer;
|
||||||
|
using VContainer.Unity;
|
||||||
|
|
||||||
|
namespace Darkmatter.Features.GameplayFlow
|
||||||
|
{
|
||||||
|
public class GameplayFlowFeatureModule : MonoBehaviour, IModule
|
||||||
|
{
|
||||||
|
[SerializeField] private GameplaySceneRefs sceneRefs;
|
||||||
|
|
||||||
|
public void Register(IContainerBuilder builder)
|
||||||
|
{
|
||||||
|
if (sceneRefs != null)
|
||||||
|
builder.RegisterComponent<IGameplaySceneRefs>(sceneRefs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c784b80c101814d24bf8820233bb0f62
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 38e2583efd5f84627b5ff0fc7599bf03
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using Darkmatter.Core.Contracts.Features.GameplayFlow;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Darkmatter.Features.GameplayFlow.SceneRefs
|
||||||
|
{
|
||||||
|
public class GameplaySceneRefs : MonoBehaviour, IGameplaySceneRefs
|
||||||
|
{
|
||||||
|
[SerializeField] private RectTransform paperRoot;
|
||||||
|
[SerializeField] private RectTransform slotsParent;
|
||||||
|
[SerializeField] private RectTransform piecesParent;
|
||||||
|
[SerializeField] private RectTransform regionsParent;
|
||||||
|
|
||||||
|
[SerializeField] private RectTransform hudRoot;
|
||||||
|
[SerializeField] private RectTransform trayPanel;
|
||||||
|
|
||||||
|
|
||||||
|
public RectTransform PaperRoot => paperRoot;
|
||||||
|
public RectTransform SlotsParent => slotsParent;
|
||||||
|
public RectTransform PiecesParent => piecesParent;
|
||||||
|
public RectTransform RegionsParent => regionsParent;
|
||||||
|
public RectTransform HudRoot => hudRoot;
|
||||||
|
public RectTransform TrayPanel => trayPanel;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f2e39895945b94467b1677388b2fb896
|
||||||
@@ -4,11 +4,6 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace Darkmatter.Features.ShapeBuilder.Commands
|
namespace Darkmatter.Features.ShapeBuilder.Commands
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Undoable snap. Captures the piece's pre-snap pose + parent at ctor time;
|
|
||||||
/// Execute drives the normal snap tween; Undo restores the pre-snap state
|
|
||||||
/// and re-enables drag.
|
|
||||||
/// </summary>
|
|
||||||
internal sealed class SnapPieceCommand : ICommand
|
internal sealed class SnapPieceCommand : ICommand
|
||||||
{
|
{
|
||||||
private readonly ShapePiece _piece;
|
private readonly ShapePiece _piece;
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
|
using Darkmatter.Core.Contracts.Features.ShapeBuilder;
|
||||||
using Darkmatter.Core.Data.Static.Features.ShapeBuilder;
|
using Darkmatter.Core.Data.Static.Features.ShapeBuilder;
|
||||||
|
using Darkmatter.Features.ShapeBuilder.Systems;
|
||||||
using Darkmatter.Libs.Installers;
|
using Darkmatter.Libs.Installers;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using VContainer;
|
using VContainer;
|
||||||
|
using VContainer.Unity;
|
||||||
|
|
||||||
namespace Darkmatter.Features.ShapeBuilder.Installers
|
namespace Darkmatter.Features.ShapeBuilder.Installers
|
||||||
{
|
{
|
||||||
@@ -12,10 +15,8 @@ namespace Darkmatter.Features.ShapeBuilder.Installers
|
|||||||
public void Register(IContainerBuilder builder)
|
public void Register(IContainerBuilder builder)
|
||||||
{
|
{
|
||||||
if (config != null)
|
if (config != null)
|
||||||
builder.RegisterInstance(config);
|
builder.RegisterComponent(config);
|
||||||
|
builder.Register<IShapeBuilderController, ShapeBuilderController>(Lifetime.Singleton);
|
||||||
// ShapePiece instances are MonoBehaviours instantiated by the
|
|
||||||
// ShapeBuilderController; nothing to register here for them.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
using Cysharp.Threading.Tasks;
|
||||||
|
using Darkmatter.Core.Contracts.Features.DrawingCatalog;
|
||||||
|
using Darkmatter.Core.Contracts.Features.History;
|
||||||
|
using Darkmatter.Core.Contracts.Features.ShapeBuilder;
|
||||||
|
using Darkmatter.Core.Contracts.Services.Assets;
|
||||||
|
using Darkmatter.Core.Contracts.Services.Audio;
|
||||||
|
using Darkmatter.Core.Contracts.Features.GameplayFlow;
|
||||||
|
using Darkmatter.Core.Data.Signals.Features.ShapeBuilder;
|
||||||
|
using Darkmatter.Core.Data.Static.Features.ShapeBuilder;
|
||||||
|
using Darkmatter.Features.ShapeBuilder.UI;
|
||||||
|
using Darkmatter.Libs.Observer;
|
||||||
|
using UnityEngine;
|
||||||
|
using Object = UnityEngine.Object;
|
||||||
|
|
||||||
|
namespace Darkmatter.Features.ShapeBuilder.Systems
|
||||||
|
{
|
||||||
|
public class ShapeBuilderController : IShapeBuilderController, IDisposable
|
||||||
|
{
|
||||||
|
private const string PiecePrefabKey = "ShapeBuilder/Piece";
|
||||||
|
|
||||||
|
private string _currentTemplateId;
|
||||||
|
private int _expected;
|
||||||
|
private int _snapped;
|
||||||
|
private GameObject _drawingInstance;
|
||||||
|
private GameObject _piecePrefab;
|
||||||
|
private IDisposable _snappedSub;
|
||||||
|
|
||||||
|
private readonly List<string> _snappedPieceIds = new();
|
||||||
|
private readonly ShapeBuilderConfig _cfg;
|
||||||
|
private readonly ISfxPlayer _sfx;
|
||||||
|
private readonly IEventBus _bus;
|
||||||
|
private readonly IUndoStack _undo;
|
||||||
|
private readonly IAssetProviderService _assetProviderService;
|
||||||
|
private readonly IEventBus _eventBus;
|
||||||
|
private readonly IGameplaySceneRefs _refs;
|
||||||
|
|
||||||
|
|
||||||
|
public ShapeBuilderController(
|
||||||
|
ShapeBuilderConfig cfg,
|
||||||
|
ISfxPlayer sfx,
|
||||||
|
IEventBus bus,
|
||||||
|
IUndoStack undo,
|
||||||
|
IAssetProviderService assetProviderService,
|
||||||
|
IEventBus eventBus,
|
||||||
|
IGameplaySceneRefs refs)
|
||||||
|
{
|
||||||
|
_cfg = cfg;
|
||||||
|
_sfx = sfx;
|
||||||
|
_bus = bus;
|
||||||
|
_undo = undo;
|
||||||
|
_assetProviderService = assetProviderService;
|
||||||
|
_eventBus = eventBus;
|
||||||
|
_refs = refs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async UniTask InitializeAsync(CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
await TryLoadPiecePrefabAsync(cancellationToken);
|
||||||
|
|
||||||
|
_snappedSub = _eventBus.Subscribe<PieceSnappedSignal>(OnPieceSnapped);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPieceSnapped(PieceSnappedSignal obj)
|
||||||
|
{
|
||||||
|
_snappedPieceIds.Add(obj.PieceId);
|
||||||
|
CheckIfShapeAssembled();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async UniTask BuildAsync(
|
||||||
|
IDrawingTemplate template,
|
||||||
|
IReadOnlyCollection<string> preSnappedIds,
|
||||||
|
CancellationToken ct = default)
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
|
|
||||||
|
if (template.Prefab == null)
|
||||||
|
throw new System.Exception($"No drawing layout prefab for '{template.Id}'");
|
||||||
|
|
||||||
|
_drawingInstance = Object.Instantiate(template.Prefab, _refs.PaperRoot);
|
||||||
|
ct.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
var slots = _drawingInstance.GetComponentsInChildren<SlotMarker>(includeInactive: true);
|
||||||
|
|
||||||
|
await TryLoadPiecePrefabAsync(ct);
|
||||||
|
|
||||||
|
int count = template.Pieces.Count;
|
||||||
|
float trayW = _refs.TrayPanel.rect.width;
|
||||||
|
float pitch = trayW / (count + 1);
|
||||||
|
|
||||||
|
_currentTemplateId = template.Id;
|
||||||
|
_expected = count;
|
||||||
|
_snapped = 0;
|
||||||
|
|
||||||
|
CreateShapePieceInstances(template, preSnappedIds, count, slots, pitch, trayW);
|
||||||
|
|
||||||
|
CheckIfShapeAssembled();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CreateShapePieceInstances(IDrawingTemplate template, IReadOnlyCollection<string> preSnappedIds,
|
||||||
|
int count,
|
||||||
|
SlotMarker[] slots, float pitch, float trayW)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
var shape = template.Pieces[i];
|
||||||
|
var slot = FindSlotForShape(slots, shape);
|
||||||
|
if (slot == null)
|
||||||
|
{
|
||||||
|
Debug.LogError($"[ShapeBuilder] No SlotMarker for '{shape.Id}' in '{template.Id}'");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var trayPos = new Vector2(pitch * (i + 1) - trayW * 0.5f, 0f);
|
||||||
|
bool preSnapped = preSnappedIds != null && preSnappedIds.Contains(shape.Id);
|
||||||
|
|
||||||
|
var go = Object.Instantiate(_piecePrefab, _refs.TrayPanel);
|
||||||
|
go.name = $"Piece_{shape.Id}";
|
||||||
|
|
||||||
|
var piece = go.GetComponent<ShapePiece>();
|
||||||
|
piece.Setup(shape, slot, _cfg, _sfx, _bus, _undo, trayPos, preSnapped);
|
||||||
|
|
||||||
|
if (preSnapped) _snapped++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckIfShapeAssembled()
|
||||||
|
{
|
||||||
|
if (_expected > 0 && _snapped == _expected)
|
||||||
|
_bus.Publish(new ShapeAssembledSignal(_currentTemplateId));
|
||||||
|
}
|
||||||
|
|
||||||
|
private async UniTask TryLoadPiecePrefabAsync(CancellationToken ct)
|
||||||
|
{
|
||||||
|
if (_piecePrefab == null)
|
||||||
|
{
|
||||||
|
_piecePrefab = await _assetProviderService.LoadAssetAsync<GameObject>(
|
||||||
|
PiecePrefabKey, progress: null, cancellationToken: ct);
|
||||||
|
if (_piecePrefab == null)
|
||||||
|
throw new System.Exception($"No piece prefab at '{PiecePrefabKey}'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static SlotMarker FindSlotForShape(SlotMarker[] slots, ShapeSO shape)
|
||||||
|
{
|
||||||
|
foreach (var s in slots)
|
||||||
|
if (s.Shape == shape)
|
||||||
|
return s;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IReadOnlyCollection<string> GetSnappedPieceIds()
|
||||||
|
{
|
||||||
|
return _snappedPieceIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
_snappedSub?.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2964329afc8ef47fe8817d4a701b8fe1
|
||||||
@@ -12,12 +12,6 @@ using UnityEngine.UI;
|
|||||||
|
|
||||||
namespace Darkmatter.Features.ShapeBuilder.UI
|
namespace Darkmatter.Features.ShapeBuilder.UI
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Single-MB shape piece. Handles drag, reactive preview lerp, snap,
|
|
||||||
/// and return-to-tray. Snap is wrapped in a <see cref="SnapPieceCommand"/>
|
|
||||||
/// pushed onto the shared <see cref="IUndoStack"/> so it participates in
|
|
||||||
/// the same undo/redo flow as coloring.
|
|
||||||
/// </summary>
|
|
||||||
[RequireComponent(typeof(RectTransform))]
|
[RequireComponent(typeof(RectTransform))]
|
||||||
public sealed class ShapePiece : MonoBehaviour,
|
public sealed class ShapePiece : MonoBehaviour,
|
||||||
IBeginDragHandler, IDragHandler, IEndDragHandler
|
IBeginDragHandler, IDragHandler, IEndDragHandler
|
||||||
@@ -116,7 +110,7 @@ namespace Darkmatter.Features.ShapeBuilder.UI
|
|||||||
_slot.RectTransform.anchoredPosition);
|
_slot.RectTransform.anchoredPosition);
|
||||||
|
|
||||||
if (dist <= _cfg.SnapRadius)
|
if (dist <= _cfg.SnapRadius)
|
||||||
_undo.Push(new SnapPieceCommand(this)); // Push calls Execute → SnapInternal
|
_undo.Push(new SnapPieceCommand(this));
|
||||||
else
|
else
|
||||||
ReturnToTray();
|
ReturnToTray();
|
||||||
}
|
}
|
||||||
@@ -132,7 +126,6 @@ namespace Darkmatter.Features.ShapeBuilder.UI
|
|||||||
RectTransform.localRotation = Quaternion.Slerp(Quaternion.identity, slot.localRotation, t);
|
RectTransform.localRotation = Quaternion.Slerp(Quaternion.identity, slot.localRotation, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- Command-driven snap / un-snap ----
|
|
||||||
internal void SnapInternal()
|
internal void SnapInternal()
|
||||||
{
|
{
|
||||||
Lock();
|
Lock();
|
||||||
|
|||||||
Binary file not shown.
BIN
Assets/Darkmatter/Content/Intro/intro.mp4
Normal file
BIN
Assets/Darkmatter/Content/Intro/intro.mp4
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: ec78f9cae5b834662a0005dcbadd12c6
|
guid: 94bb9480e86df4128b09488bd123a53e
|
||||||
VideoClipImporter:
|
VideoClipImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
@@ -637,7 +637,7 @@ Camera:
|
|||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_ClearFlags: 2
|
m_ClearFlags: 2
|
||||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0}
|
||||||
m_projectionMatrixMode: 1
|
m_projectionMatrixMode: 1
|
||||||
m_GateFitMode: 2
|
m_GateFitMode: 2
|
||||||
m_FOVAxisMode: 0
|
m_FOVAxisMode: 0
|
||||||
@@ -966,7 +966,7 @@ VideoPlayer:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2122267603}
|
m_GameObject: {fileID: 2122267603}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_VideoClip: {fileID: 32900000, guid: ec78f9cae5b834662a0005dcbadd12c6, type: 3}
|
m_VideoClip: {fileID: 32900000, guid: 94bb9480e86df4128b09488bd123a53e, type: 3}
|
||||||
m_TargetCameraAlpha: 1
|
m_TargetCameraAlpha: 1
|
||||||
m_TargetCamera3DLayout: 0
|
m_TargetCamera3DLayout: 0
|
||||||
m_TargetCamera: {fileID: 0}
|
m_TargetCamera: {fileID: 0}
|
||||||
@@ -988,7 +988,7 @@ VideoPlayer:
|
|||||||
m_EnabledAudioTracks: 01
|
m_EnabledAudioTracks: 01
|
||||||
m_DirectAudioMutes: 00
|
m_DirectAudioMutes: 00
|
||||||
m_ControlledAudioTrackCount: 1
|
m_ControlledAudioTrackCount: 1
|
||||||
m_PlayOnAwake: 0
|
m_PlayOnAwake: 1
|
||||||
m_SkipOnDrop: 1
|
m_SkipOnDrop: 1
|
||||||
m_Looping: 0
|
m_Looping: 0
|
||||||
m_WaitForFirstFrame: 0
|
m_WaitForFirstFrame: 0
|
||||||
|
|||||||
@@ -119,6 +119,56 @@ NavMeshSettings:
|
|||||||
debug:
|
debug:
|
||||||
m_Flags: 0
|
m_Flags: 0
|
||||||
m_NavMeshData: {fileID: 0}
|
m_NavMeshData: {fileID: 0}
|
||||||
|
--- !u!1 &396806865
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 396806866}
|
||||||
|
- component: {fileID: 396806867}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: SceneRefs
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &396806866
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 396806865}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 3.31064, y: 1.32407, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &396806867
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 396806865}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: f2e39895945b94467b1677388b2fb896, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Features.GameplayFlow::Darkmatter.Features.GameplayFlow.SceneRefs.GameplaySceneRefs
|
||||||
|
paperRoot: {fileID: 0}
|
||||||
|
slotsParent: {fileID: 0}
|
||||||
|
piecesParent: {fileID: 0}
|
||||||
|
regionsParent: {fileID: 0}
|
||||||
|
hudRoot: {fileID: 0}
|
||||||
|
trayPanel: {fileID: 0}
|
||||||
--- !u!1 &590523272
|
--- !u!1 &590523272
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -198,6 +248,51 @@ Transform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &1046038182
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1046038183}
|
||||||
|
- component: {fileID: 1046038184}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: GameplayFlowFeatureModule
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &1046038183
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1046038182}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 1965442263}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &1046038184
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1046038182}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: c784b80c101814d24bf8820233bb0f62, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Features.GameplayFlow::Darkmatter.Features.GameplayFlow.GameplayFlowFeatureModule
|
||||||
|
sceneRefs: {fileID: 396806867}
|
||||||
--- !u!1 &1224714931
|
--- !u!1 &1224714931
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -248,7 +343,9 @@ MonoBehaviour:
|
|||||||
autoRun: 1
|
autoRun: 1
|
||||||
autoInjectGameObjects: []
|
autoInjectGameObjects: []
|
||||||
serviceModules:
|
serviceModules:
|
||||||
|
- {fileID: 1046038184}
|
||||||
- {fileID: 1551649429}
|
- {fileID: 1551649429}
|
||||||
|
- {fileID: 1991184380}
|
||||||
--- !u!1 &1551649427
|
--- !u!1 &1551649427
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -323,6 +420,7 @@ Transform:
|
|||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
|
- {fileID: 1046038183}
|
||||||
- {fileID: 1551649428}
|
- {fileID: 1551649428}
|
||||||
- {fileID: 1991184379}
|
- {fileID: 1991184379}
|
||||||
m_Father: {fileID: 1224714932}
|
m_Father: {fileID: 1224714932}
|
||||||
@@ -480,4 +578,5 @@ SceneRoots:
|
|||||||
m_Roots:
|
m_Roots:
|
||||||
- {fileID: 2069155641}
|
- {fileID: 2069155641}
|
||||||
- {fileID: 590523275}
|
- {fileID: 590523275}
|
||||||
|
- {fileID: 396806866}
|
||||||
- {fileID: 1224714932}
|
- {fileID: 1224714932}
|
||||||
|
|||||||
Reference in New Issue
Block a user