Hey guys I am stucked on how to save my money.When I build the game in the exe as soon as i Shutdown the game my money value gets lost.I want this money to be saved. I am using the following codeenter code here
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
namespace CompleteProject
{
public class MoneyManager : MonoBehaviour
{
public static int money; // The player's money.
Text moneytext; // Reference to the Text component.
void Awake ()
{
// Set up the reference.
moneytext = GetComponent <Text> ();
money=print(PlayerPrefs.GetInt("Money"));
}
void Update ()
{
moneytext.text = "" + money;
PlayerPrefs.SetInt ("Money", money);
}
}
}