unity实现简单的加密使用次数限制时间限制功能

来源:互联网 发布:国家网络应急 编辑:程序博客网 时间:2024/05/03 06:54
using UnityEngine;using System.Collections;public class jiaMI : MonoBehaviour {    public System.DateTime time;    int mi = 0;// Use this for initializationvoid Start () {        //限制本地访问exe次数        if (PlayerPrefs.GetInt("miwen")>30) {            Application.Quit();        }        mi = PlayerPrefs.GetInt("miwen");        mi += 1;        PlayerPrefs.SetInt("miwen",mi);    }// Update is called once per framevoid Update () {        // Debug.Log(System.DateTime.Today.Year);        //限制时间        if (!(System.DateTime.Today.Year < 2017 && System.DateTime.Today.Month < 5 && System.DateTime.Today.Month < 1))        {            Application.Quit();        } }}

0 0
原创粉丝点击