removed not needed action belt manager tag

This commit is contained in:
Nilton Constantino 2026-07-02 07:32:19 +01:00
parent 5721986a74
commit 1bfcc4d2a8
No known key found for this signature in database
12 changed files with 12 additions and 110 deletions

View File

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

View File

@ -1,15 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4910d586b6414626b9ec5c228904bf46, type: 3}
m_Name: action-belt-manager.sentinel
m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Gameplay.Entities.Sentinel.Tags.ActionBeltManagerTag
code: action-belt-manager.sentinel

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 24d31645b4d544dd69b6ada8858ba50e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,6 +1,5 @@
using Intrepid.GameManagers; using Intrepid.GameManagers;
using Intrepid.Gameplay.Entities.Player.ActionBelt.Events; using Intrepid.Gameplay.Entities.Player.ActionBelt.Events;
using Intrepid.Gameplay.Entities.Player.Tags;
using Intrepid.SimpleEvents; using Intrepid.SimpleEvents;
using Intrepid.Utilities; using Intrepid.Utilities;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
@ -10,7 +9,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt
{ {
public class ActionBeltManager : EventListener public class ActionBeltManager : EventListener
{ {
[GroupConfigurations, SerializeField] private ActionBeltManagerTag actionBeltManagerTag;
[GroupConfigurations, SerializeField] private bool nextRight = true; [GroupConfigurations, SerializeField] private bool nextRight = true;
[Title("Action Belt")] [Title("Action Belt")]
@ -19,7 +17,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt
[GroupDebug, ShowInInspector, ReadOnly, ToggleLeft, PropertyOrder(-1)] public bool IsOperational { get; private set; } [GroupDebug, ShowInInspector, ReadOnly, ToggleLeft, PropertyOrder(-1)] public bool IsOperational { get; private set; }
public bool IsEmpty => ActionBelt.IsEmpty; public bool IsEmpty => ActionBelt.IsEmpty;
public bool IsNotEmpty => !IsEmpty; public bool IsNotEmpty => !IsEmpty;
public ActionBeltManagerTag ActionBeltManagerTag => actionBeltManagerTag;
public ActionEnvelope Focus => ActionBelt.Focus; public ActionEnvelope Focus => ActionBelt.Focus;
public ActionEnvelope PeekRight => ActionBelt.PeekRight; public ActionEnvelope PeekRight => ActionBelt.PeekRight;
public ActionEnvelope PeekLeft => ActionBelt.PeekLeft; public ActionEnvelope PeekLeft => ActionBelt.PeekLeft;
@ -52,7 +49,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt
private void WhenActionBeltDrop(ActionBeltDropEvent e) private void WhenActionBeltDrop(ActionBeltDropEvent e)
{ {
if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return;
if (ActionBelt.IsEmpty) return; if (ActionBelt.IsEmpty) return;
if (!ActionBelt.Focus.CanBeDropped) return; if (!ActionBelt.Focus.CanBeDropped) return;
if (!ActionBelt.RemoveById(ActionBelt.Focus.ActionIdentifier.Id, nextRight)) return; if (!ActionBelt.RemoveById(ActionBelt.Focus.ActionIdentifier.Id, nextRight)) return;
@ -62,8 +58,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt
private void WhenActionBeltEnable(ActionBeltEnableEvent e) private void WhenActionBeltEnable(ActionBeltEnableEvent e)
{ {
if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return;
IsOperational = true; IsOperational = true;
if (IsEmpty) return; if (IsEmpty) return;
OpenUI(); OpenUI();
@ -71,26 +65,19 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt
private void WhenActionBeltDisable(ActionBeltDisableEvent e) private void WhenActionBeltDisable(ActionBeltDisableEvent e)
{ {
if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return;
IsOperational = false; IsOperational = false;
Proxy.Instance.EventBus.Raise(new ActionBeltUICloseEvent()); Proxy.Instance.EventBus.Raise(new ActionBeltUICloseEvent());
} }
private void WhenActionBeltRefresh(ActionBeltRefreshEvent e) private void WhenActionBeltRefresh(ActionBeltRefreshEvent e)
{ {
if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return;
Proxy.Instance.EventBus.Raise(new ActionBeltUICloseEvent()); Proxy.Instance.EventBus.Raise(new ActionBeltUICloseEvent());
ActionBelt.ResetIndex(); ActionBelt.ResetIndex();
// we should affect others managers as well... Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent());
Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent
{
ActionBeltManger = e.ActionBeltManger,
});
} }
private void WhenAddActionOnTheBelt(ActionBeltAddEvent e) private void WhenAddActionOnTheBelt(ActionBeltAddEvent e)
{ {
if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return;
ActionBelt.Push(e.ActionEnvelope); ActionBelt.Push(e.ActionEnvelope);
if (!IsOperational) return; if (!IsOperational) return;
OpenUI(); OpenUI();
@ -98,48 +85,41 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt
private void WhenActionBeltRemoveById(ActionBeltRemoveByIdEvent e) private void WhenActionBeltRemoveById(ActionBeltRemoveByIdEvent e)
{ {
if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return;
if (!ActionBelt.RemoveById(e.ActionId, nextRight)) return; if (!ActionBelt.RemoveById(e.ActionId, nextRight)) return;
CirculateUI(); CirculateUI();
} }
private void WhenActionBeltRemoveByType(ActionBeltRemoveByTypeEvent e) private void WhenActionBeltRemoveByType(ActionBeltRemoveByTypeEvent e)
{ {
if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return;
if (!ActionBelt.RemoveByType(e.ActionCategory, nextRight)) return; if (!ActionBelt.RemoveByType(e.ActionCategory, nextRight)) return;
CirculateUI(); CirculateUI();
} }
private void WhenActionBeltRemoveByIdAndType(ActionBeltRemoveByIdAndTypeEvent e) private void WhenActionBeltRemoveByIdAndType(ActionBeltRemoveByIdAndTypeEvent e)
{ {
if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return;
if (!ActionBelt.RemoveByIdAndType(e.ActionId, e.ActionCategory, nextRight)) return; if (!ActionBelt.RemoveByIdAndType(e.ActionId, e.ActionCategory, nextRight)) return;
CirculateUI(); CirculateUI();
} }
private void WhenCleanActionBelt(ActionBeltClearEvent e) private void WhenCleanActionBelt(ActionBeltClearEvent e)
{ {
if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return;
ActionBelt.Clear(); ActionBelt.Clear();
} }
private void WhenActionBeltTakeAction(ActionBeltTakeActionEvent e) private void WhenActionBeltTakeAction(ActionBeltTakeActionEvent e)
{ {
if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return;
TakeAction(); TakeAction();
Proxy.Instance.EventBus.Raise(new ActionBeltUITakeActionEvent()); Proxy.Instance.EventBus.Raise(new ActionBeltUITakeActionEvent());
} }
private void WhenActionBeltNextRight(ActionBeltNextRightEvent e) private void WhenActionBeltNextRight(ActionBeltNextRightEvent e)
{ {
if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return;
ActionBelt.NextRight(); ActionBelt.NextRight();
CirculateUI(); CirculateUI();
} }
private void WhenActionBeltNextLeft(ActionBeltNextLeftEvent e) private void WhenActionBeltNextLeft(ActionBeltNextLeftEvent e)
{ {
if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return;
ActionBelt.NextLeft(); ActionBelt.NextLeft();
CirculateUI(); CirculateUI();
} }

View File

@ -20,7 +20,7 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt
protected override void WhenRaiseEnterEvent(Collider other, EntitySensor entitySensor, List<BehaviourTag> behaviourTags) protected override void WhenRaiseEnterEvent(Collider other, EntitySensor entitySensor, List<BehaviourTag> behaviourTags)
{ {
if (entitySensor.EntityTag is PlayerTag playerTag) if (entitySensor.EntityTag is PlayerTag)
{ {
foreach (var callable in callables) foreach (var callable in callables)
{ {
@ -28,7 +28,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt
if (callable.IsNotEnabled) continue; if (callable.IsNotEnabled) continue;
Proxy.Instance.EventBus.Raise(new ActionBeltAddEvent Proxy.Instance.EventBus.Raise(new ActionBeltAddEvent
{ {
ActionBeltManger = playerTag.ActionBeltManger,
ActionEnvelope = callable.BuildEnvelope(), ActionEnvelope = callable.BuildEnvelope(),
}); });
} }
@ -37,13 +36,12 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt
protected override void WhenRaiseExitEvent(Collider other, EntitySensor entitySensor) protected override void WhenRaiseExitEvent(Collider other, EntitySensor entitySensor)
{ {
if (entitySensor.EntityTag is PlayerTag playerTag) if (entitySensor.EntityTag is PlayerTag)
{ {
foreach (var callable in callables) foreach (var callable in callables)
{ {
Proxy.Instance.EventBus.Raise(new ActionBeltRemoveByIdEvent Proxy.Instance.EventBus.Raise(new ActionBeltRemoveByIdEvent
{ {
ActionBeltManger = playerTag.ActionBeltManger,
ActionId = callable.Id, ActionId = callable.Id,
}); });
} }

View File

@ -1,10 +1,8 @@
using Intrepid.Gameplay.Entities.Player.Tags;
using Intrepid.SimpleEvents; using Intrepid.SimpleEvents;
namespace Intrepid.Gameplay.Entities.Player.ActionBelt.Events namespace Intrepid.Gameplay.Entities.Player.ActionBelt.Events
{ {
public abstract class ActionBeltBaseEvent : IEventBase public abstract class ActionBeltBaseEvent : IEventBase
{ {
public ActionBeltManagerTag ActionBeltManger { get; set; }
} }
} }

View File

@ -46,10 +46,7 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine
if (Brain.ActionBeltManager.IsEmpty) return; if (Brain.ActionBeltManager.IsEmpty) return;
if (Brain.InputResolver.Sentinel.Interact()) if (Brain.InputResolver.Sentinel.Interact())
{ {
Proxy.Instance.EventBus.Raise(new ActionBeltTakeActionEvent Proxy.Instance.EventBus.Raise(new ActionBeltTakeActionEvent());
{
ActionBeltManger = Brain.ActionBeltManager.ActionBeltManagerTag,
});
return; return;
} }
@ -59,17 +56,11 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine
if (left && right) return; if (left && right) return;
if (left) if (left)
{ {
Proxy.Instance.EventBus.Raise(new ActionBeltNextLeftEvent Proxy.Instance.EventBus.Raise(new ActionBeltNextLeftEvent());
{
ActionBeltManger = Brain.ActionBeltManager.ActionBeltManagerTag,
});
} }
if (right) if (right)
{ {
Proxy.Instance.EventBus.Raise(new ActionBeltNextRightEvent Proxy.Instance.EventBus.Raise(new ActionBeltNextRightEvent());
{
ActionBeltManger = Brain.ActionBeltManager.ActionBeltManagerTag,
});
} }
} }
@ -111,7 +102,7 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine
protected bool TryConsumeDash() protected bool TryConsumeDash()
{ {
if (Brain.InputResolver.Sentinel.TryConsumeDash(out var dashTimeAt)) // dash with no ground: this could be a feature to be unlocked if (Brain.InputResolver.Sentinel.TryConsumeDash(out var dashTimeAt)) // dash with no ground: this could be a feature to be unlocked
//if (Brain.Entity.IsGrounded && Brain.InputResolver.TryConsumeDash(out var dashTimeAt)) //if (Brain.Entity.IsGrounded && Brain.InputResolver.TryConsumeDash(out var dashTimeAt))
{ {
var targetTime = Brain.Config.DashImpulse.Duration + Brain.Config.DashRecovery.Duration; var targetTime = Brain.Config.DashImpulse.Duration + Brain.Config.DashRecovery.Duration;
KeepCadenceWithInputAt(Brain.Cadences.DashProfile, targetTime, dashTimeAt); KeepCadenceWithInputAt(Brain.Cadences.DashProfile, targetTime, dashTimeAt);

View File

@ -24,11 +24,11 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine.States
{ {
Subscribe<SavingGameDataBeginEvent>(e => Subscribe<SavingGameDataBeginEvent>(e =>
{ {
DLogger.LogDebug($"Saving started"); DLogger.LogDebug("Saving started");
}); });
Subscribe<SavingGameDataEndEvent>(e => Subscribe<SavingGameDataEndEvent>(e =>
{ {
DLogger.LogDebug($"Saving ended"); DLogger.LogDebug("Saving ended");
Timer.Start(); Timer.Start();
}); });
} }

View File

@ -1,12 +0,0 @@
using System;
using Intrepid.TagSystem;
using UnityEngine;
namespace Intrepid.Gameplay.Entities.Player.Tags
{
[Serializable]
[CreateAssetMenu(fileName = "New Action Belt Manager Tag", menuName = "GON/Tags/Action Belt Manager Tag")]
public class ActionBeltManagerTag : Tag
{
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 4910d586b6414626b9ec5c228904bf46
timeCreated: 1780993733

View File

@ -1,6 +1,5 @@
using System; using System;
using Intrepid.Core.Tags; using Intrepid.Core.Tags;
using Intrepid.Utilities;
using UnityEngine; using UnityEngine;
namespace Intrepid.Gameplay.Entities.Player.Tags namespace Intrepid.Gameplay.Entities.Player.Tags
@ -9,8 +8,5 @@ namespace Intrepid.Gameplay.Entities.Player.Tags
[CreateAssetMenu(fileName = "New Player Tag", menuName = "GON/Tags/Player Tag")] [CreateAssetMenu(fileName = "New Player Tag", menuName = "GON/Tags/Player Tag")]
public class PlayerTag : EntityTag public class PlayerTag : EntityTag
{ {
[GroupConfigurations, SerializeField] private ActionBeltManagerTag actionBeltManager;
public ActionBeltManagerTag ActionBeltManger => actionBeltManager;
} }
} }

View File

@ -2,18 +2,14 @@ using Intrepid.Diagnostics;
using Intrepid.GameManagers; using Intrepid.GameManagers;
using Intrepid.Gameplay.Entities.Player.ActionBelt.Events; using Intrepid.Gameplay.Entities.Player.ActionBelt.Events;
using Intrepid.Gameplay.Entities.Player.Events; using Intrepid.Gameplay.Entities.Player.Events;
using Intrepid.Gameplay.Entities.Player.Tags;
using Intrepid.Gameplay.Journey.Runtime.Messages; using Intrepid.Gameplay.Journey.Runtime.Messages;
using Intrepid.Integration.Input; using Intrepid.Integration.Input;
using Intrepid.Utilities;
using UnityEngine; using UnityEngine;
namespace Intrepid.Gameplay.Journey.Runtime.Gameplay namespace Intrepid.Gameplay.Journey.Runtime.Gameplay
{ {
public sealed class JourneyGameplayGate : MonoBehaviour public sealed class JourneyGameplayGate : MonoBehaviour
{ {
[GroupInjections, SerializeField] private ActionBeltManagerTag actionBeltManagerTag;
public JourneyGameplayGateState State { get; private set; } = JourneyGameplayGateState.Open; public JourneyGameplayGateState State { get; private set; } = JourneyGameplayGateState.Open;
public bool IsLocked => State == JourneyGameplayGateState.Locked; public bool IsLocked => State == JourneyGameplayGateState.Locked;
@ -30,10 +26,7 @@ namespace Intrepid.Gameplay.Journey.Runtime.Gameplay
InputService.Instance.ChangeInputSchema(InputSchema.None); InputService.Instance.ChangeInputSchema(InputSchema.None);
Proxy.Instance.EventBus.Raise(new ActionBeltDisableEvent Proxy.Instance.EventBus.Raise(new ActionBeltDisableEvent());
{
ActionBeltManger = actionBeltManagerTag,
});
Proxy.Instance.EventBus.Raise(new PlayerCommandRevokedEvent()); Proxy.Instance.EventBus.Raise(new PlayerCommandRevokedEvent());
@ -66,11 +59,7 @@ namespace Intrepid.Gameplay.Journey.Runtime.Gameplay
RestoreInput(schemaToRestore); RestoreInput(schemaToRestore);
} }
Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent());
{
ActionBeltManger = actionBeltManagerTag,
});
Proxy.Instance.EventBus.Raise(new PlayerCommandGrantedEvent()); Proxy.Instance.EventBus.Raise(new PlayerCommandGrantedEvent());
State = JourneyGameplayGateState.Open; State = JourneyGameplayGateState.Open;
@ -82,11 +71,7 @@ namespace Intrepid.Gameplay.Journey.Runtime.Gameplay
{ {
InputService.Instance.ChangeInputSchema(InputSchema.Sentinel); InputService.Instance.ChangeInputSchema(InputSchema.Sentinel);
Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent());
{
ActionBeltManger = actionBeltManagerTag,
});
Proxy.Instance.EventBus.Raise(new PlayerCommandGrantedEvent()); Proxy.Instance.EventBus.Raise(new PlayerCommandGrantedEvent());
State = JourneyGameplayGateState.Open; State = JourneyGameplayGateState.Open;