Maze / Library /PackageCache /com.unity.visualscripting@1.8.0 /Runtime /VisualScripting.Flow /Framework /Control /SwitchOnString.cs
| using System; | |
| namespace Unity.VisualScripting | |
| { | |
| /// <summary> | |
| /// Branches flow by switching over a string. | |
| /// </summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public class SwitchOnString : SwitchUnit<string> | |
| { | |
| [] | |
| [] | |
| [] | |
| public bool ignoreCase { get; set; } | |
| protected override bool Matches(string a, string b) | |
| { | |
| if (string.IsNullOrEmpty(a) && string.IsNullOrEmpty(b)) | |
| { | |
| return true; | |
| } | |
| return string.Equals(a, b, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal); | |
| } | |
| } | |
| } | |