protected override void CheckOperate() { base.CheckOperate(); if (PeInput.Get(PeInput.LogicFunction.OpenItemMenu)) { if (null != GameUI.Instance.mMainPlayer && !GameUI.Instance.bMainPlayerIsDead) { if (GameConfig.IsMultiMode) { if (null != mNetWork) { mNetWork.RequestItemList(); } GameUI.Instance.mItemBox.Show(); mItemList.Clear(); GameUI.Instance.mItemBox.SetItemList(this, mItemList); } else { GameUI.Instance.mItemBox.Show(); GameUI.Instance.mItemBox.SetItemList(this, mItemList); ResetUI(); } } } }
void Update() { if (!(PeInput.Get(PeInput.LogicFunction.Item_Drag) || UICamera.hoveredObject != null)) { UpdateMouseIcon(); } if ((UICamera.hoveredObject != null || PeInput.Get(PeInput.LogicFunction.Item_Drag)) && mIsShow) { DisableCursor(); //HideCursor(); } if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) || Input.GetMouseButtonDown(0)) { PlayTipHideTween(); } //更新位置 if (mOpSprite.atlas != null) { Vector3 pos = Input.mousePosition; if (uiCamera != null) { // Since the screen can be of different than expected size, we want to convert // mouse coordinates to view space, then convert that to world position. pos.x = Mathf.Clamp01(pos.x / Screen.width); pos.y = Mathf.Clamp01(pos.y / Screen.height); mTrans.position = uiCamera.ViewportToWorldPoint(pos); // For pixel-perfect results if (uiCamera.orthographic) { mTrans.localPosition = NGUIMath.ApplyHalfPixelOffset(mTrans.localPosition, mTrans.localScale); } } } }
void Update() { if (!isDead && PeInput.Get(PeInput.LogicFunction.GatherHerb) // && mplayer.rigidbody.velocity.magnitude < 0.5f && !isGathering) { if (Vector3.SqrMagnitude(playerTrans.position - transform.position) < 7f) { mmc.EndImmediately(PEActionType.Move); mmc.EndImmediately(PEActionType.Sprint); mmc.EndImmediately(PEActionType.Rotate); ctime = -Time.deltaTime; isGathering = true; anmt.SetBool("Gather", true); mmc.SetMaskState(PEActionMask.Gather, true); } } if (isGathering) { ctime += Time.deltaTime; if (ctime < TrainingRoomConfig.HerbGatherTime) { if (!isDead && ctime >= TrainingRoomConfig.HerbHitTime) { ApplyCut(); } } else { isGathering = false; } } }
// public bool IsChild(Transform child) // { // return child.IsChildOf(mSkillRunner.transform); // } protected virtual void CheckMainPlayerCtrl() { if (PeInput.Get(PeInput.LogicFunction.Item_Drag)) { CostSkill(); } }
protected override void CheckOperate() { base.CheckOperate(); if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) && CanCmd()) { if (EntityMonsterBeacon.IsRunning()) { PeTipMsg.Register(PELocalization.GetString(8000596), PeTipMsg.EMsgLevel.Warning); return; } if (!Operatable()) { return; } Pathea.OperateCmpt operateCmpt = Pathea.MainPlayer.Instance.entity.operateCmpt; if (null != operateCmpt && operateCmpt.HasOperate) { return; } Pathea.MotionMgrCmpt mmc = Pathea.MainPlayer.Instance.entity.motionMgr; if (null != mmc && (mmc.IsActionRunning(Pathea.PEActionType.Sleep) || !mmc.CanDoAction(Pathea.PEActionType.Sleep))) { return; } GameUI.Instance.mItemOp.ShowSleepWnd(true, this, bedView.peSleep, Pathea.MainPlayer.Instance.entity); // GameUI.Instance.mItemOp.SleepImmediately(bedView.peSleep, Pathea.MainPlayer.Instance.entity); } }
protected override void CheckOperate() { if (PeInput.Get(PeInput.LogicFunction.OpenItemMenu) || PeInput.Get(PeInput.LogicFunction.InteractWithItem)) { GameUI.Instance.mKickstarterCtrl.Show(); } }
// Update is called once per frame void Update() { if (PeInput.Get(PeInput.LogicFunction.OptionsUI) || !mMovie.isPlaying) { Application.LoadLevel("GameCredits"); } }
protected override void CheckOperate() { base.CheckOperate(); //if(!GameConfig.IsMultiMode) //{ if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) && CanCmd()) { /* * if (Operatable() && CheckSleepEnable()) * { * DoSleep(12f); * } * */ CmdList list = simpleObjPart.GetCmdList(); if (list.count <= 0) { return; } CmdList.Cmd cmd = list.Get(0); if (cmd == null) { return; } cmd.exe(); } //} }
void CheckDrawItemState() { if (mDiscardFlag) { mDiscardFlag = false; if (null != mItemSample && mItemPlace == ItemPlaceType.IPT_HotKeyBar) { GameUI.Instance.mUIMainMidCtrl.RemoveItemWithIndex(mItemIndex); } } if (mPutBackFlag) { mPutBackFlag = false; CancelDrop(); } if (PeInput.Get(PeInput.LogicFunction.Item_CancelDrag) || Input.GetMouseButtonUp(0)) { mPutBackFlag = true; } if (Input.GetMouseButtonUp(0) && !PeInput.Get(PeInput.LogicFunction.Item_CancelDrag)) { mDiscardFlag = true; } }
void Update() { if (PeInput.Get(PeInput.LogicFunction.ScreenCapture)) { CaptureToFile(); } }
//public override void Turn90Degree() //{ // base.Turn90Degree(); //} protected override void CheckOperate() { base.CheckOperate(); if (CanCmd()) { if (!PeInput.Get(PeInput.LogicFunction.OpenItemMenu) && PeInput.Get(PeInput.LogicFunction.InteractWithItem)) { if (plant.mDead) { OnClear(); } else if (plant.IsRipe) { OnGetBtn(); } else if (plant.NeedWater) { OnWaterBtn(); } else if (plant.NeedClean) { OnCleanBtn(); } MousePicker.Instance.UpdateTis(); } } }
protected override void CheckOperate() { base.CheckOperate(); if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) || PeInput.Get(PeInput.LogicFunction.OpenItemMenu)) { Operate(); } }
protected override void CheckOperate() { //base.CheckOperate(); if (PeInput.Get(PeInput.LogicFunction.PickBody)) { OnClickPeEntity(); } }
protected override void CheckOperate() { base.CheckOperate(); if (PeInput.Get(PeInput.LogicFunction.OpenItemMenu) && CanCmd() && null != itemObj && null != itemObj.protoData && itemObj.protoData.unchargeable) { GameUI.Instance.mItemOp.SetRefill(Mathf.FloorToInt(_controller.energy), Mathf.FloorToInt(_controller.maxEnergy), GetMaxRefillNum()); } }
protected virtual void CheckOperate() { if (PeInput.Get(PeInput.LogicFunction.OpenItemMenu)) { RMouseClickEvent e = new RMouseClickEvent(); e.mousePickable = this; eventor.Dispatch(e); } }
protected override void CheckOperate() { base.CheckOperate(); if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) && CanCmd()) { TryExecAction(); } }
void CheckIfCreat() { if (PeInput.Get(PeInput.LogicFunction.Item_Drag)) { if (null == UICamera.hoveredObject && mCreatEnable) { CreatTower(); } } }
void Update() { if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) && Time.realtimeSinceStartup - _rideTime > OpIntervalTime && //lz-2017.02.23 上坐骑和下坐骑按键输入是同一个键,这里避免上坐骑完成一瞬间这里也满足条件又下来了 _rides && _rides.HasOperater(_playerOperate) && _playerOperate && _playerOperate.IsActionRunning(PEActionType.Ride)) { ExecUnRide(MainPlayer.Instance.entity); } }
protected override uint EncodeInput(uint inputState) { inputState = base.EncodeInput(inputState); bool brake = PeInput.Get(PeInput.LogicFunction.Vehicle_Brake); // 默认输入为 0, 因此 0 代表刹车 inputState = inputState.SetBit(brakeBit, !brake); return(inputState); }
void CheckMenu() { if (openMenuEnable && PeInput.Get(PeInput.LogicFunction.OpenItemMenu)) { if (null == RailwayPointGuiCtrl.Instance) { return; } RailwayPointGuiCtrl.Instance.SetInfo(point); } }
protected override void CheckOperate() { if (PeInput.Get(PeInput.LogicFunction.OpenItemMenu) && CanCmd()) { CmdList cmdList = new CmdList(); InitCmd(cmdList); //GameUI.Instance.mItemOp.SetOjbect(this); GameUI.Instance.mItemOp.SetCmdList(this, cmdList); } }
void CheckItemPutDownAction() { if (PeInput.Get(PeInput.LogicFunction.Item_Drop)) { if (null == UICamera.hoveredObject && mPutEnable) { PutItemDown(); } else { CancelDrop(); } } }
protected override void CheckOperate() { if (PeInput.Get(PeInput.LogicFunction.OpenItemMenu) && CanCmd()) { GameUI.Instance.mItemOp.ListenEvent(OnItemOpGUIHide, OnItemOpGUIActive); } base.CheckOperate(); if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) && CanCmd()) { OnOpen(); } }
protected override void CheckOperate() { base.CheckOperate(); if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) && CanCmd()) { if (!Operatable()) { return; } OnDoOperate(); } }
protected override void CheckOperate() { base.CheckOperate(); Pathea.PeEntity mono = GetComponent <Pathea.PeEntity>(); if (PeInput.Get(PeInput.LogicFunction.PickBody) && null != pickBodyEventor) { pickBodyEventor(this); } if (PeInput.Get(PeInput.LogicFunction.TalkToNpc)) { Pathea.EntityMgr.NPCTalkEvent ee = new Pathea.EntityMgr.NPCTalkEvent(); if (null != mono) { ee.entity = mono; Pathea.EntityMgr.Instance.npcTalkEventor.Dispatch(ee); } } if (PeInput.Get(PeInput.LogicFunction.OpenItemMenu)) { Pathea.EntityMgr.RMouseClickEntityEvent ee = new Pathea.EntityMgr.RMouseClickEntityEvent(); if (null != mono) { ee.entity = mono; Pathea.EntityMgr.Instance.eventor.Dispatch(ee); } } if (MissionManager.Instance != null) { if (PeInput.Get(PeInput.LogicFunction.TalkToNpc)) { if (MissionManager.Instance.HasMission(MissionManager.m_SpecialMissionID83) && gameObject.name == "scene_Dien_viyus_ship_on01(Clone)") { if (Pathea.PeGameMgr.IsMulti) { MissionManager.Instance.RequestCompleteMission(MissionManager.m_SpecialMissionID83); } else { MissionManager.Instance.CompleteMission(MissionManager.m_SpecialMissionID83); } } } } }
/// <summary> /// /// </summary> void UpdateMoveState() { if (ctrlType != ECtrlType.Mount || Entity.skEntity.IsSkillRunning()) { return; } if (m_Move == null) { return; } //if(PeInput.Get(PeInput.LogicFunction.InteractWithItem) && null != SelectItem_N.Instance && SelectItem_N.Instance.HaveOpItem()) //计算移动方向 Vector3 moveDirLocal = PeInput.GetAxisH() * Vector3.right + PeInput.GetAxisV() * Vector3.forward; m_MoveDir = Vector3.ProjectOnPlane(PETools.PEUtil.MainCamTransform.rotation * moveDirLocal, Vector3.up); //计算行走速度 if (PeInput.Get(PeInput.LogicFunction.SwitchWalkRun)) { m_MoveWalk = !m_MoveWalk; } SpeedState state = m_MoveWalk ? SpeedState.Walk : SpeedState.Run; if (PeInput.Get(PeInput.LogicFunction.Sprint) && Entity.GetAttribute(AttribType.SprintSpeed) > 0) { state = SpeedState.Sprint; } //移动 m_Move.Move(m_MoveDir.normalized, state); //跳跃 if ((m_SkillData.canSpace() || m_SkillData.canProunce()) && PeInput.Get(PeInput.LogicFunction.Jump)) { Jump(); } //左键攻击 if (m_SkillData.canAttack() && PeInput.Get(PeInput.LogicFunction.Attack)) { AttackL(); } //右键攻击:还需要定义右键攻击逻辑键 //if (PeInput.Get(PeInput.LogicFunction.Item_Use)) // AttackR(); }
protected override void CheckOperate() { base.CheckOperate(); if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) && CanCmd()) { if (door.IsOpen) { ShutDoor(); } else { OpenDoor(); } } }
void Update() { actionTime -= Time.deltaTime; timeCount += GameTime.DeltaTime; if (timeCount >= maxSleepTime || (isMainPlayer && actionTime < 0 && (PeInput.Get(PeInput.LogicFunction.InteractWithItem) || EntityMonsterBeacon.IsRunning()))) { if (peSleep != null) { peSleep.StopOperate(character, EOperationMask.Sleep); // peSleep.UnDo(character); } enabled = false; } }
// 更新锁定目标 void UpdateLockTarget() { // 锁定目标 if (PeInput.Get(PeInput.LogicFunction.MissleTarget)) { _lockedTarget = null; _lockedTargetView = null; if (_aimEntity) { _targetToLock = _aimEntity; _targetViewToLock = _aimEntity.GetComponent <ViewCmpt>(); _timeToLock = PEVCConfig.instance.lockTargetDuration; } else { _targetToLock = null; _targetViewToLock = null; _timeToLock = -1; } } if (_timeToLock > 0f) { if (_targetToLock == _aimEntity && _targetToLock && (!_targetViewToLock || _targetViewToLock.hasView)) { _timeToLock -= Time.deltaTime; if (_timeToLock <= 0f) { _lockedTarget = _targetToLock; _lockedTargetView = _targetViewToLock; } } else { _targetToLock = null; _targetViewToLock = null; _timeToLock = -1; } } else { if ((_lockedTarget && _lockedTarget.isDead) || (_lockedTargetView && !_lockedTargetView.hasView)) { _lockedTarget = null; _lockedTargetView = null; } } }
protected override void CheckOperate() { base.CheckOperate(); if (PeInput.Get(PeInput.LogicFunction.OpenItemMenu) && CanCmd() && CanRefill()) { if (ammoTower == null) { return; } GameUI.Instance.mItemOp.SetRefill(ammoTower.ammoCount, ammoTower.ammoMaxCount, GetMaxRefillNum()); } if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) && CanCmd() && CanRefill()) { OnRefill(GetMaxRefillNum()); } }