예제 #1
0
 private void Construct(string name)
 {
     _name = name;
     //_level = new List<SerializedGameObject>();
     //_activePooled = new List<SerializedGameObject>();
     _playerData = new SerializedPlayerData();
     //_riftLocation = RiftTown.Current != null ? RiftTown.Current.DisplayName : GlobalLevelController.CurrentConfig.Name;
     //_riftLevel = RiftTown.Current != null ? 0 : GlobalLevelController.CurrentIndex;
     //_playerPosition = new SerializedTransform(Player.Controller.Tr);
     //_encounterRate = Player.Controller.CurrentEncounterRate;
     //_encounterSteps = Player.Controller.CurrentSteps;
     //if (GlobalLevelController.Root != null) {
     //    var receivers = GlobalLevelController.Root.gameObject.GetComponentsInChildren<ILevelLoadEvents>();
     //    if (receivers != null) {
     //        for (int i = 0; i < receivers.Length; i++) {
     //            receivers[i].LevelSaved(ref _mapData);
     //        }
     //    }
     //}
     //if (GlobalLevelController.Builder != null) {
     //    GlobalLevelController.Builder.SaveData(ref _mapData);
     //}
     //_riftLocation =  RiftTown.Current != null ? RiftTown.Current.DisplayName : RiftTown.Last.DisplayName;
     //Serializer.ResetGlobalSerializationIndex();
     //ResetSerializedIds(LevelController.Root);
     //ResetSerializedIds(ItemPool.ActiveSceneTr);
     //ScanChildren(LevelController.Root.gameObject, _level);
     //ScanChildren(ItemPool.ActiveSceneTr.gameObject, _activePooled);
 }
예제 #2
0
 public SerializedSaveGame(SerializationInfo info, StreamingContext context)
 {
     _name           = (string)info.GetValue("Name", typeof(string));
     _playerData     = (SerializedPlayerData)info.GetValue("PlayerData", typeof(SerializedPlayerData));
     _riftLocation   = (string)info.GetValue("RiftLocation", typeof(string));
     _riftLevel      = (int)info.GetValue("RiftLevel", typeof(int));
     _playerPosition = (SerializedTransform)info.GetValue("PlayerPosition", typeof(SerializedTransform));
     _mapData        = (List <SerializedGenericData>)info.GetValue("MapData", typeof(List <SerializedGenericData>));
     //_activePooled = (List<SerializedGameObject>)info.GetValue("ActivePooled", typeof(List<SerializedGameObject>));
     //_level = (List<SerializedGameObject>) info.GetValue("Level", typeof(List<SerializedGameObject>));
 }