miepzerino
2023-12-22 569f8efeca94146d3f863408cedb80ce6683e793
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using Assets.Scripts.Helpers;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
 
[Serializable]
public class SaveData
{
    public int maxHealth;
    public int health;
    public float[] position;
    public float[] velocity;
    public SaveData(PlayerController player)
    {
        maxHealth = player.health.MaxHealth;
        health = player.health.Health;
        position = player.transform.position.ConvertToFloatArray();
        velocity = player.rb.velocity.ConvertToFloatArray();
    }
}