using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine; using static InterfaceManager; public class GameManager : MonoBehaviour { #region ״̬ /// /// 是否登录 /// public static bool is_login = false; private static string _current_scene; /// /// 当前运行的模型场景 /// public static string current_scene { get { return _current_scene; } set { _current_scene = scene_name = value; } } /// /// 当前运行场景的时间 /// public static string current_scene_time { get; set; } private static MainMenuType _main_menu_type; /// /// 当前主菜单选项 /// public static MainMenuType current_main_menu_type { get { return _main_menu_type; } set { _main_menu_type = value; parttern_name = value.ToString(); Debug.Log("切换模式:" + _main_menu_type.ToString()); } } private static ComponentType _component_type; /// /// 当前组件类型 /// public static ComponentType current_component_type { get { return _component_type; } set { _component_type = value; part_name = value.ToString(); } } #endregion public static GameManager Instance; #region 场景信息 /// /// 当前所有场景详情数据 /// public static List scene_detail_datas = new List(); /// /// 组件名称:[机器人、数字人、无人机] /// public static string part_name { get; private set; } /// /// 场景名称:[] /// public static string scene_name { get; private set; } /// /// 模式名称:[课程任务、案例、自由编程] /// public static string parttern_name { get; private set; } #endregion private void Awake() { if (Instance != null && Instance != this) { Destroy(gameObject); return; } Instance = this; } // Start is called before the first frame update void Start() { DontDestroyOnLoad(gameObject); Debug.Log("Game Init"); } /// /// 检查功能所需版本号是否满足 /// /// /// public static bool VersionCheck(string _version) { var local_version = Version.Split('.'); var check_version = _version.Split('.'); bool _check = true; if (local_version.Length >= check_version.Length) { for (int i = 0; i < check_version.Length; i++) { if (int.Parse(check_version[i]) >= int.Parse(local_version[i])) { } else { _check = false; break; } } } else _check = false; return _check; } }