✨ Separated events from variables and adjusted test scene
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using Babushka.scripts.CSharp.Low_Code.Events;
|
||||
using Babushka.scripts.CSharp.Low_Code.Variables;
|
||||
using Godot;
|
||||
|
||||
|
||||
@@ -13,23 +14,23 @@ public partial class VariantRandomizer : Node
|
||||
/// <summary>
|
||||
/// The event resource to work on.
|
||||
/// </summary>
|
||||
[Export] public EventResource _eventResource;
|
||||
[Export] public VariableResource _variableResource;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the payload of a randomizable event resource to a random value.
|
||||
/// </summary>
|
||||
public void RandomizeEventResource()
|
||||
{
|
||||
switch (_eventResource.Payload.VariantType)
|
||||
switch (_variableResource.Payload.VariantType)
|
||||
{
|
||||
case Variant.Type.Color:
|
||||
_eventResource.Payload= GetRandomColor();
|
||||
_variableResource.Payload= GetRandomColor();
|
||||
break;
|
||||
case Variant.Type.Int:
|
||||
_eventResource.Payload= GetRandomInt();
|
||||
_variableResource.Payload= GetRandomInt();
|
||||
break;
|
||||
case Variant.Type.Float:
|
||||
_eventResource.Payload= GetRandomFloat();
|
||||
_variableResource.Payload= GetRandomFloat();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user