mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-18 17:34:45 +01:00
27 lines
416 B
C#
27 lines
416 B
C#
namespace BehaviorDesigner.Runtime.Tasks
|
|
{
|
|
[TaskCategory("Switch")]
|
|
public class SwitchByString : BaseSwitch
|
|
{
|
|
public SharedString target;
|
|
|
|
public string[] cases;
|
|
|
|
public override void OnAwake()
|
|
{
|
|
}
|
|
|
|
protected override int CalculateChildIndex()
|
|
{
|
|
for (int i = 0; i < cases.Length; i++)
|
|
{
|
|
if (cases[i] == target.Value)
|
|
{
|
|
return i;
|
|
}
|
|
}
|
|
return _currentChildIndex;
|
|
}
|
|
}
|
|
}
|