Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/solutena/eventcollection
https://github.com/solutena/eventcollection
collection event serialize unity
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/solutena/eventcollection
- Owner: solutena
- Created: 2022-11-19T03:38:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-13T00:55:35.000Z (6 months ago)
- Last Synced: 2024-05-13T01:42:56.805Z (6 months ago)
- Topics: collection, event, serialize, unity
- Language: C#
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SerializeCollection
직렬화 되지 않는 자료형인 `Dictionary`, `HashSet`, `Nullable` 를 직렬화 할 수 있습니다.
# EventCollection
`Collection`에 변화가 있을 때 이벤트를 등록할 수 있는 클래스입니다.
직렬화 할 수 있다.
## Event
`Event`는 각 요소가 추가되거나 제거될 때 호출됩니다.
### Add, Remove
```
void Start()
{
EventList ints = new EventList();
ints.Event += (int item, bool isAdd) =>
{
if(isAdd)
Debug.Log("Add : " + item);
else
Debug.Log("Remove : " + item);
};ints.Add(0);
ints.Remove(0);
}
```결과 :
```
Add : 0
Remove : 0
```## Changed
`Changed`는 `Event`가 종료된 후 한번만 호출됩니다.
```
void Start()
{
EventList ints = new EventList();
ints.Changed += () =>
{
Debug.Log("Changed");
};ints.AddRange(new List { 0, 1, 2, 3, 4 });
}
```결과 :
```
Changed
```