您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
58 行
1.4 KiB
58 行
1.4 KiB
using System;
|
|
|
|
namespace UnityEngine.Graphing
|
|
{
|
|
[Serializable]
|
|
public class Edge : IEdge
|
|
{
|
|
[SerializeField]
|
|
private SlotReference m_OutputSlot;
|
|
[SerializeField]
|
|
private SlotReference m_InputSlot;
|
|
|
|
public Edge()
|
|
{}
|
|
|
|
public Edge(SlotReference outputSlot, SlotReference inputSlot)
|
|
{
|
|
m_OutputSlot = outputSlot;
|
|
m_InputSlot = inputSlot;
|
|
}
|
|
|
|
public SlotReference outputSlot
|
|
{
|
|
get { return m_OutputSlot; }
|
|
}
|
|
|
|
public SlotReference inputSlot
|
|
{
|
|
get { return m_InputSlot; }
|
|
}
|
|
|
|
protected bool Equals(Edge other)
|
|
{
|
|
return Equals(m_OutputSlot, other.m_OutputSlot) && Equals(m_InputSlot, other.m_InputSlot);
|
|
}
|
|
|
|
public bool Equals(IEdge other)
|
|
{
|
|
return Equals(other as object);
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
if (ReferenceEquals(null, obj)) return false;
|
|
if (ReferenceEquals(this, obj)) return true;
|
|
if (obj.GetType() != this.GetType()) return false;
|
|
return Equals((Edge)obj);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
unchecked
|
|
{
|
|
return ((m_OutputSlot != null ? m_OutputSlot.GetHashCode() : 0) * 397) ^ (m_InputSlot != null ? m_InputSlot.GetHashCode() : 0);
|
|
}
|
|
}
|
|
}
|
|
}
|