Files
VOIDRPG/Assets/90 - Scripts/Generic/Player/SaveLoad/PlayerProfile.cs
T
2026-07-09 21:33:33 +02:00

28 lines
851 B
C#

using System;
using UnityEditor;
using UnityEngine;
namespace VOID.Generic.SaveLoad
{
[Serializable]
public class PlayerProfile
{
public string guid;
public string name;
public string version;
public int essence;
public PlayerProfile(string profileName)
{
name = profileName;
guid = GUID.Generate().ToString();
version = Application.version;
}
public static bool operator ==(PlayerProfile obj1, PlayerProfile obj2) => obj1?.guid == obj2?.guid;
public static bool operator !=(PlayerProfile obj1, PlayerProfile obj2) => !(obj1 == obj2);
public override bool Equals(object obj) => obj is PlayerProfile other && guid == other.guid;
public override int GetHashCode() => guid.GetHashCode();
}
}