/
TON618OFF
/
Unity-Project-RTU
Обзор
Документация
Войти
/
TON618OFF
/
Unity-Project-RTU
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Library/PackageCache/com.unity.visualscripting@1.9.4/Runtime/VisualScripting.Core/Graphs/MergedGraphElementCollection.cs
27 строк
965 B
TON618OFF
release
03 окт 2024, 22:20
03 окт 2024, 22:20
7c70e9f
Код
Авторство
О чём код?
using System; namespace Unity.VisualScripting { public sealed class MergedGraphElementCollection : MergedKeyedCollection<Guid, IGraphElement>, INotifyCollectionChanged<IGraphElement> { public event Action<IGraphElement> ItemAdded; public event Action<IGraphElement> ItemRemoved; public event Action CollectionChanged; public override void Include<TSubItem>(IKeyedCollection<Guid, TSubItem> collection) { base.Include(collection); var graphElementCollection = collection as IGraphElementCollection<TSubItem>; if (graphElementCollection != null) { graphElementCollection.ItemAdded += (element) => ItemAdded?.Invoke(element); graphElementCollection.ItemRemoved += (element) => ItemRemoved?.Invoke(element); graphElementCollection.CollectionChanged += () => CollectionChanged?.Invoke(); } } } }