Compare commits
No commits in common. "84199621602b11fdacb82e97c9d16ab5ff550b32" and "5721986a746c16f5d2b626fe495ecac2cc31767e" have entirely different histories.
8419962160
...
5721986a74
@ -251,7 +251,7 @@ MonoBehaviour:
|
|||||||
id: a2bcfde700d74b6397798ea30791316a
|
id: a2bcfde700d74b6397798ea30791316a
|
||||||
actionCategory: 0
|
actionCategory: 0
|
||||||
canBeDropped: 0
|
canBeDropped: 0
|
||||||
shouldDropFromBeltWhenActivated: 0
|
shouldDropFromBeltWhenActivated: 1
|
||||||
saveStationModelPrototype: {fileID: 3729166946730868368}
|
saveStationModelPrototype: {fileID: 3729166946730868368}
|
||||||
actionLocalization: {fileID: 11400000, guid: 218e1b6f0cf274c8195e312760cf82b0, type: 2}
|
actionLocalization: {fileID: 11400000, guid: 218e1b6f0cf274c8195e312760cf82b0, type: 2}
|
||||||
descriptionLocalization: {fileID: 11400000, guid: 677dd73e7449b408590ce7f89865a8d0, type: 2}
|
descriptionLocalization: {fileID: 11400000, guid: 677dd73e7449b408590ce7f89865a8d0, type: 2}
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5fa9aef3ab3364c00927f003e33f4321
|
guid: 88399dcea34e045d089090d6a4dc0143
|
||||||
NativeFormatImporter:
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 11400000
|
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
%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,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 99848f21b8e934dc1a0f1f50b435799d
|
guid: 24d31645b4d544dd69b6ada8858ba50e
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 11400000
|
mainObjectFileID: 11400000
|
||||||
@ -16,5 +16,3 @@ MonoBehaviour:
|
|||||||
shouldBeKeptAlwaysEnabled: 0
|
shouldBeKeptAlwaysEnabled: 0
|
||||||
onEntry: {fileID: 11400000, guid: b12d41919e089475da15bef8808f80b8, type: 2}
|
onEntry: {fileID: 11400000, guid: b12d41919e089475da15bef8808f80b8, type: 2}
|
||||||
onExit: {fileID: 11400000, guid: 86176d631377e4d5fba70988ef37e9d9, type: 2}
|
onExit: {fileID: 11400000, guid: 86176d631377e4d5fba70988ef37e9d9, type: 2}
|
||||||
onShow: {fileID: 11400000, guid: 5fa9aef3ab3364c00927f003e33f4321, type: 2}
|
|
||||||
onHide: {fileID: 11400000, guid: 99848f21b8e934dc1a0f1f50b435799d, type: 2}
|
|
||||||
|
|||||||
@ -1,18 +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: 6f2337b04d5e44dba892ac6b72ae7e44, type: 3}
|
|
||||||
m_Name: action-belt.window.hide
|
|
||||||
m_EditorClassIdentifier: Intrepid General Utilities::Intrepid.Window.Data.WindowAnimationData
|
|
||||||
mode: 3
|
|
||||||
direction: 1
|
|
||||||
soundEffect: {fileID: 0}
|
|
||||||
animationSpeed: 3
|
|
||||||
@ -1,18 +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: 6f2337b04d5e44dba892ac6b72ae7e44, type: 3}
|
|
||||||
m_Name: action-belt.window.show
|
|
||||||
m_EditorClassIdentifier: Intrepid General Utilities::Intrepid.Window.Data.WindowAnimationData
|
|
||||||
mode: 3
|
|
||||||
direction: 0
|
|
||||||
soundEffect: {fileID: 0}
|
|
||||||
animationSpeed: 3
|
|
||||||
@ -1,5 +1,6 @@
|
|||||||
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;
|
||||||
@ -9,6 +10,7 @@ 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")]
|
||||||
@ -17,6 +19,7 @@ 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;
|
||||||
@ -49,6 +52,7 @@ 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;
|
||||||
@ -58,25 +62,35 @@ 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;
|
||||||
OpenUI();
|
OpenUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
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();
|
||||||
Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent());
|
// we should affect others managers as well...
|
||||||
|
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();
|
||||||
@ -84,42 +98,48 @@ 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();
|
||||||
if (!IsOperational) return;
|
|
||||||
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();
|
||||||
}
|
}
|
||||||
@ -134,20 +154,18 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt
|
|||||||
|
|
||||||
private void OpenUI()
|
private void OpenUI()
|
||||||
{
|
{
|
||||||
if (!IsOperational) return;
|
|
||||||
if (IsEmpty) return;
|
|
||||||
|
|
||||||
Proxy.Instance.EventBus.Raise(new ActionBeltUIOpenEvent
|
Proxy.Instance.EventBus.Raise(new ActionBeltUIOpenEvent
|
||||||
{
|
{
|
||||||
ActionBelt = ActionBelt,
|
ActionBelt = ActionBelt,
|
||||||
|
// GetFocusActionEnvelope = () => ActionBelt.Focus,
|
||||||
|
// SneakPeekRightActionEnvelope = () => ActionBelt.PeekRight,
|
||||||
|
// SneakPeekLeftActionEnvelope = () => ActionBelt.PeekLeft,
|
||||||
|
// GetSize = () => ActionBelt.Count,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CirculateUI()
|
private void CirculateUI()
|
||||||
{
|
{
|
||||||
if (!IsOperational) return;
|
|
||||||
if (IsEmpty) return;
|
|
||||||
|
|
||||||
if (nextRight)
|
if (nextRight)
|
||||||
{
|
{
|
||||||
Proxy.Instance.EventBus.Raise(new ActionBeltUIToRightEvent());
|
Proxy.Instance.EventBus.Raise(new ActionBeltUIToRightEvent());
|
||||||
|
|||||||
@ -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)
|
if (entitySensor.EntityTag is PlayerTag playerTag)
|
||||||
{
|
{
|
||||||
foreach (var callable in callables)
|
foreach (var callable in callables)
|
||||||
{
|
{
|
||||||
@ -28,6 +28,7 @@ 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(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -36,12 +37,13 @@ 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)
|
if (entitySensor.EntityTag is PlayerTag 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,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
|
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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,8 +0,0 @@
|
|||||||
using Intrepid.SimpleEvents;
|
|
||||||
|
|
||||||
namespace Intrepid.Gameplay.Entities.Player.ActionBelt.Events
|
|
||||||
{
|
|
||||||
public class ActionBeltHideEvent : IEventBase
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: d82e173549834f8ebb63570df81ef64f
|
|
||||||
timeCreated: 1782975954
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
using Intrepid.SimpleEvents;
|
|
||||||
|
|
||||||
namespace Intrepid.Gameplay.Entities.Player.ActionBelt.Events
|
|
||||||
{
|
|
||||||
public class ActionBeltShowEvent : IEventBase
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: d84bdcd9e99048e08e3d3ad428b60fd0
|
|
||||||
timeCreated: 1782975971
|
|
||||||
@ -62,9 +62,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt.UI
|
|||||||
|
|
||||||
protected override void Subscriptions()
|
protected override void Subscriptions()
|
||||||
{
|
{
|
||||||
Subscribe<ActionBeltShowEvent>(_ => ManagedWindow.Show());
|
|
||||||
Subscribe<ActionBeltHideEvent>(_ => ManagedWindow.Hide());
|
|
||||||
|
|
||||||
Subscribe<ActionBeltUIToRightEvent>(WhenActionBeltNextRight);
|
Subscribe<ActionBeltUIToRightEvent>(WhenActionBeltNextRight);
|
||||||
Subscribe<ActionBeltUIToLeftEvent>(WhenActionBeltNextLeft);
|
Subscribe<ActionBeltUIToLeftEvent>(WhenActionBeltNextLeft);
|
||||||
|
|
||||||
@ -74,8 +71,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt.UI
|
|||||||
|
|
||||||
private void WhenActionBeltUIDrop(ActionBeltUIDropEvent e)
|
private void WhenActionBeltUIDrop(ActionBeltUIDropEvent e)
|
||||||
{
|
{
|
||||||
if (!actionBeltManager.IsOperational) return;
|
|
||||||
|
|
||||||
center.BlinkBorderDropped();
|
center.BlinkBorderDropped();
|
||||||
if (local.gameObject.activeSelf) local.BlinkBorderDropped();
|
if (local.gameObject.activeSelf) local.BlinkBorderDropped();
|
||||||
}
|
}
|
||||||
@ -94,7 +89,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt.UI
|
|||||||
|
|
||||||
private void WhenActionBeltNextRight(ActionBeltUIToRightEvent e)
|
private void WhenActionBeltNextRight(ActionBeltUIToRightEvent e)
|
||||||
{
|
{
|
||||||
if (!actionBeltManager.IsOperational) return;
|
|
||||||
if (!IsOptionActive) return;
|
if (!IsOptionActive) return;
|
||||||
SwitchRight();
|
SwitchRight();
|
||||||
contentIconAnimation.SpriteAnimation.Reset();
|
contentIconAnimation.SpriteAnimation.Reset();
|
||||||
@ -103,7 +97,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt.UI
|
|||||||
|
|
||||||
private void WhenActionBeltNextLeft(ActionBeltUIToLeftEvent e)
|
private void WhenActionBeltNextLeft(ActionBeltUIToLeftEvent e)
|
||||||
{
|
{
|
||||||
if (!actionBeltManager.IsOperational) return;
|
|
||||||
if (!IsOptionActive) return;
|
if (!IsOptionActive) return;
|
||||||
SwitchLeft();
|
SwitchLeft();
|
||||||
contentIconAnimation.SpriteAnimation.Reset();
|
contentIconAnimation.SpriteAnimation.Reset();
|
||||||
@ -112,8 +105,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt.UI
|
|||||||
|
|
||||||
private void WhenActionBeltUITakeAction(ActionBeltUITakeActionEvent e)
|
private void WhenActionBeltUITakeAction(ActionBeltUITakeActionEvent e)
|
||||||
{
|
{
|
||||||
if (!actionBeltManager.IsOperational) return;
|
|
||||||
|
|
||||||
center.BlinkBorderActionTaken();
|
center.BlinkBorderActionTaken();
|
||||||
if (local.gameObject.activeSelf) local.BlinkBorderActionTaken();
|
if (local.gameObject.activeSelf) local.BlinkBorderActionTaken();
|
||||||
}
|
}
|
||||||
@ -138,13 +129,6 @@ namespace Intrepid.Gameplay.Entities.Player.ActionBelt.UI
|
|||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
UpdateTheme();
|
UpdateTheme();
|
||||||
|
|
||||||
if (!actionBeltManager.IsOperational)
|
|
||||||
{
|
|
||||||
Proxy.Instance.EventBus.Raise(new ActionBeltUICloseEvent());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (GetNumberOfActionsInBelt())
|
switch (GetNumberOfActionsInBelt())
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|||||||
@ -46,7 +46,10 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,11 +59,17 @@ 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,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +111,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);
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
using Intrepid.Core;
|
using Intrepid.Core;
|
||||||
using Intrepid.Diagnostics;
|
using Intrepid.Diagnostics;
|
||||||
using Intrepid.GameManagers;
|
|
||||||
using Intrepid.Gameplay.Entities.Player.ActionBelt.Events;
|
|
||||||
using Intrepid.Integration.Input;
|
using Intrepid.Integration.Input;
|
||||||
using Intrepid.Integration.Persistence.Events;
|
using Intrepid.Integration.Persistence.Events;
|
||||||
using Intrepid.Structures;
|
using Intrepid.Structures;
|
||||||
@ -24,13 +22,13 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine.States
|
|||||||
|
|
||||||
protected override void Subscriptions()
|
protected override void Subscriptions()
|
||||||
{
|
{
|
||||||
Subscribe<SavingGameDataBeginEvent>(_ =>
|
Subscribe<SavingGameDataBeginEvent>(e =>
|
||||||
{
|
{
|
||||||
DLogger.LogDebug("Saving started");
|
DLogger.LogDebug($"Saving started");
|
||||||
});
|
});
|
||||||
Subscribe<SavingGameDataEndEvent>(_ =>
|
Subscribe<SavingGameDataEndEvent>(e =>
|
||||||
{
|
{
|
||||||
DLogger.LogDebug("Saving ended");
|
DLogger.LogDebug($"Saving ended");
|
||||||
Timer.Start();
|
Timer.Start();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -55,7 +53,6 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine.States
|
|||||||
protected override void RunOnExit()
|
protected override void RunOnExit()
|
||||||
{
|
{
|
||||||
Timer.Stop();
|
Timer.Stop();
|
||||||
Proxy.Instance.EventBus.Raise(new ActionBeltShowEvent());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void RunOnUpdate()
|
public override void RunOnUpdate()
|
||||||
|
|||||||
@ -0,0 +1,12 @@
|
|||||||
|
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
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4910d586b6414626b9ec5c228904bf46
|
||||||
|
timeCreated: 1780993733
|
||||||
@ -1,5 +1,6 @@
|
|||||||
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
|
||||||
@ -8,5 +9,8 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2,14 +2,18 @@ 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;
|
||||||
@ -26,7 +30,10 @@ 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());
|
||||||
|
|
||||||
@ -59,7 +66,11 @@ 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;
|
||||||
@ -71,7 +82,11 @@ 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;
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
using Intrepid.GameManagers;
|
using Intrepid.GameManagers;
|
||||||
using Intrepid.Gameplay.Entities.Player.ActionBelt;
|
using Intrepid.Gameplay.Entities.Player.ActionBelt;
|
||||||
using Intrepid.Gameplay.Entities.Player.ActionBelt.Events;
|
|
||||||
using Intrepid.Gameplay.Entities.Player.Sentinel.Events;
|
using Intrepid.Gameplay.Entities.Player.Sentinel.Events;
|
||||||
using Intrepid.Localization;
|
using Intrepid.Localization;
|
||||||
using Intrepid.Utilities;
|
using Intrepid.Utilities;
|
||||||
@ -24,7 +23,6 @@ namespace Intrepid.Gameplay.Prototyping.SaveStations
|
|||||||
StageTag = saveStationModelPrototype.StageTag,
|
StageTag = saveStationModelPrototype.StageTag,
|
||||||
DeploymentPoint = saveStationModelPrototype.DeploymentPoint
|
DeploymentPoint = saveStationModelPrototype.DeploymentPoint
|
||||||
});
|
});
|
||||||
Proxy.Instance.EventBus.Raise(new ActionBeltHideEvent());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5,7 +5,7 @@
|
|||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "git",
|
"source": "git",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"hash": "6f1ee5036dced65524bd7cc8af9f244d52f15491"
|
"hash": "8b705cd47233eb0aaa29b302894b4cf1e256b919"
|
||||||
},
|
},
|
||||||
"com.unity.2d.animation": {
|
"com.unity.2d.animation": {
|
||||||
"version": "13.0.5",
|
"version": "13.0.5",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user