diff --git a/Assets/Resources/Tags/ActionBeltMnager.meta b/Assets/Resources/Tags/ActionBeltMnager.meta deleted file mode 100644 index a5348b9..0000000 --- a/Assets/Resources/Tags/ActionBeltMnager.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 88399dcea34e045d089090d6a4dc0143 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Resources/Tags/ActionBeltMnager/action-belt-manager.sentinel.asset b/Assets/Resources/Tags/ActionBeltMnager/action-belt-manager.sentinel.asset deleted file mode 100644 index 95503ce..0000000 --- a/Assets/Resources/Tags/ActionBeltMnager/action-belt-manager.sentinel.asset +++ /dev/null @@ -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 diff --git a/Assets/Resources/Tags/ActionBeltMnager/action-belt-manager.sentinel.asset.meta b/Assets/Resources/Tags/ActionBeltMnager/action-belt-manager.sentinel.asset.meta deleted file mode 100644 index a54bfcc..0000000 --- a/Assets/Resources/Tags/ActionBeltMnager/action-belt-manager.sentinel.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 24d31645b4d544dd69b6ada8858ba50e -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/ActionBelt/ActionBeltManager.cs b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/ActionBelt/ActionBeltManager.cs index eeacff8..6ecbfea 100644 --- a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/ActionBelt/ActionBeltManager.cs +++ b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/ActionBelt/ActionBeltManager.cs @@ -1,6 +1,5 @@ using Intrepid.GameManagers; using Intrepid.Gameplay.Entities.Player.ActionBelt.Events; -using Intrepid.Gameplay.Entities.Player.Tags; using Intrepid.SimpleEvents; using Intrepid.Utilities; using Sirenix.OdinInspector; @@ -10,7 +9,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt { public class ActionBeltManager : EventListener { - [GroupConfigurations, SerializeField] private ActionBeltManagerTag actionBeltManagerTag; [GroupConfigurations, SerializeField] private bool nextRight = true; [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; } public bool IsEmpty => ActionBelt.IsEmpty; public bool IsNotEmpty => !IsEmpty; - public ActionBeltManagerTag ActionBeltManagerTag => actionBeltManagerTag; public ActionEnvelope Focus => ActionBelt.Focus; public ActionEnvelope PeekRight => ActionBelt.PeekRight; public ActionEnvelope PeekLeft => ActionBelt.PeekLeft; @@ -52,7 +49,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt private void WhenActionBeltDrop(ActionBeltDropEvent e) { - if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return; if (ActionBelt.IsEmpty) return; if (!ActionBelt.Focus.CanBeDropped) 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) { - if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return; - IsOperational = true; if (IsEmpty) return; OpenUI(); @@ -71,26 +65,19 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt private void WhenActionBeltDisable(ActionBeltDisableEvent e) { - if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return; IsOperational = false; Proxy.Instance.EventBus.Raise(new ActionBeltUICloseEvent()); } private void WhenActionBeltRefresh(ActionBeltRefreshEvent e) { - if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return; Proxy.Instance.EventBus.Raise(new ActionBeltUICloseEvent()); ActionBelt.ResetIndex(); - // we should affect others managers as well... - Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent - { - ActionBeltManger = e.ActionBeltManger, - }); + Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent()); } private void WhenAddActionOnTheBelt(ActionBeltAddEvent e) { - if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return; ActionBelt.Push(e.ActionEnvelope); if (!IsOperational) return; OpenUI(); @@ -98,48 +85,41 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt private void WhenActionBeltRemoveById(ActionBeltRemoveByIdEvent e) { - if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return; if (!ActionBelt.RemoveById(e.ActionId, nextRight)) return; CirculateUI(); } private void WhenActionBeltRemoveByType(ActionBeltRemoveByTypeEvent e) { - if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return; if (!ActionBelt.RemoveByType(e.ActionCategory, nextRight)) return; CirculateUI(); } private void WhenActionBeltRemoveByIdAndType(ActionBeltRemoveByIdAndTypeEvent e) { - if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return; if (!ActionBelt.RemoveByIdAndType(e.ActionId, e.ActionCategory, nextRight)) return; CirculateUI(); } private void WhenCleanActionBelt(ActionBeltClearEvent e) { - if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return; ActionBelt.Clear(); } private void WhenActionBeltTakeAction(ActionBeltTakeActionEvent e) { - if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return; TakeAction(); Proxy.Instance.EventBus.Raise(new ActionBeltUITakeActionEvent()); } private void WhenActionBeltNextRight(ActionBeltNextRightEvent e) { - if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return; ActionBelt.NextRight(); CirculateUI(); } private void WhenActionBeltNextLeft(ActionBeltNextLeftEvent e) { - if (!actionBeltManagerTag.Equals(e.ActionBeltManger)) return; ActionBelt.NextLeft(); CirculateUI(); } diff --git a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/ActionBelt/ActionBeltTrigger.cs b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/ActionBelt/ActionBeltTrigger.cs index 238e7eb..9ae76fb 100644 --- a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/ActionBelt/ActionBeltTrigger.cs +++ b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/ActionBelt/ActionBeltTrigger.cs @@ -20,7 +20,7 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt protected override void WhenRaiseEnterEvent(Collider other, EntitySensor entitySensor, List behaviourTags) { - if (entitySensor.EntityTag is PlayerTag playerTag) + if (entitySensor.EntityTag is PlayerTag) { foreach (var callable in callables) { @@ -28,7 +28,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt if (callable.IsNotEnabled) continue; Proxy.Instance.EventBus.Raise(new ActionBeltAddEvent { - ActionBeltManger = playerTag.ActionBeltManger, ActionEnvelope = callable.BuildEnvelope(), }); } @@ -37,13 +36,12 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt protected override void WhenRaiseExitEvent(Collider other, EntitySensor entitySensor) { - if (entitySensor.EntityTag is PlayerTag playerTag) + if (entitySensor.EntityTag is PlayerTag) { foreach (var callable in callables) { Proxy.Instance.EventBus.Raise(new ActionBeltRemoveByIdEvent { - ActionBeltManger = playerTag.ActionBeltManger, ActionId = callable.Id, }); } diff --git a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/ActionBelt/Events/ActionBeltBaseEvent.cs b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/ActionBelt/Events/ActionBeltBaseEvent.cs index 78a97d5..4be99b6 100644 --- a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/ActionBelt/Events/ActionBeltBaseEvent.cs +++ b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/ActionBelt/Events/ActionBeltBaseEvent.cs @@ -1,10 +1,8 @@ -using Intrepid.Gameplay.Entities.Player.Tags; using Intrepid.SimpleEvents; namespace Intrepid.Gameplay.Entities.Player.ActionBelt.Events { public abstract class ActionBeltBaseEvent : IEventBase { - public ActionBeltManagerTag ActionBeltManger { get; set; } } } \ No newline at end of file diff --git a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Sentinel/StateMachine/SentinelState.cs b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Sentinel/StateMachine/SentinelState.cs index eaec9d6..6f2a394 100644 --- a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Sentinel/StateMachine/SentinelState.cs +++ b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Sentinel/StateMachine/SentinelState.cs @@ -46,10 +46,7 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine if (Brain.ActionBeltManager.IsEmpty) return; if (Brain.InputResolver.Sentinel.Interact()) { - Proxy.Instance.EventBus.Raise(new ActionBeltTakeActionEvent - { - ActionBeltManger = Brain.ActionBeltManager.ActionBeltManagerTag, - }); + Proxy.Instance.EventBus.Raise(new ActionBeltTakeActionEvent()); return; } @@ -59,17 +56,11 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine if (left && right) return; if (left) { - Proxy.Instance.EventBus.Raise(new ActionBeltNextLeftEvent - { - ActionBeltManger = Brain.ActionBeltManager.ActionBeltManagerTag, - }); + Proxy.Instance.EventBus.Raise(new ActionBeltNextLeftEvent()); } if (right) { - Proxy.Instance.EventBus.Raise(new ActionBeltNextRightEvent - { - ActionBeltManger = Brain.ActionBeltManager.ActionBeltManagerTag, - }); + Proxy.Instance.EventBus.Raise(new ActionBeltNextRightEvent()); } } @@ -111,7 +102,7 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine 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.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; KeepCadenceWithInputAt(Brain.Cadences.DashProfile, targetTime, dashTimeAt); diff --git a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Sentinel/StateMachine/States/SentinelStateSavingStation.cs b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Sentinel/StateMachine/States/SentinelStateSavingStation.cs index d35c2db..20e976b 100644 --- a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Sentinel/StateMachine/States/SentinelStateSavingStation.cs +++ b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Sentinel/StateMachine/States/SentinelStateSavingStation.cs @@ -24,11 +24,11 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine.States { Subscribe(e => { - DLogger.LogDebug($"Saving started"); + DLogger.LogDebug("Saving started"); }); Subscribe(e => { - DLogger.LogDebug($"Saving ended"); + DLogger.LogDebug("Saving ended"); Timer.Start(); }); } diff --git a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Tags/ActionBeltManagerTag.cs b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Tags/ActionBeltManagerTag.cs deleted file mode 100644 index fbd1b48..0000000 --- a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Tags/ActionBeltManagerTag.cs +++ /dev/null @@ -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 - { - } -} \ No newline at end of file diff --git a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Tags/ActionBeltManagerTag.cs.meta b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Tags/ActionBeltManagerTag.cs.meta deleted file mode 100644 index d5aff10..0000000 --- a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Tags/ActionBeltManagerTag.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 4910d586b6414626b9ec5c228904bf46 -timeCreated: 1780993733 \ No newline at end of file diff --git a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Tags/PlayerTag.cs b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Tags/PlayerTag.cs index b6cfb6f..62d4e4e 100644 --- a/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Tags/PlayerTag.cs +++ b/Assets/Scripts/Intrepid/Gameplay/Entities/Player/Tags/PlayerTag.cs @@ -1,6 +1,5 @@ using System; using Intrepid.Core.Tags; -using Intrepid.Utilities; using UnityEngine; 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")] public class PlayerTag : EntityTag { - [GroupConfigurations, SerializeField] private ActionBeltManagerTag actionBeltManager; - - public ActionBeltManagerTag ActionBeltManger => actionBeltManager; } } \ No newline at end of file diff --git a/Assets/Scripts/Intrepid/Gameplay/Journey/Runtime/Gameplay/JourneyGameplayGate.cs b/Assets/Scripts/Intrepid/Gameplay/Journey/Runtime/Gameplay/JourneyGameplayGate.cs index 8499bc0..096713b 100644 --- a/Assets/Scripts/Intrepid/Gameplay/Journey/Runtime/Gameplay/JourneyGameplayGate.cs +++ b/Assets/Scripts/Intrepid/Gameplay/Journey/Runtime/Gameplay/JourneyGameplayGate.cs @@ -2,18 +2,14 @@ using Intrepid.Diagnostics; using Intrepid.GameManagers; using Intrepid.Gameplay.Entities.Player.ActionBelt.Events; using Intrepid.Gameplay.Entities.Player.Events; -using Intrepid.Gameplay.Entities.Player.Tags; using Intrepid.Gameplay.Journey.Runtime.Messages; using Intrepid.Integration.Input; -using Intrepid.Utilities; using UnityEngine; namespace Intrepid.Gameplay.Journey.Runtime.Gameplay { public sealed class JourneyGameplayGate : MonoBehaviour { - [GroupInjections, SerializeField] private ActionBeltManagerTag actionBeltManagerTag; - public JourneyGameplayGateState State { get; private set; } = JourneyGameplayGateState.Open; public bool IsLocked => State == JourneyGameplayGateState.Locked; @@ -30,10 +26,7 @@ namespace Intrepid.Gameplay.Journey.Runtime.Gameplay InputService.Instance.ChangeInputSchema(InputSchema.None); - Proxy.Instance.EventBus.Raise(new ActionBeltDisableEvent - { - ActionBeltManger = actionBeltManagerTag, - }); + Proxy.Instance.EventBus.Raise(new ActionBeltDisableEvent()); Proxy.Instance.EventBus.Raise(new PlayerCommandRevokedEvent()); @@ -66,11 +59,7 @@ namespace Intrepid.Gameplay.Journey.Runtime.Gameplay RestoreInput(schemaToRestore); } - Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent - { - ActionBeltManger = actionBeltManagerTag, - }); - + Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent()); Proxy.Instance.EventBus.Raise(new PlayerCommandGrantedEvent()); State = JourneyGameplayGateState.Open; @@ -82,11 +71,7 @@ namespace Intrepid.Gameplay.Journey.Runtime.Gameplay { InputService.Instance.ChangeInputSchema(InputSchema.Sentinel); - Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent - { - ActionBeltManger = actionBeltManagerTag, - }); - + Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent()); Proxy.Instance.EventBus.Raise(new PlayerCommandGrantedEvent()); State = JourneyGameplayGateState.Open;