folder refactoring, plant_base adjustments
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using Godot;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Switches between two Sprite Options.
|
||||
/// </summary>
|
||||
public partial class SpriteSwitcher : Node3D
|
||||
{
|
||||
[Export] private Sprite3D _TrueSprite;
|
||||
[Export] private Sprite3D _FalseSprite;
|
||||
[Export] private bool _state = true;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
SetState();
|
||||
}
|
||||
|
||||
public void SwitchState()
|
||||
{
|
||||
_state = !_state;
|
||||
SetState();
|
||||
}
|
||||
|
||||
private void SetState()
|
||||
{
|
||||
if (_state)
|
||||
{
|
||||
_TrueSprite.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_FalseSprite.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user