添加了部分界面
This commit is contained in:
46
Temp/CollectionTest.cs
Normal file
46
Temp/CollectionTest.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace BITKit;
|
||||
[Tool]
|
||||
public partial class CollectionTest : Node
|
||||
{
|
||||
[Export] private Array<Node> nodes;
|
||||
|
||||
[Export] private Dictionary<string, Node> Dictionary;
|
||||
|
||||
[Export] private ProgressBar progressBar;
|
||||
|
||||
[Export(PropertyHint.Range, "0,1")]
|
||||
private float progress
|
||||
{
|
||||
get => _progress;
|
||||
set
|
||||
{
|
||||
if (Engine.IsEditorHint())
|
||||
{
|
||||
RequestReady();
|
||||
}
|
||||
if (progressBar is null) return;
|
||||
_progress = value;
|
||||
var newProgress = Mathf.Lerp(progressBar.MinValue, progressBar.MaxValue, value);
|
||||
progressBar.Value = newProgress;
|
||||
}
|
||||
}
|
||||
private float _progress;
|
||||
|
||||
[Export] private Label label;
|
||||
|
||||
[Export]
|
||||
public string Text
|
||||
{
|
||||
get => label?.Text;
|
||||
set
|
||||
{
|
||||
if (label is not null)
|
||||
label.Text = value;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user