First commit for private source control. Older commits available on Github.
This commit is contained in:
BIN
Assets/Scripts/Framework/.DS_Store
vendored
Normal file
BIN
Assets/Scripts/Framework/.DS_Store
vendored
Normal file
Binary file not shown.
3
Assets/Scripts/Framework/Assets.meta
Normal file
3
Assets/Scripts/Framework/Assets.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff2ed8f2f4124c45aad87cacd37abf0d
|
||||
timeCreated: 1769705501
|
||||
204
Assets/Scripts/Framework/Assets/AddressableManager.cs
Normal file
204
Assets/Scripts/Framework/Assets/AddressableManager.cs
Normal file
@@ -0,0 +1,204 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using BriarQueen.Framework.Assets.Components;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
||||
using UnityEngine.ResourceManagement.ResourceProviders;
|
||||
using UnityEngine.SceneManagement;
|
||||
using VContainer;
|
||||
using VContainer.Unity;
|
||||
|
||||
namespace BriarQueen.Framework.Assets
|
||||
{
|
||||
public class AddressableManager : IDisposable
|
||||
{
|
||||
private readonly Dictionary<object, AsyncOperationHandle> _assetHandles = new();
|
||||
private readonly Dictionary<GameObject, AsyncOperationHandle> _instanceHandles = new();
|
||||
private readonly IObjectResolver _lifetimeContainer;
|
||||
private readonly object _lock = new();
|
||||
|
||||
[Inject]
|
||||
public AddressableManager(IObjectResolver lifetimeContainer)
|
||||
{
|
||||
_lifetimeContainer = lifetimeContainer;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
foreach (var handle in _instanceHandles.Values)
|
||||
if (handle.IsValid())
|
||||
Addressables.ReleaseInstance(handle);
|
||||
|
||||
_instanceHandles.Clear();
|
||||
|
||||
foreach (var handle in _assetHandles.Values)
|
||||
if (handle.IsValid())
|
||||
Addressables.Release(handle);
|
||||
|
||||
_assetHandles.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public async UniTask<T> LoadAssetAsync<T>(AssetReference reference) where T : class
|
||||
{
|
||||
var handle = Addressables.LoadAssetAsync<T>(reference);
|
||||
|
||||
try
|
||||
{
|
||||
await handle;
|
||||
|
||||
if (handle.Status == AsyncOperationStatus.Succeeded)
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
_assetHandles[handle.Result] = handle;
|
||||
}
|
||||
|
||||
return handle.Result;
|
||||
}
|
||||
|
||||
Debug.LogError($"[AddressableManager] Failed to load asset: {reference.RuntimeKey}");
|
||||
return null;
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
if (handle.IsValid()) Addressables.Release(handle);
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void ReleaseAsset<T>(T asset) where T : class
|
||||
{
|
||||
if (asset == null) return;
|
||||
|
||||
lock (_lock)
|
||||
{
|
||||
if (_assetHandles.TryGetValue(asset, out var handle))
|
||||
{
|
||||
if (handle.IsValid()) Addressables.Release(handle);
|
||||
|
||||
_assetHandles.Remove(asset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async UniTask<AsyncOperationHandle<SceneInstance>> LoadSceneAsync(
|
||||
AssetReference assetReference,
|
||||
LoadSceneMode loadSceneMode = LoadSceneMode.Additive,
|
||||
CancellationToken cancellationToken = default,
|
||||
IProgress<float> progress = null,
|
||||
bool autoLoad = true
|
||||
)
|
||||
{
|
||||
var handle = Addressables.LoadSceneAsync(assetReference, loadSceneMode, autoLoad);
|
||||
await handle.ToUniTask(progress, cancellationToken: cancellationToken);
|
||||
return handle;
|
||||
}
|
||||
|
||||
public async UniTask UnloadSceneAsync(AsyncOperationHandle<SceneInstance> sceneHandle)
|
||||
{
|
||||
if (sceneHandle.IsValid()) await Addressables.UnloadSceneAsync(sceneHandle);
|
||||
}
|
||||
|
||||
public async UniTask<GameObject> InstantiateAsync(
|
||||
AssetReference reference,
|
||||
Vector3 position = default,
|
||||
Quaternion rotation = default,
|
||||
Transform parent = null,
|
||||
IObjectResolver scope = null,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
var handle = Addressables.InstantiateAsync(reference, position, rotation, parent);
|
||||
|
||||
try
|
||||
{
|
||||
await handle.WithCancellation(cancellationToken);
|
||||
|
||||
if (handle.Status != AsyncOperationStatus.Succeeded)
|
||||
{
|
||||
Debug.LogError($"[AddressableManager] Failed to instantiate asset: {reference.RuntimeKey}");
|
||||
return null;
|
||||
}
|
||||
|
||||
var go = handle.Result;
|
||||
|
||||
lock (_lock)
|
||||
{
|
||||
_instanceHandles[go] = handle;
|
||||
}
|
||||
|
||||
var prefabScope = go.GetComponent<LifetimeScope>();
|
||||
var injectionScope = scope ?? prefabScope?.Container ?? _lifetimeContainer;
|
||||
|
||||
injectionScope.InjectGameObject(go);
|
||||
|
||||
var notify = go.GetComponent<NotifyOnDestruction>();
|
||||
|
||||
if (!notify)
|
||||
{
|
||||
notify = go.AddComponent<NotifyOnDestruction>();
|
||||
injectionScope.Inject(notify);
|
||||
}
|
||||
|
||||
void OnInstanceDestroyed()
|
||||
{
|
||||
TryReleaseInstance(go);
|
||||
notify.OnDestroyedCalled -= OnInstanceDestroyed;
|
||||
}
|
||||
|
||||
notify.OnDestroyedCalled += OnInstanceDestroyed;
|
||||
|
||||
return go;
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
if (handle.IsValid()) Addressables.ReleaseInstance(handle);
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryReleaseInstance(GameObject instance)
|
||||
{
|
||||
if (instance == null)
|
||||
return false;
|
||||
|
||||
Debug.Log($"[AddressableManager] Trying to release instance: {instance}");
|
||||
|
||||
lock (_lock)
|
||||
{
|
||||
if (_instanceHandles.TryGetValue(instance, out var handle))
|
||||
{
|
||||
if (handle.IsValid()) Addressables.ReleaseInstance(handle);
|
||||
|
||||
_instanceHandles.Remove(instance);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void ReleaseInstance(GameObject instance)
|
||||
{
|
||||
if (instance == null) return;
|
||||
|
||||
lock (_lock)
|
||||
{
|
||||
if (_instanceHandles.TryGetValue(instance, out var handle))
|
||||
{
|
||||
if (handle.IsValid()) Addressables.ReleaseInstance(handle);
|
||||
|
||||
_instanceHandles.Remove(instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e1db17fcf6194082baad6949fa448ca0
|
||||
timeCreated: 1769705501
|
||||
3
Assets/Scripts/Framework/Assets/Components.meta
Normal file
3
Assets/Scripts/Framework/Assets/Components.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff405febbf4c423ea26f3a0313bef4d5
|
||||
timeCreated: 1773836297
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using BriarQueen.Framework.Services.Destruction;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using VContainer;
|
||||
|
||||
namespace BriarQueen.Framework.Assets.Components
|
||||
{
|
||||
public class NotifyOnDestruction : MonoBehaviour, IDestructible
|
||||
{
|
||||
private DestructionService _destructionService;
|
||||
|
||||
public UniTask OnPreDestroy()
|
||||
{
|
||||
OnPreDestroyCalled?.Invoke();
|
||||
return UniTask.CompletedTask; // No async operation needed, just a notification
|
||||
}
|
||||
|
||||
public UniTask OnDestroyed()
|
||||
{
|
||||
OnDestroyedCalled?.Invoke();
|
||||
return UniTask.CompletedTask; // No async operation needed, just a notification
|
||||
}
|
||||
|
||||
[Inject]
|
||||
public void Construct(DestructionService destructionService)
|
||||
{
|
||||
_destructionService = destructionService;
|
||||
}
|
||||
|
||||
public event Action OnPreDestroyCalled;
|
||||
public event Action OnDestroyedCalled;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2aae9ec81f949ffbc5de664b65b46b3
|
||||
timeCreated: 1769705628
|
||||
6
Assets/Scripts/Framework/Assets/IAssetProvider.cs
Normal file
6
Assets/Scripts/Framework/Assets/IAssetProvider.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace BriarQueen.Framework.Assets
|
||||
{
|
||||
public interface IAssetProvider
|
||||
{
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Framework/Assets/IAssetProvider.cs.meta
Normal file
3
Assets/Scripts/Framework/Assets/IAssetProvider.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84550fd141464293b5d6680bdb50bf93
|
||||
timeCreated: 1769705539
|
||||
24
Assets/Scripts/Framework/BriarQueen.Framework.asmdef
Normal file
24
Assets/Scripts/Framework/BriarQueen.Framework.asmdef
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "BriarQueen.Framework",
|
||||
"rootNamespace": "BriarQueen",
|
||||
"references": [
|
||||
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc",
|
||||
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
||||
"GUID:80ecb87cae9c44d19824e70ea7229748",
|
||||
"GUID:bdf0eff65032c4178bf18aa9c96b1c70",
|
||||
"GUID:9e24947de15b9834991c9d8411ea37cf",
|
||||
"GUID:593a5b492d29ac6448b1ebf7f035ef33",
|
||||
"GUID:84651a3751eca9349aac36a66bba901b",
|
||||
"GUID:75469ad4d38634e559750d17036d5f7c",
|
||||
"GUID:776d03a35f1b52c4a9aed9f56d7b4229"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac1be664c635c449eb9f3f52cf5c97f5
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
3
Assets/Scripts/Framework/Coordinators.meta
Normal file
3
Assets/Scripts/Framework/Coordinators.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 842950604aa54cb8a98ece9875c94bfe
|
||||
timeCreated: 1773843729
|
||||
3
Assets/Scripts/Framework/Coordinators/Events.meta
Normal file
3
Assets/Scripts/Framework/Coordinators/Events.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6d5109c39334a33a1ec140fed9aa971
|
||||
timeCreated: 1769705112
|
||||
BIN
Assets/Scripts/Framework/Coordinators/Events/.DS_Store
vendored
Normal file
BIN
Assets/Scripts/Framework/Coordinators/Events/.DS_Store
vendored
Normal file
Binary file not shown.
185
Assets/Scripts/Framework/Coordinators/Events/EventCoordinator.cs
Normal file
185
Assets/Scripts/Framework/Coordinators/Events/EventCoordinator.cs
Normal file
@@ -0,0 +1,185 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using BriarQueen.Framework.Events.System;
|
||||
using UnityEngine;
|
||||
using VContainer.Unity;
|
||||
|
||||
namespace BriarQueen.Framework.Coordinators.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// A type-safe, queued event bus for managing gameplay events.
|
||||
/// </summary>
|
||||
public class EventCoordinator : IDisposable, ITickable, IInitializable
|
||||
{
|
||||
private const int MAX_EVENTS_PER_FRAME = 500;
|
||||
|
||||
public static bool EnableDebugLogs = false;
|
||||
|
||||
private readonly Queue<(Type type, IEvent data)> _eventQueue = new();
|
||||
private readonly object _queueLock = new();
|
||||
private readonly Dictionary<Type, Dictionary<object, Action<IEvent>>> _typedEventListeners = new();
|
||||
|
||||
private bool _isProcessingQueue;
|
||||
|
||||
public bool Initialized { get; private set; }
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
Initialized = true;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
lock (_queueLock)
|
||||
{
|
||||
_typedEventListeners.Clear();
|
||||
_eventQueue.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public void Tick()
|
||||
{
|
||||
ProcessQueue();
|
||||
}
|
||||
|
||||
public void Subscribe<T>(Action<T> listener) where T : IEvent
|
||||
{
|
||||
if (listener == null) return;
|
||||
|
||||
var eventType = typeof(T);
|
||||
|
||||
if (!_typedEventListeners.TryGetValue(eventType, out var listeners))
|
||||
{
|
||||
listeners = new Dictionary<object, Action<IEvent>>();
|
||||
_typedEventListeners[eventType] = listeners;
|
||||
}
|
||||
|
||||
if (listeners.ContainsKey(listener)) return;
|
||||
|
||||
Action<IEvent> wrapper = e => listener((T)e);
|
||||
listeners[listener] = wrapper;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
Debug.Log(
|
||||
$"[EventManager] Subscribed '{eventType.Name}' to '{listener.Method.Name}' from '{listener.Target}'");
|
||||
#endif
|
||||
}
|
||||
|
||||
public void Unsubscribe<T>(Action<T> listener) where T : IEvent
|
||||
{
|
||||
if (listener == null) return;
|
||||
|
||||
var eventType = typeof(T);
|
||||
|
||||
if (_typedEventListeners.TryGetValue(eventType, out var listeners))
|
||||
{
|
||||
listeners.Remove(listener);
|
||||
if (listeners.Count == 0)
|
||||
_typedEventListeners.Remove(eventType);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Publish<T>(T eventData) where T : IEvent
|
||||
{
|
||||
if (eventData == null) return;
|
||||
|
||||
lock (_queueLock)
|
||||
{
|
||||
_eventQueue.Enqueue((typeof(T), eventData));
|
||||
}
|
||||
|
||||
if (EnableDebugLogs)
|
||||
Debug.Log($"[EventManager] Enqueued '{typeof(T).Name}'");
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void PublishImmediate<T>(T eventData) where T : IEvent
|
||||
{
|
||||
if (eventData == null) return;
|
||||
|
||||
var type = typeof(T);
|
||||
|
||||
if (_typedEventListeners.TryGetValue(type, out var listeners) && listeners.Count > 0)
|
||||
{
|
||||
var snapshot = new Action<IEvent>[listeners.Count];
|
||||
listeners.Values.CopyTo(snapshot, 0);
|
||||
|
||||
for (var i = 0; i < snapshot.Length; i++)
|
||||
{
|
||||
var listener = snapshot[i];
|
||||
try
|
||||
{
|
||||
listener?.Invoke(eventData);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"[EventManager] Exception in '{type.Name}' listener: {ex}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (EnableDebugLogs)
|
||||
Debug.Log($"[EventManager] Fired '{type.Name}' (Immediate)");
|
||||
}
|
||||
|
||||
private void ProcessQueue()
|
||||
{
|
||||
if (_isProcessingQueue) return;
|
||||
|
||||
_isProcessingQueue = true;
|
||||
|
||||
try
|
||||
{
|
||||
var processed = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
(Type type, IEvent data) evt;
|
||||
|
||||
lock (_queueLock)
|
||||
{
|
||||
if (_eventQueue.Count == 0) break;
|
||||
evt = _eventQueue.Dequeue();
|
||||
}
|
||||
|
||||
processed++;
|
||||
if (processed > MAX_EVENTS_PER_FRAME)
|
||||
{
|
||||
Debug.LogWarning(
|
||||
"[EventManager] Max event processing limit reached. Possible infinite publish loop.");
|
||||
break;
|
||||
}
|
||||
|
||||
if (_typedEventListeners.TryGetValue(evt.type, out var listeners) && listeners.Count > 0)
|
||||
{
|
||||
var snapshot = new Action<IEvent>[listeners.Count];
|
||||
listeners.Values.CopyTo(snapshot, 0);
|
||||
|
||||
for (var i = 0; i < snapshot.Length; i++)
|
||||
{
|
||||
var listener = snapshot[i];
|
||||
try
|
||||
{
|
||||
listener?.Invoke(evt.data);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError(
|
||||
$"[EventManager] Exception in '{evt.type.Name}' listener during queue processing: {ex}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (EnableDebugLogs)
|
||||
Debug.Log($"[EventManager] Fired '{evt.type.Name}' (Queued)");
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isProcessingQueue = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2f0594880d694d8e9297c88bbffbce8f
|
||||
timeCreated: 1769705112
|
||||
8
Assets/Scripts/Framework/Events.meta
Normal file
8
Assets/Scripts/Framework/Events.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6a5d896b814949f891721df67bc4d13
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Scripts/Framework/Events/.DS_Store
vendored
Normal file
BIN
Assets/Scripts/Framework/Events/.DS_Store
vendored
Normal file
Binary file not shown.
8
Assets/Scripts/Framework/Events/Audio.meta
Normal file
8
Assets/Scripts/Framework/Events/Audio.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83fb6ea2b08724af2bfa88da928ff310
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
using BriarQueen.Framework.Managers.Audio.Data;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Audio
|
||||
{
|
||||
public record MusicTrackChangedEvent(AudioFileSo Track) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f3b589adbdecc410faad1a94d0e92943
|
||||
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Audio
|
||||
{
|
||||
public record VoiceLineFinishedEvent(string VoiceLineID) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 86ad67d94ae87497a867a22b24fcab54
|
||||
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Audio
|
||||
{
|
||||
public record VoiceLineStartedEvent(string VoiceLineID) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f19b51fb48104a5eae452ff3261ce05
|
||||
8
Assets/Scripts/Framework/Events/Gameplay.meta
Normal file
8
Assets/Scripts/Framework/Events/Gameplay.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3eca027f79f05492da343f57bf23ec94
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Gameplay
|
||||
{
|
||||
public record InventoryChangedEvent : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cdfd706f6f29d43ab80578bd9c9906b8
|
||||
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
using BriarQueen.Framework.Managers.Levels.Data;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Gameplay
|
||||
{
|
||||
public record LevelChangedEvent(BaseLevel Level) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 54697a2ce8b80480cb269432c0402bc8
|
||||
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
using BriarQueen.Framework.Managers.Player.Data;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Gameplay
|
||||
{
|
||||
public record OnNextItemClickedEvent() : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b741224892c24b6f899614e541f0bebd
|
||||
timeCreated: 1774433570
|
||||
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Gameplay
|
||||
{
|
||||
public record OnNextToolChangedEvent() : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 720ded31a3f945e1b5a11c64099e370a
|
||||
timeCreated: 1774128263
|
||||
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
using BriarQueen.Framework.Managers.Player.Data;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Gameplay
|
||||
{
|
||||
public record OnPreviousItemClickedEvent() : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9270b837f3004e398c669ccfefa92a19
|
||||
timeCreated: 1774433570
|
||||
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Gameplay
|
||||
{
|
||||
public record OnPreviousToolChangedEvent : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b80f1fbcb15a41e3867489439e6d26f7
|
||||
timeCreated: 1774433570
|
||||
@@ -0,0 +1,9 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
using BriarQueen.Framework.Services.Puzzles.Base;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Gameplay
|
||||
{
|
||||
public record PuzzleLoadedEvent(BasePuzzle basePuzzle) : IEvent;
|
||||
|
||||
public record PuzzleExitingEvent(BasePuzzle basePuzzle) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f7289507c2df14ada856928e761d3483
|
||||
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
using BriarQueen.Framework.Managers.Player.Data;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Gameplay
|
||||
{
|
||||
public record SelectedItemChangedEvent(ItemDataSo Item) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7da6a11febc84309a2c2f9f116cf9e6
|
||||
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Data.Identifiers;
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Gameplay
|
||||
{
|
||||
public record SelectedToolChangedEvent(ToolID SelectedTool, int Direction) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e7d90518ac24b439fdf81af933dfb14
|
||||
timeCreated: 1774433570
|
||||
8
Assets/Scripts/Framework/Events/Input.meta
Normal file
8
Assets/Scripts/Framework/Events/Input.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ace25c77b0d084b4284c01b91953da40
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
using BriarQueen.Framework.Managers.Interaction.Data;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Input
|
||||
{
|
||||
public record HoverInteractableChangedEvent(IInteractable Interactable) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79c4ab5f2e5d94222b53ccd1be70ef62
|
||||
7
Assets/Scripts/Framework/Events/Input/OnClickEvent.cs
Normal file
7
Assets/Scripts/Framework/Events/Input/OnClickEvent.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Input
|
||||
{
|
||||
public record OnClickEvent(InputAction.CallbackContext Context) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c98806c8fba3342a6933df43ae70d00b
|
||||
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Input
|
||||
{
|
||||
public record OnRightClickEvent(InputAction.CallbackContext Context) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 644d5788a3d51426eb7d034671028341
|
||||
8
Assets/Scripts/Framework/Events/Progression.meta
Normal file
8
Assets/Scripts/Framework/Events/Progression.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59834fdf53a7c4ede88eb875b056cd6f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Progression
|
||||
{
|
||||
public record RequestHintEvent : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f29d9c01dd271423fb5af8762762f660
|
||||
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Data.Identifiers;
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Progression
|
||||
{
|
||||
public record UnlockAchievementEvent(AchievementID AchievementID) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f61d9f22b1f542a1b89c0c257ac065f
|
||||
@@ -0,0 +1,15 @@
|
||||
// ==============================
|
||||
// UpdateHintProgressEvent.cs
|
||||
// ==============================
|
||||
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Progression
|
||||
{
|
||||
/// <summary>
|
||||
/// Updates the hint stage for a specific level.
|
||||
/// By default stages are monotonic (only increase).
|
||||
/// Set Force=true to allow decreasing (e.g., reset/override).
|
||||
/// </summary>
|
||||
public record UpdateHintProgressEvent(string LevelID, int Stage, bool Force = false) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 982411ceab4384178a326bb478c1f097
|
||||
8
Assets/Scripts/Framework/Events/Save.meta
Normal file
8
Assets/Scripts/Framework/Events/Save.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf38f926f3fc34b69a0798bafcfc214b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Save
|
||||
{
|
||||
public record RequestGameSaveEvent : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a27f3f62cc9d4d21b332fe9b68554ab
|
||||
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.Save
|
||||
{
|
||||
public record SettingsChangedEvent : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b4561f86857c748ff905ab37dfa4fed0
|
||||
8
Assets/Scripts/Framework/Events/System.meta
Normal file
8
Assets/Scripts/Framework/Events/System.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d60b66e863cb74fb5ad43808bdf50a84
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
6
Assets/Scripts/Framework/Events/System/IEvent.cs
Normal file
6
Assets/Scripts/Framework/Events/System/IEvent.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace BriarQueen.Framework.Events.System
|
||||
{
|
||||
public interface IEvent
|
||||
{
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Framework/Events/System/IEvent.cs.meta
Normal file
2
Assets/Scripts/Framework/Events/System/IEvent.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c871ae02ed7344f1858d7cf1b2c1a7e
|
||||
8
Assets/Scripts/Framework/Events/UI.meta
Normal file
8
Assets/Scripts/Framework/Events/UI.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 587622cedaf7043dd956bdde1f2c8c67
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
7
Assets/Scripts/Framework/Events/UI/CodexChangedEvent.cs
Normal file
7
Assets/Scripts/Framework/Events/UI/CodexChangedEvent.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Data.Identifiers;
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public record CodexChangedEvent(CodexType EntryType) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a25c6ac2d479a43c3b2bef6bb401636d
|
||||
@@ -0,0 +1,8 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
using BriarQueen.Framework.Managers.UI;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public record CursorStyleChangeEvent(UICursorService.CursorStyle Style) : IEvent;
|
||||
public record OverrideCursorStyleChangeEvent(UICursorService.CursorStyle Style) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 01441a1e59f1c4dedb7d6ec150d50488
|
||||
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public record DisplayInteractEvent(string Message, object Payload = null) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b67c3e24810a746c3a83c09cd0f531cd
|
||||
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
using BriarQueen.Framework.Managers.Player.Data;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public record DisplayItemDescriptionEvent(ItemDataSo Item) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9120aa2b44db9462aa770ca558cffd21
|
||||
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Data.Identifiers;
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public record DisplayTutorialPopupEvent(TutorialPopupID TutorialID) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dac94e23408444ce69318e396ddbfa71
|
||||
6
Assets/Scripts/Framework/Events/UI/FadeCompletedEvent.cs
Normal file
6
Assets/Scripts/Framework/Events/UI/FadeCompletedEvent.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public record FadeCompletedEvent : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ef3cc035479441b3b0f9dbac770ac3e
|
||||
16
Assets/Scripts/Framework/Events/UI/FadeEvent.cs
Normal file
16
Assets/Scripts/Framework/Events/UI/FadeEvent.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public enum FadeStyle
|
||||
{
|
||||
SolidColor = 0, // Left for Compat.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Publish with color != Color.clear to fade in.
|
||||
/// Publish with color == Color.clear to fade out (uses last active style).
|
||||
/// </summary>
|
||||
public record FadeEvent(bool Hidden, float Duration = 0.25f) : IEvent;
|
||||
}
|
||||
2
Assets/Scripts/Framework/Events/UI/FadeEvent.cs.meta
Normal file
2
Assets/Scripts/Framework/Events/UI/FadeEvent.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8eefea4ba4b1c45b6b563954853ab6ce
|
||||
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public record PauseButtonClickedEvent : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2e0a379205874cfc94af8621971fd64
|
||||
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public record RequestUIOverrideEvent(bool Enabled) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aae38c023197e4b49a7c231a5a3fe6c6
|
||||
6
Assets/Scripts/Framework/Events/UI/ToggleCodexEvent.cs
Normal file
6
Assets/Scripts/Framework/Events/UI/ToggleCodexEvent.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public record ToggleCodexEvent(bool Shown) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 028e68008f1754fe98d0fc180dea0fc1
|
||||
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public record ToggleToolScreenEvent(bool Shown) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87ffac4f399a4fe0aad98d7be48a752c
|
||||
timeCreated: 1773958329
|
||||
@@ -0,0 +1,7 @@
|
||||
using BriarQueen.Data.Identifiers;
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public record ToolbeltChangedEvent(ToolID ToolID, bool Lost) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3af4618967b4408190e758a13137ed3c
|
||||
timeCreated: 1773955658
|
||||
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public record UIStackChangedEvent(bool AnyUIOpen) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d12dbbf29d274869a717b92ba55f5e6
|
||||
6
Assets/Scripts/Framework/Events/UI/UIToggleHudEvent.cs
Normal file
6
Assets/Scripts/Framework/Events/UI/UIToggleHudEvent.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using BriarQueen.Framework.Events.System;
|
||||
|
||||
namespace BriarQueen.Framework.Events.UI
|
||||
{
|
||||
public record UIToggleHudEvent(bool Show) : IEvent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31d06fbeccf8341acb2c899963d5624e
|
||||
3
Assets/Scripts/Framework/Extensions.meta
Normal file
3
Assets/Scripts/Framework/Extensions.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f8e630c784b24523973f5e10c9c28c7a
|
||||
timeCreated: 1769703422
|
||||
14
Assets/Scripts/Framework/Extensions/ObjectExtensions.cs
Normal file
14
Assets/Scripts/Framework/Extensions/ObjectExtensions.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using MemoryPack;
|
||||
|
||||
namespace BriarQueen.Framework.Extensions
|
||||
{
|
||||
public static class ObjectExtensions
|
||||
{
|
||||
public static T DeepClone<T>(this T source)
|
||||
{
|
||||
if (source == null) return default;
|
||||
|
||||
return MemoryPackSerializer.Deserialize<T>(MemoryPackSerializer.Serialize(source));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc4c2c046ef249b9bbff2b03ab852f3a
|
||||
timeCreated: 1769703422
|
||||
3
Assets/Scripts/Framework/Managers.meta
Normal file
3
Assets/Scripts/Framework/Managers.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 149de7a4e3a8462cb4127d04f288266c
|
||||
timeCreated: 1769802114
|
||||
BIN
Assets/Scripts/Framework/Managers/.DS_Store
vendored
Normal file
BIN
Assets/Scripts/Framework/Managers/.DS_Store
vendored
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user