Compare commits

..

No commits in common. "614c726a7ced8467b83e0f76b9e9f987dadf4c5f" and "411fa853d3633e954ea62aab9615ef6c865ba642" have entirely different histories.

3 changed files with 4 additions and 41 deletions

View File

@ -52,29 +52,6 @@ public class FixedMainEditor
AssetDatabase.Refresh(); AssetDatabase.Refresh();
} }
[MenuItem("Tools/生成Timer文件")]
private static void GeneratorTimer()
{
if (File.Exists(Application.dataPath + "/TimerLock.asset"))
{
string path = "Assets/TimerLock.asset";
var asset = AssetDatabase.LoadAssetAtPath<TimerLock>(path);
if (asset != null)
{
if (string.IsNullOrEmpty(asset.time) == false)
{
//第一次获取获取系统时间
DateTime currentDateTime = DateTime.Now;
string RecordData = currentDateTime.ToString("yyyy-MM-dd HH:mm:ss");
string strMerge = asset.time + "|" + RecordData;
EncryptFileCreator.EncryptAndSaveData(strMerge, "Timer.txt");
}
}
}
//刷新界面
AssetDatabase.Refresh();
}

View File

@ -7,20 +7,10 @@ using UnityEditor.Build;
using UnityEditor.Build.Reporting; using UnityEditor.Build.Reporting;
using UnityEngine; using UnityEngine;
public class VirtualFPostProcess : IPostprocessBuildWithReport, IPreprocessBuildWithReport public class VirtualFPostProcess : IPostprocessBuildWithReport
{ {
public int callbackOrder => 0; public int callbackOrder => 0;
/// <summary>
/// 构建前生成时间锁
/// </summary>
/// <param name="report"></param>
public void OnPreprocessBuild(BuildReport report)
{
// 生成时间锁
GneratorTimerLock();
}
public void OnPostprocessBuild(BuildReport report) public void OnPostprocessBuild(BuildReport report)
{ {
string projectPath = Application.dataPath; string projectPath = Application.dataPath;
@ -39,7 +29,9 @@ public class VirtualFPostProcess : IPostprocessBuildWithReport, IPreprocessBuild
Debug.LogWarning("未找到数据目录: " + dataFolderPath); Debug.LogWarning("未找到数据目录: " + dataFolderPath);
} }
DeletAssetBundle(buildOutputPath); DeletAssetBundle(buildOutputPath);
AssetDatabase.Refresh();
// 生成时间锁
GneratorTimerLock();
} }
/// <summary> /// <summary>
@ -181,6 +173,4 @@ public class VirtualFPostProcess : IPostprocessBuildWithReport, IPreprocessBuild
} }
return new string(chars); return new string(chars);
} }
} }

View File

@ -27,7 +27,6 @@ public class DateManager : MonoBehaviour
public void ShowTip(string str) public void ShowTip(string str)
{ {
gameObject.SetActive(true);
ui.SetActive(true); ui.SetActive(true);
text.text = str; text.text = str;
} }
@ -43,7 +42,6 @@ public class DateManager : MonoBehaviour
if (string.IsNullOrEmpty(datas)) if (string.IsNullOrEmpty(datas))
{ {
updateTimer?.Invoke(); updateTimer?.Invoke();
return;
} }
EndTimer = datas.Split('|')[0]; EndTimer = datas.Split('|')[0];
RecordData = datas.Split('|')[1]; RecordData = datas.Split('|')[1];
@ -72,14 +70,12 @@ public class DateManager : MonoBehaviour
{ {
Debug.LogError($"数据出错: {e.Message}"); Debug.LogError($"数据出错: {e.Message}");
error?.Invoke($"数据出错: {e.Message}"); error?.Invoke($"数据出错: {e.Message}");
return;
} }
if (JudgeExpire()) if (JudgeExpire())
{ {
Debug.Log("请联系管理员进行升级"); Debug.Log("请联系管理员进行升级");
timeOut?.Invoke("请联系管理员进行升级"); timeOut?.Invoke("请联系管理员进行升级");
return;
} }
} }