| | 1 | | public static class ECSTransformParentingSystem |
| | 2 | | { |
| | 3 | | public static void Update() |
| | 4 | | { |
| 2 | 5 | | if (ECSTransformUtils.orphanEntities == null || ECSTransformUtils.orphanEntities.Count == 0) |
| | 6 | | { |
| 0 | 7 | | return; |
| | 8 | | } |
| | 9 | |
|
| 2 | 10 | | int count = ECSTransformUtils.orphanEntities.Count; |
| | 11 | |
|
| 8 | 12 | | for (int i = count - 1; i >= 0; i--) |
| | 13 | | { |
| 2 | 14 | | var data = ECSTransformUtils.orphanEntities.Pairs[i].value; |
| | 15 | |
|
| 2 | 16 | | if (ECSTransformUtils.SetParent(data.scene, data.entity, data.parentId)) |
| | 17 | | { |
| 1 | 18 | | ECSTransformUtils.orphanEntities.RemoveAt(i); |
| | 19 | | } |
| | 20 | | } |
| 2 | 21 | | } |
| | 22 | | } |