using System.Linq; using Cirno.Scripts.Resources; using Cirno.Scripts.UI; using Cirno.Scripts.Utils; using Godot; using Godot.Collections; namespace Cirno.Scripts.Actors; public partial class VendingMachine : Interactable { [Export] public bool Infinite { get; private set; } = false; [Export] public PackedScene UiScene { get; private set; } [Export] public Array Items { get; set; } public override bool Activate(ActivationType activationType = ActivationType.Toggle) { GameStateManager.SetState(GameState.Shop); var ui = UiScene.Instantiate(); ui.Machine = this; ui.Items = new LootItem[3]; int i = 0; foreach (var item in Items) { ui.Items[i] = item; i++; } this.AddChild(ui); return true; } }