public void OnBeforeSerialize() { disabledObject = new MatchObjectData(); disabledObject.ObjectImage = gridCellDisabledSprite; // set ids for game objects Disabled.Enumerate(1); EnumerateArray(blockedObjects, 100); EnumerateArray(matchObjects, 1000); EnumerateArray(overlayObjects, 100000); EnumerateArray(underlayObjects, 200000); EnumerateArray(boosterObjects, 300000); dynamicClickBombObjectVertical.bombType = BombDir.Vertical; dynamicClickBombObjectHorizontal.bombType = BombDir.Horizontal; dynamicClickBombObjectRadial.bombType = BombDir.Radial; dynamicClickBombObjectVertical.Enumerate(400020); dynamicClickBombObjectHorizontal.Enumerate(400021); dynamicClickBombObjectRadial.Enumerate(400022); int i = 0; foreach (var item in matchObjects) { item.colorBomb.Enumerate(400100 + i); item.colorBomb.matchID = item.ID; item.colorBomb.bombType = BombDir.Color; i++; } fallingObject.Enumerate(500000); EnumerateArray(dynamicBlockerObjects, 600000); EnumerateArray(staticBlockerObjects, 700000); }