public IEnumerator SetAction(Avatar.VCharacterBase vCharacter, Model.ActionType action) { //MapMoveToPosition(mCharacter.CoordinateX, mCharacter.CoordinateY); vCharacter.action = action; if (vCharacter.action != Model.ActionType.idle && vCharacter.action != Model.ActionType.move) { while (vCharacter.action == action) { yield return(new WaitForEndOfFrame()); } } Util.LSharp.LSharpScript.Instance.Analysis(); }
public void CancelAllOtherTasks(UserInfo currentUser, Model.FlowInfo flow, Model.ActionType action) { string cmdText = @"update Task set [Act]=@act,Comment=@comment,logTime=getdate() where flowId=@flowId and uid!=@uid and logTime is null"; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@act", (int)action), new SqlParameter("@comment", Enum.GetName(typeof(Model.ActionType), action) + " by " + currentUser.DisplayName), //base on act for reject/approval/return, new SqlParameter("@flowId", flow.FlowId), new SqlParameter("@uid", currentUser.UID) }; SqlHelper.ExecuteNonQuery(cmdText, parameters); }
public void Add(string[] arguments) { UnityEngine.Debug.LogError("LSharpCharacter Add"); int npcId = int.Parse(arguments[0]); string action = arguments[1]; string directionStr = arguments[2]; int x = int.Parse(arguments[3]); int y = int.Parse(arguments[4]); bool isPlayer = arguments.Length > 5 && arguments[5] == "true"; Model.ActionType actionType = (Model.ActionType)Enum.Parse(typeof(Model.ActionType), action); Model.Direction direction = (Model.Direction)Enum.Parse(typeof(Model.Direction), directionStr, true); Global.sharpEvent.DispatchAddCharacter(npcId, actionType, direction, x, y, isPlayer); LSharpScript.Instance.Analysis(); }
/// <summary> /// 取消代理者或被代理者的task /// </summary> /// <param name="uid"></param> /// <param name="flow"></param> /// <param name="action"></param> public void CancelDelegateTasks(string uid, Model.FlowInfo flow, Model.ActionType action) { string cmdText = @"update Task set Act=@act,comment=@comment,logTime=GETDATE() where flowId=@flowId and uid!=@uid and logTime is null and Role in ( select Role from task where flowId=@flowId and uid=@uid and logTime is null)" ; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@act", (int)action), new SqlParameter("@comment", Enum.GetName(typeof(Model.ActionType), action) + " by " + uid), //base on act for reject/approval/return, new SqlParameter("@flowId", flow.FlowId), new SqlParameter("@uid", uid) }; SqlHelper.ExecuteNonQuery(cmdText, parameters); }
void SetNpcActionHandler(int npcId, Model.ActionType actionType) { Avatar.VCharacterBase vCharacter = Global.charactersManager.vCharacters.Find(chara => chara.mCharacter.id == npcId); StartCoroutine(SetAction(vCharacter, actionType)); }