コードはこちらです。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TimeRecord : MonoBehaviour {
public Text firstText; float firstStageTime = Player.firstTime; float highTime = 999; // Use this for initialization void Start () { highTime = PlayerPrefs.GetFloat("high", 999); firstText.text = "Time : " + highTime.ToString(); Debug.Log(PlayerPrefs.HasKey("high")); } // Update is called once per frame void Update () { if (highTime > firstStageTime) { firstText.text = "Time : " + PlayerPrefs.GetFloat("high").ToString(); PlayerPrefs.SetFloat("high", firstStageTime); highTime = PlayerPrefs.GetFloat("high"); } if (Input.GetKey(KeyCode.Space)) { PlayerPrefs.DeleteAll(); } }
}
正確に言うと、Keyは存在するのですが、全て0になるんです。なぜそうなるのかが解りません。コードが間違っているのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。