private static void InnerUnlink(VFXContext from, VFXContext to, int fromIndex = 0, int toIndex = 0, bool notify = true) { if (from.GetData() == to.GetData() && from.GetData() != null) { to.SetDefaultData(false); } int count = from.m_OutputFlowSlot[fromIndex].link.RemoveAll(o => o.context == to && o.slotIndex == toIndex); count += to.m_InputFlowSlot[toIndex].link.RemoveAll(o => o.context == from && o.slotIndex == fromIndex); if (count > 0 && notify) { from.Invalidate(InvalidationCause.kConnectionChanged); to.Invalidate(InvalidationCause.kConnectionChanged); } }
private static void InnerUnlink(VFXContext from, VFXContext to, int fromIndex = 0, int toIndex = 0, bool notify = true) { if (from.GetData() == to.GetData() && from.GetData() != null) { to.SetDefaultData(false); } from.m_OutputFlowSlot[fromIndex].link.RemoveAll(o => o.context == to && o.slotIndex == toIndex); to.m_InputFlowSlot[toIndex].link.RemoveAll(o => o.context == from && o.slotIndex == fromIndex); // TODO Might need a specific event ? if (notify) { from.Invalidate(InvalidationCause.kStructureChanged); to.Invalidate(InvalidationCause.kStructureChanged); } }