I have been working with the Unityserializer and I am wanting to convert over the loadgame from js to C# but I cant seem to get it correct.
Here is the original that works js:
import System.Collections.Generic;
function OnGUI()
{
for(var sg in LevelSerializer.SavedGames[LevelSerializer.PlayerName])
{
if(GUILayout.Button(sg.Caption))
{
LevelSerializer.LoadNow(sg.Data);
Time.timeScale = 1;
}
}
}
Here is the C# I have been working with so far that does not work:
using UnityEngine;
using System.Collections;
public class loadGame : MonoBehaviour
{
void OnGUI ()
{
for(var sg in LevelSerializer.SavedGames[LevelSerializer.PlayerName])
{
if(GUILayout.Button(sg.Caption))
{
LevelSerializer.LoadNow(sg.Data);
Time.timeScale = 1;
}
}
}
}