- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
List<EntryChange> changes = new List<EntryChange>();
for (int index = 0;
index < partsContainer.transform.childCount;
++index)
{
if (partsContainer
.transform
.GetChild(index)
.GetComponent<castle_parts_container>()
.inSave()
==
true)
{
// id of current part on scene
int partId =
partsContainer.transform
.GetChild(index).gameObject
.GetComponent<castle_parts_container>()
.partIdentificator;
int partColor =
partsContainer.transform
.GetChild(index).gameObject
.GetComponent<castle_parts_container>()
.savedColor();
int partNumber =
partsContainer.transform
.GetChild(index).gameObject
.GetComponent<castle_parts_container>()
.savedNumber();
EntryChange change = new EntryChange();
change.original =
partsContainer.transform
.GetChild(index).gameObject;
change.target =
partPrefabs.Where(
x => x.GetComponent<castle_parts_container>().partIdentificator
==
partId
&&
x.GetComponent<castle_parts_container>().partColor
==
partColor
&&
x.GetComponent<castle_parts_container>().partNumber
==
partNumber
).First();
changes.Add(change);