using System.Collections; using System.Collections.Generic; using UnityEngine; public class Axis9CalibrateRecord { //设置-mac对应的模块是否在本机初始化完成过 public static void SetCalibrateOkRecord(string mac, bool ok) { PlayerPrefs.SetInt("CalibrateOkRecord" + mac, ok ? 1 : 0); } //判断-mac对应的模块是否在本机初始化完成过 public static bool HasCalibrateOkRecord(string mac) { return PlayerPrefs.GetInt("CalibrateOkRecord" + mac, 0) == 1 ? true : false; } static Dictionary cacheCalibrateRecords = new Dictionary(); //缓存校准记录 public static void CacheCalibrateRecord(string mac, string record) { if (string.IsNullOrWhiteSpace(mac) || string.IsNullOrWhiteSpace(record)) return; cacheCalibrateRecords[mac] = record; } //恢复校准记录 public static void ResumeCalibrateRecord(string mac) { if (string.IsNullOrWhiteSpace(mac)) return; if (cacheCalibrateRecords.ContainsKey(mac)) AimHandler.ins.ResumeCalibrateRecord(cacheCalibrateRecords[mac]); } }