ported from perforce
This commit is contained in:
37
DonkeysAndDroids.Godot/Robot.cs
Normal file
37
DonkeysAndDroids.Godot/Robot.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Godot;
|
||||
|
||||
public partial class Robot : Button
|
||||
{
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
m_TextureRect = GetNode<TextureRect>("%TextureRect");
|
||||
m_Label = GetNode<Label>("%Label");
|
||||
}
|
||||
|
||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (m_TextureRect != null)
|
||||
m_TextureRect.Texture = Texture;
|
||||
if (m_Label != null)
|
||||
m_Label.Text = Name;
|
||||
}
|
||||
|
||||
[Export]
|
||||
public Texture2D Texture
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Export]
|
||||
public string RobotName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = "Robot";
|
||||
|
||||
private Label m_Label;
|
||||
private TextureRect m_TextureRect;
|
||||
}
|
||||
Reference in New Issue
Block a user