First commit for private source control. Older commits available on Github.
This commit is contained in:
3
Assets/Scripts/Game/Items/HoverZones/ChapterOne.meta
Normal file
3
Assets/Scripts/Game/Items/HoverZones/ChapterOne.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bceb9c6179804ca6a6ab860091497bec
|
||||
timeCreated: 1773590266
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b96e740c17be4776b814df0cdf3e4ba9
|
||||
timeCreated: 1773837562
|
||||
@@ -0,0 +1,13 @@
|
||||
using BriarQueen.Data.Identifiers;
|
||||
using BriarQueen.Data.IO.Saves;
|
||||
|
||||
namespace BriarQueen.Game.Items.HoverZones.ChapterOne.Village
|
||||
{
|
||||
public class FountainInteractZone : InteractZone
|
||||
{
|
||||
protected override bool CheckUnlockStatus()
|
||||
{
|
||||
return SaveManager.GetLevelFlag(LevelFlag.PumpWaterRestored);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 91690066830a4fc18ef4d37e59c35f77
|
||||
timeCreated: 1773492836
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf66aebc6b634be6835a5cb959b676bc
|
||||
timeCreated: 1773590266
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a3eccc4b792f428e998c154badaf8df2
|
||||
timeCreated: 1773859979
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace BriarQueen.Game.Items.HoverZones.ChapterOne.Workshop.Downstairs
|
||||
{
|
||||
public class WorkshopBookcaseInteractZone : InteractZone
|
||||
{
|
||||
public override string InteractableName => !CanvasGroup.interactable ? string.Empty : "Inspect Bookcase";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 075b00fc69004603b54fe09287b25112
|
||||
timeCreated: 1773859979
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a842be13bc18495282b2baad5f07b164
|
||||
timeCreated: 1773590266
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f5eb751f8264020972f1f38d92567ba
|
||||
timeCreated: 1773591269
|
||||
@@ -0,0 +1,19 @@
|
||||
using BriarQueen.Game.Puzzles.ChapterOne.Workshop.BoxPuzzle;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BriarQueen.Game.Items.HoverZones.ChapterOne.Workshop.Upstairs.PuzzleBox
|
||||
{
|
||||
public class PuzzleBoxInteractZone : InteractZone
|
||||
{
|
||||
[SerializeField]
|
||||
private WorkshopBasePuzzleBox _basePuzzleBox;
|
||||
|
||||
private string _interactName = string.Empty;
|
||||
public override string InteractableName => _interactName;
|
||||
|
||||
public void SetInteractableName()
|
||||
{
|
||||
_interactName = "Open Box";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2700af83a384ed2a2003a64ecd72f1a
|
||||
timeCreated: 1773515450
|
||||
@@ -0,0 +1,40 @@
|
||||
using BriarQueen.Data.Identifiers;
|
||||
using BriarQueen.Data.IO.Saves;
|
||||
using BriarQueen.Framework.Events.UI;
|
||||
using BriarQueen.Framework.Managers.Player.Data;
|
||||
using Cysharp.Threading.Tasks;
|
||||
|
||||
namespace BriarQueen.Game.Items.HoverZones.ChapterOne.Workshop.Upstairs
|
||||
{
|
||||
public class WorkshopSafeInteractZone : InteractZone
|
||||
{
|
||||
public override string InteractableName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!SaveManager.GetLevelFlag(LevelFlag.WorkshopSafeUnlocked))
|
||||
return "Locked Safe";
|
||||
|
||||
return "Unlocked Safe";
|
||||
}
|
||||
}
|
||||
|
||||
public override async UniTask OnInteract(ItemDataSo item = null)
|
||||
{
|
||||
if (item != null)
|
||||
{
|
||||
EventCoordinator.Publish(new DisplayInteractEvent(InteractEventIDs.Get(ItemInteractKey.CantUseItem)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SaveManager.GetLevelFlag(LevelFlag.WorkshopSafeUnlocked))
|
||||
{
|
||||
EventCoordinator.Publish(new DisplayInteractEvent(
|
||||
InteractEventIDs.Get(LevelInteractKey.WorkshopLockedSafe)));
|
||||
return;
|
||||
}
|
||||
|
||||
await base.OnInteract(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d9fb667aaff5490b9478cddc37e24c95
|
||||
timeCreated: 1772812658
|
||||
@@ -0,0 +1,12 @@
|
||||
using BriarQueen.Data.IO.Saves;
|
||||
|
||||
namespace BriarQueen.Game.Items.HoverZones.ChapterOne.Workshop
|
||||
{
|
||||
public class WorkshopDownstairsDoorInteractZone : InteractZone
|
||||
{
|
||||
protected override bool CheckUnlockStatus()
|
||||
{
|
||||
return SaveManager.GetLevelFlag(LevelFlag.WorkshopDownstairsDoorOpen);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36a0b0a0b0714c4ea5138830f1405a11
|
||||
timeCreated: 1773572899
|
||||
112
Assets/Scripts/Game/Items/HoverZones/InteractZone.cs
Normal file
112
Assets/Scripts/Game/Items/HoverZones/InteractZone.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using BriarQueen.Data.Identifiers;
|
||||
using BriarQueen.Framework.Coordinators.Events;
|
||||
using BriarQueen.Framework.Events.UI;
|
||||
using BriarQueen.Framework.Managers.Interaction.Data;
|
||||
using BriarQueen.Framework.Managers.IO;
|
||||
using BriarQueen.Framework.Managers.Levels;
|
||||
using BriarQueen.Framework.Managers.Player.Data;
|
||||
using BriarQueen.Framework.Managers.UI;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using VContainer;
|
||||
|
||||
namespace BriarQueen.Game.Items.HoverZones
|
||||
{
|
||||
public class InteractZone : MonoBehaviour, IInteractable
|
||||
{
|
||||
[Header("Level Setup")]
|
||||
[SerializeField]
|
||||
private LevelKey _levelToLoad;
|
||||
|
||||
[SerializeField]
|
||||
private string _levelName;
|
||||
|
||||
[SerializeField]
|
||||
private string _lockedTooltipText = string.Empty;
|
||||
[SerializeField]
|
||||
private string _lockedInteractText = string.Empty;
|
||||
|
||||
[SerializeField]
|
||||
private bool _locked;
|
||||
|
||||
[Header("UI Setup")]
|
||||
[SerializeField]
|
||||
private UICursorService.CursorStyle _cursorStyle = UICursorService.CursorStyle.Travel;
|
||||
|
||||
protected EventCoordinator EventCoordinator;
|
||||
protected LevelManager LevelManager;
|
||||
protected SaveManager SaveManager;
|
||||
|
||||
public CanvasGroup CanvasGroup;
|
||||
|
||||
protected void Awake()
|
||||
{
|
||||
if(CanvasGroup == null)
|
||||
CanvasGroup = GetComponent<CanvasGroup>();
|
||||
}
|
||||
|
||||
protected void Start()
|
||||
{
|
||||
if (_locked && CheckUnlockStatus())
|
||||
Unlock();
|
||||
}
|
||||
|
||||
public UICursorService.CursorStyle ApplicableCursorStyle => _cursorStyle;
|
||||
|
||||
public virtual string InteractableName => _locked ? _lockedTooltipText : _levelName;
|
||||
|
||||
public virtual async UniTask OnInteract(ItemDataSo item = null)
|
||||
{
|
||||
if (_locked)
|
||||
{
|
||||
var message = !string.IsNullOrEmpty(_lockedInteractText) ? _lockedInteractText
|
||||
: InteractEventIDs.Get(EnvironmentInteractKey.Locked);
|
||||
|
||||
EventCoordinator.Publish(new DisplayInteractEvent(message));
|
||||
return;
|
||||
}
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
EventCoordinator.Publish(new DisplayInteractEvent(InteractEventIDs.Get(ItemInteractKey.CantUseItem)));
|
||||
return;
|
||||
}
|
||||
|
||||
var levelId = AssetKeyIdentifiers.Get(_levelToLoad);
|
||||
var loaded = await LevelManager.LoadLevel(levelId);
|
||||
|
||||
if (!loaded)
|
||||
{
|
||||
EventCoordinator.Publish(new DisplayInteractEvent(InteractEventIDs.Get(EnvironmentInteractKey.CantGoThere)));
|
||||
}
|
||||
}
|
||||
|
||||
public virtual UniTask EnterHover()
|
||||
{
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual UniTask ExitHover()
|
||||
{
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
_locked = false;
|
||||
}
|
||||
|
||||
protected virtual bool CheckUnlockStatus()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
[Inject]
|
||||
public void Construct(LevelManager levelManager, EventCoordinator eventCoordinator, SaveManager saveManager)
|
||||
{
|
||||
LevelManager = levelManager;
|
||||
EventCoordinator = eventCoordinator;
|
||||
SaveManager = saveManager;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9528c00201e44fc2baf036655881cf0d
|
||||
timeCreated: 1770916856
|
||||
Reference in New Issue
Block a user