removed not needed action belt manager tag
This commit is contained in:
parent
5721986a74
commit
1bfcc4d2a8
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88399dcea34e045d089090d6a4dc0143
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -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
|
||||
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24d31645b4d544dd69b6ada8858ba50e
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt
|
||||
|
||||
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)
|
||||
{
|
||||
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
@ -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; }
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
|
||||
@ -24,11 +24,11 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine.States
|
||||
{
|
||||
Subscribe<SavingGameDataBeginEvent>(e =>
|
||||
{
|
||||
DLogger.LogDebug($"Saving started");
|
||||
DLogger.LogDebug("Saving started");
|
||||
});
|
||||
Subscribe<SavingGameDataEndEvent>(e =>
|
||||
{
|
||||
DLogger.LogDebug($"Saving ended");
|
||||
DLogger.LogDebug("Saving ended");
|
||||
Timer.Start();
|
||||
});
|
||||
}
|
||||
|
||||
@ -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
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4910d586b6414626b9ec5c228904bf46
|
||||
timeCreated: 1780993733
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user