A game about forced loneliness, made by TACStudios
1using System.Collections; 2using UnityEngine; 3 4namespace Unity.VisualScripting 5{ 6 /// <summary> 7 /// Delays flow by waiting while a condition is true. 8 /// </summary> 9 [UnitTitle("Wait While")] 10 [UnitShortTitle("Wait While")] 11 [UnitOrder(3)] 12 public class WaitWhileUnit : WaitUnit 13 { 14 /// <summary> 15 /// The condition to check. 16 /// </summary> 17 [DoNotSerialize] 18 public ValueInput condition { get; private set; } 19 20 protected override void Definition() 21 { 22 base.Definition(); 23 24 condition = ValueInput<bool>(nameof(condition)); 25 Requirement(condition, enter); 26 } 27 28 protected override IEnumerator Await(Flow flow) 29 { 30 yield return new WaitWhile(() => flow.GetValue<bool>(condition)); 31 32 yield return exit; 33 } 34 } 35}