Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        /// <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);
        }
Ejemplo n.º 5
0
 void SetNpcActionHandler(int npcId, Model.ActionType actionType)
 {
     Avatar.VCharacterBase vCharacter = Global.charactersManager.vCharacters.Find(chara => chara.mCharacter.id == npcId);
     StartCoroutine(SetAction(vCharacter, actionType));
 }