26 lines
451 B
C#
26 lines
451 B
C#
|
|
using Godot;
|
|
|
|
|
|
namespace Rokojori
|
|
{
|
|
[GlobalClass,Icon("res://addons/rokojori_action_library/Icons/RJSensor.svg")]
|
|
public partial class CombineSensor : Sensor
|
|
{
|
|
[Export]
|
|
public Sensor[] sensors;
|
|
|
|
|
|
protected override void UpdateValue()
|
|
{
|
|
var value = 0f;
|
|
|
|
for ( int i = 0; i < sensors.Length; i++ )
|
|
{
|
|
value = Mathf.Max( value, sensors[ i ].value );
|
|
}
|
|
|
|
SetFloatValue( value );
|
|
}
|
|
}
|
|
} |