public void Serialize(DataSerializer s)
            {
                Singleton <LoadingManager> .instance.m_loadingProfilerSimulation.BeginSerialize(s, "GameAreaManager");

                GameAreaManager instance = Singleton <GameAreaManager> .instance;

                //begin mod
                int[] numArray  = new int[AREAGRID_RESOLUTION * AREAGRID_RESOLUTION];
                int   length    = numArray.Length;
                int   areaCount = 0;

                for (var i = 0; i < 5; i += 1)
                {
                    for (var j = 0; j < 5; j += 1)
                    {
                        var grid = GameAreaManager.instance.m_areaGrid[(j + 2) * GRID + (i + 2)];
                        numArray[j * AREAGRID_RESOLUTION + i] = grid;
                        if (grid != 0)
                        {
                            areaCount += 1;
                        }
                    }
                }
                s.WriteUInt8((uint)areaCount);
                //end mod
                s.WriteUInt8((uint)(int)_startTileField.GetValue(instance));
                EncodedArray.Byte @byte = EncodedArray.Byte.BeginWrite(s);
                for (int index = 0; index < length; ++index)
                {
                    @byte.Write((byte)numArray[index]);
                }
                @byte.EndWrite();

                s.WriteObject <GenericGuide>(instance.m_areaNotUnlocked);
                s.WriteFloat((float)_fieldInfo1.GetValue(instance));
                s.WriteFloat((float)_fieldInfo2.GetValue(instance));
                s.WriteFloat((float)_fieldInfo3.GetValue(instance));
                s.WriteFloat((float)_fieldInfo4.GetValue(instance));
                var instanceSavedCameraView = new CameraController.SavedCameraView((CameraController)_fieldInfo6.GetValue(instance));

                _fieldInfo5.SetValue(instance, instanceSavedCameraView);
                instanceSavedCameraView.Serialize(s);
                Singleton <LoadingManager> .instance.m_loadingProfilerSimulation.EndSerialize(s, "GameAreaManager");
            }
Пример #2
0
            public void Serialize(DataSerializer s)
            {
                var districtGrid = FakeDistrictManager.districtGrid;
                int num2         = districtGrid.Length;

                EncodedArray.Byte @byte = EncodedArray.Byte.BeginWrite(s);
                for (int num19 = 0; num19 < num2; num19++)
                {
                    @byte.Write(districtGrid[num19].m_district1);
                }
                for (int num20 = 0; num20 < num2; num20++)
                {
                    @byte.Write(districtGrid[num20].m_district2);
                }
                for (int num21 = 0; num21 < num2; num21++)
                {
                    @byte.Write(districtGrid[num21].m_district3);
                }
                for (int num22 = 0; num22 < num2; num22++)
                {
                    @byte.Write(districtGrid[num22].m_district4);
                }
                for (int num23 = 0; num23 < num2; num23++)
                {
                    @byte.Write(districtGrid[num23].m_alpha1);
                }
                for (int num24 = 0; num24 < num2; num24++)
                {
                    @byte.Write(districtGrid[num24].m_alpha2);
                }
                for (int num25 = 0; num25 < num2; num25++)
                {
                    @byte.Write(districtGrid[num25].m_alpha3);
                }
                for (int num26 = 0; num26 < num2; num26++)
                {
                    @byte.Write(districtGrid[num26].m_alpha4);
                }
                @byte.EndWrite();
            }