Guest User

Untitled

a guest
Feb 17th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. using F45.Utilities;
  4.  
  5. namespace F45.Flow
  6. {
  7. [RequireComponent(typeof(Managed))]
  8. public abstract class ManagedStateMachine<T> : StateMachine
  9. where T : Behaviour
  10. {
  11. public static IEnumerable<T> List => Managed.GetAll<T>();
  12. }
  13. }
  14.  
  15. // Allows doing this:
  16. //
  17. // public class AgarPlate : ManagedStateMachine<AgarPlate>
  18. // ...
  19. // if (AgarPlate.List.All(a => a. Open))
  20. //
  21. // Instead of this:
  22. //
  23. // public class AgarPlate : StateMachine
  24. // ...
  25. // if (Managed.GetAll<AgarPlate>.All(a => a. Open))
Add Comment
Please, Sign In to add comment