mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:45:33 +00:00
28 lines
No EOL
649 B
C#
28 lines
No EOL
649 B
C#
using System.Linq;
|
|
using Cirno.Scripts.Resources;
|
|
using Cirno.Scripts.UI;
|
|
using Godot;
|
|
using Godot.Collections;
|
|
|
|
namespace Cirno.Scripts.Actors;
|
|
|
|
public partial class VendingMachine : Interactable
|
|
{
|
|
[Export] public PackedScene UiScene { get; private set; }
|
|
|
|
[Export] public Array<LootItem> Items { get; set; }
|
|
|
|
|
|
public override bool Activate(ActivationType activationType = ActivationType.Toggle)
|
|
{
|
|
GameManager.Instance.ChangeState(GameState.Shop);
|
|
|
|
var ui = UiScene.Instantiate<VendingMachineUi>();
|
|
|
|
ui.Items = Items.ToArray();
|
|
|
|
this.AddChild(ui);
|
|
|
|
return true;
|
|
}
|
|
} |