mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 21:05:54 +00:00
Map Level resources system
This commit is contained in:
parent
1a714dd54d
commit
6e997bd01b
21 changed files with 199 additions and 26 deletions
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Threading.Tasks;
|
||||
using Cirno.Scripts.Components.FSM;
|
||||
using Cirno.Scripts.Resources;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Activables;
|
||||
|
|
@ -9,12 +10,13 @@ namespace Cirno.Scripts.Activables;
|
|||
public partial class LevelTeleporter : Teleporter
|
||||
{
|
||||
[Export] public string LevelPath { get; private set; }
|
||||
[Export] public MapResource Map { get; private set; }
|
||||
|
||||
[Export] public bool SaveInventory { get; private set; }
|
||||
|
||||
protected override async Task Teleport(IStateMachine<PlayerState, CharacterBody2D> player)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(LevelPath)) return;
|
||||
if (string.IsNullOrWhiteSpace(LevelPath) && Map is null) return;
|
||||
//player.RequestMovementDisable(true);
|
||||
player.SetState(PlayerState.Cutscene);
|
||||
|
||||
|
|
@ -34,6 +36,14 @@ public partial class LevelTeleporter : Teleporter
|
|||
GlobalState.Instance.SessionSettings.Items = InventoryManager.Instance.Save();
|
||||
}
|
||||
|
||||
GlobalState.Instance.GotoScene(LevelPath);
|
||||
if (!string.IsNullOrWhiteSpace(LevelPath))
|
||||
{
|
||||
GlobalState.Instance.GotoScene(LevelPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalState.Instance.GotoScene(Map);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue