void OnOkBtn() { // if (DoSleep)//mDoSleep != null // { // mDoSleep((int)(((int)11 * mSleepSlider.scrollValue) + 1)); // ShowSleepWnd(false); // } // else // Hide(); if (m_PeSleep == null || mEntity == null) { return; } if (!m_PeSleep.CanOperateMask(Pathea.Operate.EOperationMask.Sleep)) { return; } Pathea.MotionMgrCmpt mmc = mEntity.GetCmpt <Pathea.MotionMgrCmpt>(); if (null != mmc && (mmc.IsActionRunning(Pathea.PEActionType.Sleep) || !mmc.CanDoAction(Pathea.PEActionType.Sleep))) { return; } SleepController.StartSleep(m_PeSleep, mEntity, GetCurSleepTime()); ShowSleepWnd(false); }
public override CmdList GetCmdList() { var list = base.GetCmdList(); if (sleepPivot.CanOperateMask(EOperationMask.Sleep)) { list.Add("Sleep", () => { if (!sleepPivot.CanOperateMask(EOperationMask.Sleep)) { return; } //SleepController.StartSleep(sleepPivot, MainPlayer.Instance.entity); //GameUI.Instance.mItemOp.HideMainUI(); GameUI.Instance.mItemOp.ShowSleepWnd(true, this, sleepPivot, Pathea.MainPlayer.Instance.entity); }); } return(list); }