| | |
| | | using UnityEngine; |
| | | |
| | | [Serializable] |
| | | public class SaveData |
| | | public class SaveDataPlayer |
| | | { |
| | | public int maxHealth; |
| | | public int health; |
| | | public float[] position; |
| | | public float[] velocity; |
| | | public SaveData(PlayerController player) |
| | | public SaveDataPlayer(PlayerController player) |
| | | { |
| | | maxHealth = player.health.MaxHealth; |
| | | health = player.health.Health; |
| | |
| | | velocity = player.rb.velocity.ConvertToFloatArray(); |
| | | } |
| | | } |
| | | |
| | | [Serializable] |
| | | public class SaveDataMap |
| | | { |
| | | public int seed; |
| | | public List<DestroyedTile> destroyedTiles; |
| | | public SaveDataMap(List<Vector3Int> destroyedTiles, int seed) |
| | | { |
| | | this.seed = seed; |
| | | this.destroyedTiles = new List<DestroyedTile>(); |
| | | foreach (var item in destroyedTiles.ConvertToListIntArray()) |
| | | { |
| | | this.destroyedTiles.Add(new DestroyedTile(item)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | [Serializable] |
| | | public class DestroyedTile |
| | | { |
| | | public DestroyedTile(int[] tileCoord) |
| | | { |
| | | this.tileCoord = tileCoord; |
| | | } |
| | | public int[] tileCoord; |
| | | } |