using UnityEngine;
using System;
using System.Collections.Generic;
using UnityEditor;
using Game;
using Axibug.Resources;
using System.IO;
using Game;
public class UIMgrPath : ScriptableObject
{
///
/// 所有UI预制体路径
///
public List mAllUIPath = new List();
[System.Serializable]
public struct UIPath
{
///
/// UI名
///
public string mUIName;
///
/// UI路径
///
public string mUIPath;
}
///
/// 同步获取
///
///
public static Dictionary GetDic()
{
Dictionary retDic = new Dictionary();
//string assetsFile = Application.dataPath.Replace("/Assets", "/") + UIMgr.UIPathConfigFile;
//if (!File.Exists(assetsFile))
//{
// Debug.LogError("请先生成UI路径文件. 菜单/UI工具/生成UI预制体路径文件");
// return retDic;
//}
//var xxxFile2Str = File.ReadAllText(assetsFile);
TextAsset ta = (TextAsset)GamePlayEntry.Resources.LoadAsset(UIMgr.UIPathConfigFile);
if(ta == null)
{
Debug.LogError("请先生成UI路径文件. 菜单/UI工具/生成UI预制体路径文件");
return retDic;
}
string xxxFile2Str = ta.text;
retDic = Axibug.LitJson.JsonMapper.ToObject>(xxxFile2Str);
//Debug.Log("xxxFile2Str:" + xxxFile2Str);
return retDic;
}
}