//int[][] Int2 //List<int[]> ListInt1 //Dictionary<int,string> DictionaryInt1String1 //Dictionary<int,Dictionary<int,string>> //Dictionary<List<Dictionary<int,string>>,int> //Not support: int[,] private static string GetFunctionNameCode(string type) { Debug.LogError(type); List <object> nestArray = StringUtility.NestStringArrayParse(type, '<', '>', ',', true) as List <object>; Debug.LogError(ExtensionUtility.ToString(nestArray)); string functionName = NestArray2FunctionName(Language.CSharp, nestArray, CodeMode.Encode); Debug.LogError(GenerateFunctionCode(Language.CSharp, type, CodeMode.Encode)); return(functionName); }
public static void DoTest() { Debug.LogError(ExtensionUtility.ToString(String2Object("int", "0"))); Debug.LogError(ExtensionUtility.ToString(String2Object("int[]", "[[1,2]]"))); /*Debug.LogError(ExtensionUtility.ToString(String2Object("int[][]", "[[1,2],[3,4]]"))); * Debug.LogError(ExtensionUtility.ToString(String2Object("List<int>", "[5,6]"))); * Debug.LogError(ExtensionUtility.ToString(String2Object("List<int[]>[]", "[[[7,8],[9,10]]]"))); * Debug.LogError(ExtensionUtility.ToString(String2Object("Dictionary<int,string>", "[1:test,2:string]"))); * Debug.LogError(ExtensionUtility.ToString(String2Object("Dictionary<int,List<int>>", "[1:[1,2],2:[3,4]]"))); * Debug.LogError( * ExtensionUtility.ToString(String2Object("Dictionary<int,List<int>>[]", * "[[1:[1,2],2:[3,4]],[1:[1,2],2:[3,4]]]")));*/ }
public static void DoTest() { Debug.LogError(ExtensionUtility.ToString(StringUtility.NestStringArrayParse( "[[2001005,1,50],[2001006,1,50],[2001007,1,50],[2001004,1,50],[2001001,1,90],[2001002,1,90],[2001003,1,90]]", '[', ']', ','))); Debug.LogError(ExtensionUtility.ToString(StringUtility.NestStringArrayParse( "[[2001005,1,50]100]", '[', ']', ','))); Debug.LogError(ExtensionUtility.ToString(StringUtility.NestStringArrayParse( "[2001005,1,50]100", '[', ']', ','))); Debug.LogError(ExtensionUtility.ToString(StringUtility.NestStringArrayParse( "101[2001005,1,50]", '[', ']', ','))); Debug.LogError(ExtensionUtility.ToString(StringUtility.NestStringArrayParse("<<K,V>k1>", '<', '>', ','))); Debug.LogError(ExtensionUtility.ToString(StringUtility.NestStringArrayParse("<K2,<K,V>>", '<', '>', ','))); Debug.LogError(GetFunctionNameCode("int[]")); Debug.LogError(GetFunctionNameCode("int[][]")); Debug.LogError(GetFunctionNameCode("List<int[]>")); Debug.LogError(GetFunctionNameCode("List<int[]>[]")); Debug.LogError(GetFunctionNameCode("Dictionary<int,string>")); Debug.LogError(GetFunctionNameCode("Dictionary<int,Dictionary<Dictionary<int,string>,Dictionary<int,string>>>")); }