Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using System;
- public class ime : MonoBehaviour {
- DateTime tempo;
- TimeSpan Difernca;
- void Start () {
- if (PlayerPrefs.HasKey("FechaU"))
- {
- tempo = Convert.ToDateTime(PlayerPrefs.GetString("FechaU"));
- print("Tempo Carregado");
- print(tempo.ToString());
- Difernca = DateTime.Now - tempo;
- if (Difernca.Minutes > 10)
- {
- print("10 minuts se passaram");
- }
- }
- else
- {
- print("Tempo nao carregado");
- }
- }
- void Update () {
- if (Input.GetKeyDown(KeyCode.Space))
- {
- GuardaTempo();
- }
- }
- public void GuardaTempo()
- {
- PlayerPrefs.SetString("FechaU", DateTime.Now.ToString());
- print("Tempo Guardado!!");
- }
- }
Add Comment
Please, Sign In to add comment