Finished load and save mechanic, v1.3.0

This commit is contained in:
Nicola Sovic
2022-06-12 11:29:42 +02:00
parent 267dd1c626
commit 8fcc58ee6b
11 changed files with 310 additions and 382 deletions

View File

@@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -33,6 +34,19 @@ namespace Assets.Scripts.Slimes
level = playerStats[7];
}
public BasicSlime(JToken json)
{
maxHealth = (int)json["maxHealth"];
maxSecondary = (int)json["maxSecondary"];
secondary = (int)json["secondary"];
health = (int)json["health"];
strength = (int)json["strength"];
dexterity = (int)json["dexterity"];
intelligence = (int)json["intelligence"];
level = (int)json["level"];
experience = (int)json["experience"];
}
public int[] getStats()
{
int[] result = { health, maxHealth, secondary, maxSecondary, strength, dexterity, intelligence };