public Action MoveArrowTowardsTargetPanelPos(ActivationWindow window, float moveDelay = 0f, float arrowMoveSpeed = 400) { Debug.Log("ActivationManager.MoveArrowTowardsTargetPanelPos() called...."); Action action = new Action(); StartCoroutine(MoveArrowTowardsTargetPanelPosCoroutine(window, action, moveDelay, arrowMoveSpeed)); return(action); }
private static object singleton_Lock = new object(); //锁同步 public static ActivationViewModel GetActivationViewModel(ActivationWindow window) { lock (singleton_Lock) { if (null == _activationViewModel) { _activationViewModel = new ActivationViewModel(window); } } return(_activationViewModel); }
public IEnumerator MoveArrowTowardsTargetPanelPosCoroutine(ActivationWindow window, Action action, float moveDelay = 0, float arrowMoveSpeed = 400) { yield return(new WaitForSeconds(moveDelay)); Vector3 destination = new Vector2(window.transform.position.x, panelArrow.transform.position.y); while (panelArrow.transform.position != destination) { panelArrow.transform.position = Vector2.MoveTowards(panelArrow.transform.position, destination, arrowMoveSpeed * Time.deltaTime); yield return(new WaitForEndOfFrame()); } action.actionResolved = true; }
// Setup + Initializaton #region public void CreateActivationWindow(LivingEntity entity) { GameObject newSlot = Instantiate(panelSlotPrefab, activationSlotContentParent.transform); panelSlots.Add(newSlot); GameObject newWindow = Instantiate(PrefabHolder.Instance.activationWindowPrefab, activationWindowContentParent.transform); newWindow.transform.position = windowStartPos.transform.position; ActivationWindow newWindowScript = newWindow.GetComponent <ActivationWindow>(); newWindowScript.InitializeSetup(entity); activationOrder.Add(entity); newWindowScript.myUCM.SetBaseAnim(); }
public IEnumerator PlayRandomNumberAnim(ActivationWindow window) { Debug.Log("PlayRandomNumberAnim() called...."); int numberDisplayed = 0; window.animateNumberText = true; window.rollText.enabled = true; while (window.animateNumberText == true) { //Debug.Log("Animating roll number text...."); numberDisplayed++; if (numberDisplayed > 9) { numberDisplayed = 0; } window.rollText.text = numberDisplayed.ToString(); yield return(new WaitForEndOfFrame()); } }
public void ActiveBook() { try { ActivationWindow activationWindow = new ActivationWindow(); activationWindow.ShowDialog(); if (activationWindow.viewModel.OperateResule == SeatManage.EnumType.HandleResult.Successed) { clientObject.EnterOutLogData = new OperateResult.OperateResult(); clientObject.EnterOutLogData.Student = SeatManage.Bll.EnterOutOperate.GetReaderInfo(activationWindow.viewModel.CardNo); if (clientObject.EnterOutLogData.Student == null) { clientObject.EnterOutLogData.Student = new SeatManage.ClassModel.ReaderInfo() { CardNo = activationWindow.viewModel.CardNo }; } SeatManage.ClassModel.UserInfo user = SeatManage.Bll.Users_ALL.GetUserInfo(activationWindow.viewModel.CardNo); if (user != null) { if (user.IsUsing == SeatManage.EnumType.LogStatus.Valid) //判断用户状态是否启用。 { MessageWindow DeactivationComfrimWindow = new MessageWindow(MessageType.DeactivationComfrim); //启用中,则提示取消 DeactivationComfrimWindow.ShowDialog(); if (DeactivationComfrimWindow.viewModel.OperateResule == HandleResult.Successed) { user.IsUsing = SeatManage.EnumType.LogStatus.Fail;// user.Remark = "终端刷卡注销"; SeatManage.Bll.Users_ALL.UpdateUserOnlyInfo(user); MessageWindow activeCloseWindow = new MessageWindow(MessageType.DeactivationSuccess);//启用中,则提示取消 activeCloseWindow.ShowDialog(); } } else {//如果读者用户状态是失效,则重新激活。 user.IsUsing = SeatManage.EnumType.LogStatus.Valid; user.Password = MD5Algorithm.GetMD5Str32(activationWindow.viewModel.CardNo); user.Remark = "终端刷卡重新激活"; if (SeatManage.Bll.Users_ALL.UpdateUserOnlyInfo(user)) { MessageWindow activeSuccessWindow = new MessageWindow(MessageType.ActivationSuccess);//启用中,则提示取消 activeSuccessWindow.ShowDialog(); } } } else { SeatManage.ClassModel.UserInfo newUser = new SeatManage.ClassModel.UserInfo(); newUser.IsUsing = SeatManage.EnumType.LogStatus.Valid; newUser.LoginId = activationWindow.viewModel.CardNo; newUser.Password = MD5Algorithm.GetMD5Str32(activationWindow.viewModel.CardNo); newUser.UserType = SeatManage.EnumType.UserType.Reader; newUser.UserName = clientObject.EnterOutLogData.Student == null ? "" : clientObject.EnterOutLogData.Student.Name; newUser.Remark = "在终端刷卡激活"; if (SeatManage.Bll.Users_ALL.AddNewUser(newUser)) { MessageWindow activeSuccessWindow = new MessageWindow(MessageType.ActivationSuccess);//启用中,则提示取消 activeSuccessWindow.ShowDialog(); } } //预约激活处理 } } catch (Exception ex) { SeatManage.SeatManageComm.WriteLog.Write("预约激活遇到异常" + ex.Message); MessageWindow errorWindow = new MessageWindow(MessageType.Exception); errorWindow.ShowDialog(); } finally { clientObject.EnterOutLogData = null; } }
public ActivationViewModel(ActivationWindow window) { this.Loading = false; _globalParam = GlobalParam.GetGlobalParam(); _window = window; }