public ActionExcute StartAction(ActionObject actObj, ICustomObject o) { ActionExcute ac = new ActionExcute(); ac.StartAction(o, actObj); mListExcute.Add(ac); return(ac); }
public void Set(ActionTable act, HitData hitData = null, int skillLayer = 0) { this.m_ActionTable = act; this.m_cExcute = ActionExcute.Create(act, this.m_cObj, hitData); this.m_HitData = hitData; this.m_ActionMode = ActingActionMode.Normal; this._skillLayer = skillLayer; }
/// <summary> /// 退出状态 /// </summary> /// <returns></returns> public override bool OnExit() { if (this.m_cExcute != null) { GameObject.Destroy(this.m_cExcute.gameObject); this.m_cExcute = null; this.m_ActionTable = null; } return(base.OnExit()); }
public static ActionExcute Create(ActionTable table, GfxObject o, HitData hitdata = null) { GameObject obj = new GameObject("ActionExcute"); ActionExcute ac = obj.AddComponent <ActionExcute>(); ac.m_Table = table; ac.m_HitData = hitdata; ac.StartAction(o); return(ac); }
public static void ExecuteHandler(string controllerName, HttpContext context, string actionName) { //if (!context.Request.ContentType.StartsWith("application/json", StringComparison.OrdinalIgnoreCase)) //{ // context.Response.Write(new HandlerResponse() { Message = "只支持json传输协议", Result = 0 }.ToString()); // return; //} IAppHandler handler; if (s_Handlers.TryGetValue(controllerName, out handler)) { handler.HttpContext = context; //下一步找到Action的参数 bool hasAction = false; foreach (var action in handler.ActionMethods) { if (action.Name.ToLower() == actionName.ToLower()) {// 有操作的方法action hasAction = true; ActionExcute excute = new ActionExcute(); HandlerResponse handlerResponse = excute.BindParamToAction(action, context, handler); if (handlerResponse != null) { if (handlerResponse.Result == 101) { context.Response.Write(handlerResponse.Message); } else { context.Response.Write(handlerResponse.ToString()); } } break; } } if (!hasAction) { context.Response.Write(new HandlerResponse() { Message = "不存在操作方法", Result = 0 }.ToString()); return; } } else { context.Response.Write(new HandlerResponse() { Message = "不存在操作对象", Result = 0 }.ToString()); } // context.Response.Write(handler.CreateInstance().ProcessRequest(context).ToString()); }