Refine UI stack and add Ashwick keypad puzzle
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
using BriarQueen.Data.IO.Saves;
|
||||
using BriarQueen.Framework.Events.UI;
|
||||
using BriarQueen.Framework.Managers.Levels.Data;
|
||||
using BriarQueen.Game.Items.HoverZones;
|
||||
using BriarQueen.Game.Puzzles.ChapterOne.AshwickHallow;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace BriarQueen.Game.Levels.ChapterOne.Ashwick
|
||||
{
|
||||
public class AshwickOutskirts : BaseLevel
|
||||
{
|
||||
[Header("Background")]
|
||||
[SerializeField]
|
||||
private Image _background;
|
||||
[SerializeField]
|
||||
private Sprite _backgroundOpenSprite;
|
||||
|
||||
[Header("Keypad Puzzle")]
|
||||
[SerializeField]
|
||||
private AshwickGate _ashwickGate;
|
||||
|
||||
[SerializeField]
|
||||
private TransitionZone _keypadZone;
|
||||
|
||||
[SerializeField]
|
||||
private TransitionZone _nextLevelZone;
|
||||
|
||||
private Sprite _defaultSprite;
|
||||
|
||||
protected async override UniTask PostLoadInternal()
|
||||
{
|
||||
if (SaveManager.GetLevelFlag(LevelFlag.AshwickGateOpen))
|
||||
{
|
||||
_background.sprite = _backgroundOpenSprite;
|
||||
_nextLevelZone.Unlock();
|
||||
await DestructionService.Destroy(_ashwickGate.gameObject);
|
||||
await DestructionService.Destroy(_keypadZone.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
public async UniTask OpenGate()
|
||||
{
|
||||
EventCoordinator.PublishImmediate(new FadeEvent(false));
|
||||
|
||||
_background.sprite = _backgroundOpenSprite;
|
||||
_nextLevelZone.Unlock();
|
||||
await DestructionService.Destroy(_ashwickGate.gameObject);
|
||||
await DestructionService.Destroy(_keypadZone.gameObject);
|
||||
|
||||
SaveManager.SetLevelFlag(LevelFlag.AshwickGateOpen, true);
|
||||
|
||||
EventCoordinator.PublishImmediate(new FadeEvent(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b17e98637f5042b4b70962875c373f5f
|
||||
timeCreated: 1778704389
|
||||
Reference in New Issue
Block a user