public List <ysTableBundleData.TableInfo> ReadTableInfo() { List <TextAsset> textAssetList = ReadTextAssetList(data.paths.textPath); List <ysTableBundleData.TableInfo> tableInfoList = new List <ysTableBundleData.TableInfo>(); for (int i = 0; i < textAssetList.Count; i++) { if (CheckHasIgnoreString(textAssetList[i].name)) { continue; } //string[] tempx00 = textAssetList[i].name.Split('_'); //string classScriptName=""; //for (int j = 0; j < tempx00.Length; j++) //{ // tempx00[j] = tempx00[j].Substring(0, 1).ToUpper() + tempx00[j].Substring(1, tempx00[j].Length - 1); // classScriptName += tempx00[j]; //} //classScriptName += "Table"; string classScriptName = GenerateClassTableName(textAssetList[i].name); ysTableBundleData.TableInfo tableInfo = new ysTableBundleData.TableInfo(); tableInfo.tableClassName = classScriptName; tableInfo.textAsset = textAssetList[i]; string tempx01 = data.assetDirectoryPaths.classSccriptAssetDirectoryPath + classScriptName + ".cs"; tableInfo.classScript = AssetDatabase.LoadAssetAtPath <MonoScript>(tempx01); string tempx02 = data.assetDirectoryPaths.scriptableObjectAssetDirectoryPath + classScriptName + ".asset"; tableInfo.scriptableObject = AssetDatabase.LoadAssetAtPath <ScriptableObject>(tempx02); tableInfoList.Add(tableInfo); } return(tableInfoList); }
public void CreateAssetByTxt(ysTableBundleData.TableInfo tableInfo) { Assembly assembly = Assembly.Load("Assembly-CSharp"); Type tableClassType = assembly.GetType(tableInfo.tableClassName); Type dataClassType = assembly.GetType(tableInfo.tableClassName + "Data"); //Assembly.Load("Assembly-CSharp-Editor").GetType("ysTableBundleFunc") this.GetType() .GetMethod("CreateAssetFromText") .MakeGenericMethod(tableClassType, dataClassType) .Invoke(this, new object[] { tableInfo.textAsset.text }); }
public ScriptableObject ReloadAsset(ysTableBundleData.TableInfo tableInfo) { string assetPath = data.assetDirectoryPaths.scriptableObjectAssetDirectoryPath + tableInfo.tableClassName + ".asset"; ScriptableObject scriptableObject = AssetDatabase.LoadAssetAtPath <ScriptableObject>(assetPath); for (int i = 0; i < scriptableObjectList.Count; i++) { if (scriptableObjectList[i] == null && !scriptableObjectList.Contains(scriptableObject)) { scriptableObjectList[i] = scriptableObject; } } return(scriptableObject); }
ScriptableObject ReloadAsset(ysTableBundleData.TableInfo tableInfo) { return(func.ReloadAsset(tableInfo)); }
void CreateScriptableObject(ysTableBundleData.TableInfo tableInfo) { func.CreateAssetByTxt(tableInfo); }