A game about forced loneliness, made by TACStudios
1namespace Unity.VisualScripting 2{ 3 /// <summary> 4 /// Returns true if both inputs are true. 5 /// </summary> 6 [UnitCategory("Logic")] 7 [UnitOrder(0)] 8 public sealed class And : Unit 9 { 10 /// <summary> 11 /// The first boolean. 12 /// </summary> 13 [DoNotSerialize] 14 public ValueInput a { get; private set; } 15 16 /// <summary> 17 /// The second boolean. 18 /// </summary> 19 [DoNotSerialize] 20 public ValueInput b { get; private set; } 21 22 /// <summary> 23 /// True if A and B are both true; false otherwise. 24 /// </summary> 25 [DoNotSerialize] 26 [PortLabel("A & B")] 27 public ValueOutput result { get; private set; } 28 29 protected override void Definition() 30 { 31 a = ValueInput<bool>(nameof(a)); 32 b = ValueInput<bool>(nameof(b)); 33 result = ValueOutput(nameof(result), Operation).Predictable(); 34 35 Requirement(a, result); 36 Requirement(b, result); 37 } 38 39 public bool Operation(Flow flow) 40 { 41 return flow.GetValue<bool>(a) && flow.GetValue<bool>(b); 42 } 43 } 44}