No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IUnitConnection.cs 1.1KB

123456789101112131415161718192021222324
  1. namespace Unity.VisualScripting
  2. {
  3. /* Implementation notes:
  4. *
  5. * IUnitConnection cannot implement IConnection<IUnitOutputPort, IUnitInputPort> because
  6. * the compiler will be overly strict and complain that types may unify.
  7. * https://stackoverflow.com/questions/7664790
  8. *
  9. * Additionally, using contravariance for the type parameters will compile but
  10. * fail at runtime, because Unity's Mono version does not properly support variance,
  11. * even though it's supposed to be a CLR feature since .NET 1.1.
  12. * https://forum.unity3d.com/threads/398665/
  13. * https://github.com/jacobdufault/fullinspector/issues/9
  14. *
  15. * Therefore, the only remaining solution is to re-implement source and destination
  16. * manually. This introduces ambiguity, as the compiler will warn, but it's fine
  17. * if the implementations point both members to the same actual object.
  18. */
  19. public interface IUnitConnection : IConnection<IUnitOutputPort, IUnitInputPort>, IGraphElementWithDebugData
  20. {
  21. new FlowGraph graph { get; }
  22. }
  23. }