public override void InitConfigList() { base.InitConfigList(); this.graphicComponent.gameObject.name = "test2"; config_list.Add(new Dictionary <string, object> { { "type", "InputItem" }, { "desc", "KKK" }, { "yes_callback", new Action(() => LogCat.LogWarning("KKK")) }, }); }
/// <summary> /// 保存 /// </summary> public void Save() { if (dataDict != null) { string path = CsvConst.BasePath + (this.filePath.Contains(".csv") ? filePath : string.Format("{0}.csv", this.filePath)); List <string> columnNameList = GetColumnNames(); string columnName = ""; for (var i = 0; i < columnNameList.Count; i++) { string column = columnNameList[i]; if (keyColumnNameList.Contains(column)) { columnName += column + "(key)" + ","; } else { columnName += column + ","; } } columnName = columnName.Substring(0, columnName.Length - 1); //去掉最后一个逗号 StdioUtil.WriteTextFile(path, columnName, true); foreach (LinkedDictionary <string, string> lineDataDict in dataDict.Values) { string rowValue = ""; for (var i = 0; i < columnNameList.Count; i++) { string column = columnNameList[i]; if (lineDataDict.ContainsKey(column)) { rowValue += lineDataDict[column] + ","; } else { rowValue += ","; } } rowValue = rowValue.Substring(0, rowValue.Length - 1); //去掉最后一个逗号 StdioUtil.WriteTextFile(path, rowValue, true, true); } LogCat.LogWarning("Save Finish"); } }
public static void Test() { UIMessageBoxPanel panel = Client.instance.uiManager.CreateChildPanel(null, default(UIMessageBoxPanel)); panel.InvokeAfterAllAssetsLoadDone(() => { //panel.Show("Hello",null, "world2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222"); List <Dictionary <string, int> > itemDictList = new List <Dictionary <string, int> >(); for (int i = 1; i < 100; i++) { itemDictList.Add(new Dictionary <string, int>() { { "id", 1 }, { "count", i } }); } panel.Show("Hello", "world", null, itemDictList, "确定1", () => { LogCat.LogWarning("hello"); }, "确定2", () => { LogCat.LogWarning("world"); }); }); }
//只添加一个AnimationEvent到AnimationClip指定时间的上,然后触发的时候,调用strOnComplete方法(里面会调用eventCallbacks对应的方法(key:clipName + percentage)触发callBackList) //如何将Delegate作为参数 使用lamba表达式,()=>{} 作为参数要将该delegate设置为Callback等,如 (Action)((args)=>{LogCat.Log(args);}) //例子: AddEvents((Action<string, string>)((a, b) => { LogCat.LogWarning(a+b);}), "TestAnimationClip", 1f,"aabbcc","ddff"); public AnimEvent AddEvents(Delegate callback, string clipName, float percentage, params object[] callbackArgs) { clipEventDict.GetOrAddDefault(clipName, () => new List <string>()); var eventKey = GetEventKey(clipName, percentage); var hasEventCallback = eventCallbackDict.ContainsKey(eventKey); eventCallbackDict.GetOrAddDefault(eventKey, () => new List <DelegateStruct>()); eventCallbackDict[eventKey].Add(new DelegateStruct(callback, callbackArgs)); if (clipEventDict[clipName].FindIndex(a => a.Equals(eventKey)) == -1) { clipEventDict[clipName].Add(eventKey); } LogCat.LogWarning(clipEventDict[clipName].Count); for (var i = 0; i < clips.Length; i++) { var clip = clips[i]; if (!clip.name.Equals(clipName)) { continue; } if (hasEventCallback) { continue; } var animationEvent = new AnimationEvent(); animationEvent.functionName = onTriggerString; animationEvent.messageOptions = SendMessageOptions.RequireReceiver; animationEvent.time = clip.length * percentage; animationEvent.stringParameter = eventKey; clip.AddEvent(animationEvent); } return(this); }
public void GMTest() { LogCat.LogWarning("Hello,GMTest"); }
/// <summary> /// 默认切面后处理 /// </summary> public void Post_AOP_Handle() { LogCat.LogWarning("After :" + desc); }
/// <summary> /// 默认切面前处理 /// </summary> public void Pre_AOP_Handle() { LogCat.LogWarning("Before :" + desc + " "); }