43 lines
889 B
C#
43 lines
889 B
C#
![]() |
|
||
|
using Godot;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
|
namespace Rokojori
|
||
|
{
|
||
|
[Tool]
|
||
|
[GlobalClass,Icon("res://addons/rokojori_action_library/Icons/SensorGroup.svg")]
|
||
|
public partial class MultiSensorDevice: SensorDevice
|
||
|
{
|
||
|
[Export]
|
||
|
public SensorDevice[] devices = new SensorDevice[ 0 ];
|
||
|
|
||
|
[Export]
|
||
|
public Sensor[] sensors = new Sensor[ 0 ];
|
||
|
|
||
|
public override bool ContainsSensor( Sensor sensor )
|
||
|
{
|
||
|
for ( int i = 0; i < devices.Length; i++ )
|
||
|
{
|
||
|
if ( devices[ i ].ContainsSensor( sensor ) )
|
||
|
{
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return Arrays.Contains( sensors, sensor );
|
||
|
}
|
||
|
|
||
|
public override bool ContainsIcon( InputIcon icon )
|
||
|
{
|
||
|
for ( int i = 0; i < devices.Length; i++ )
|
||
|
{
|
||
|
if ( devices[ i ].ContainsIcon( icon ) )
|
||
|
{
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
}
|