暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

UnitRelation.cs 669B

12345678910111213141516171819202122232425
  1. using System;
  2. namespace Unity.VisualScripting
  3. {
  4. public sealed class UnitRelation : IUnitRelation
  5. {
  6. public UnitRelation(IUnitPort source, IUnitPort destination)
  7. {
  8. Ensure.That(nameof(source)).IsNotNull(source);
  9. Ensure.That(nameof(destination)).IsNotNull(destination);
  10. if (source.unit != destination.unit)
  11. {
  12. throw new NotSupportedException("Cannot create relations across nodes.");
  13. }
  14. this.source = source;
  15. this.destination = destination;
  16. }
  17. public IUnitPort source { get; }
  18. public IUnitPort destination { get; }
  19. }
  20. }