Buenas a todos, sere lo mas claro posible, empece un proyecto al estilo witcher3 , un mago con echizos etc.
Consegui que se guardara la posición de el personaje y los valores de vida y mana, pero ahora me encuentro que ese echizo que aprendio el personaje ayer hoy no esta aprendido porque no se guarda(canvas imagenes etc).
La pregunta es, alguien me da una idea de como implementar estos objetos y que se guarden como lo del mana y la vida?, mire tutos y cofeccione esto por mi cuenta satisfactoriamente.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
public class GameControl : MonoBehaviour
{
public static GameControl control;
public float vida;
public float mana;
//public GameObject ballfire;
void Awake()
{
if (control == null)
{
DontDestroyOnLoad(gameObject);
control = this;
}
else if (control != this)
{
Destroy(gameObject);
}
}
public void Save()
{
BinaryFormatter bf = new BinaryFormatter();
FileStream file = File.Create(Application.persistentDataPath + "/playerInfo.dat");
PlayerData data = new PlayerData();
data.vida = vida;
data.mana = mana;
bf.Serialize(file, data);
file.Close();
}
public void Load()
{
if (File.Exists(Application.persistentDataPath + "/playerInfo.dat"))
{
BinaryFormatter bf = new BinaryFormatter();
FileStream file = File.Open(Application.persistentDataPath + "/playerInfo.dat", FileMode.Open);
PlayerData