You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
740 B

using Godot;
using System;
public partial class OptionPicker : Node2D
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
public void Reset()
{
foreach (Node child in GetChildren())
{
if (child is SlotSymbol slotSymbol)
{
slotSymbol.SetToRandom();
}
}
}
public void Show(bool visible)
{
foreach (CanvasItem child in GetChildren())
{
child.Visible = visible;
}
}
public SlotSymbol Select(int index)
{
Show(false);
return GetChildren()[index] as SlotSymbol;
}
}