public override void DoAction(PEActionParam para = null) { motionMgr.SetMaskState(PEActionMask.OnVehicle, true); PEActionParamDrive paramDrive = para as PEActionParamDrive; m_DrivingController = paramDrive.controller; int seatIndex = paramDrive.seatIndex; m_DrivingController.GetOn(motionMgr.Entity, seatIndex); motionMgr.FreezePhyState(GetType(), true); motionMgr.FreezeCol = true; if (null != ikCmpt) { ikCmpt.ikEnable = false; } if (null != equipCmpt) { equipCmpt.HideEquipmentByVehicle(true); } if (null != motionMgr.Entity.biologyViewCmpt) { motionMgr.Entity.biologyViewCmpt.ActivateInjured(false); } motionMgr.Entity.SendMsg(EMsg.Action_GetOnVehicle, true, m_DrivingController); }
public override bool CanDoAction(PEActionParam para = null) { if (motionMgr.IsActionRunning(PEActionType.Build)) { PeTipMsg.Register(PELocalization.GetString(9500246), PeTipMsg.EMsgLevel.Warning); return(false); } PEActionParamDrive paramDrive = para as PEActionParamDrive; m_DrivingController = paramDrive.controller; if (m_DrivingController == null) { return(false); } ItemAsset.ItemObject item = m_DrivingController.itemObject; if (item != null && skillTreeMgr != null && RandomMapConfig.useSkillTree) { if (!skillTreeMgr.CheckDriveEnable(item.protoData.itemClassId, item.protoData.level)) { return(false); } } return(true); }
public void GetOn(WhiteCat.CarrierController controller, int seatIndex, bool checkState) { if (null != mMotionMgr) { PEActionParamDrive param = PEActionParamDrive.param; param.controller = controller; param.seatIndex = seatIndex; if (!checkState) { mMotionMgr.DoActionImmediately(PEActionType.Drive, param); OnGetOnSucceed(controller, seatIndex); } else if (mMotionMgr.DoAction(PEActionType.Drive, param)) { OnGetOnSucceed(controller, seatIndex); } } }
void UpdateOtherAction() { #if UNITY_EDITOR if (Input.GetKeyDown(KeyCode.Keypad5)) { mPackage.Add(1277, 1); PeMap.StaticPoint.Mgr.Instance.UnveilAll(); } #endif if (PeCamera.isFreeLook || !m_ActionEnable) { return; } if (PeInput.Get(PeInput.LogicFunction.Jet)) { mMotionMgr.DoAction(PEActionType.JetPack); } else { mMotionMgr.EndImmediately(PEActionType.JetPack); } if (PeInput.Get(PeInput.LogicFunction.ClimbForwardLadderOnOff)) { DragItemMousePickLadder ladder = MousePicker.Instance.curPickObj as DragItemMousePickLadder; if (null != ladder) { ladder.TryClimbLadder(this); } } mEquip.HoldSheild(PeInput.Get(PeInput.LogicFunction.Block)); if (PeInput.Get(PeInput.LogicFunction.DrawWeapon)) { if (m_DisableActionByUI && mEquip.ISAimWeapon) { m_DisableActionByUI = false; } mEquip.ActiveWeapon(true); } if (PeInput.Get(PeInput.LogicFunction.Attack)) { if (SystemSettingData.Instance.AttackWhithMouseDir) { Vector3 dir = GetMouseClickDir(); mEquip.SwordAttack(dir); mEquip.TwoHandWeaponAttack(dir); } else { mEquip.SwordAttack(m_MoveDir.normalized); mEquip.TwoHandWeaponAttack(m_MoveDir.normalized); } } if (PeInput.Get(PeInput.LogicFunction.SheatheWeapon)) { mEquip.ActiveWeapon(false); } if (PeInput.Get(PeInput.LogicFunction.GatherHerb)) { mMotionMgr.DoAction(PEActionType.Gather); } if (PeInput.Get(PeInput.LogicFunction.DrawWater)) { mMotionMgr.DoAction(PEActionType.Draw); } if (PeInput.Get(PeInput.LogicFunction.TakeForwardVehicleOnOff)) { if (null != mPassenger) { if (mPassenger.IsOnVCCarrier) { mPassenger.GetOffCarrier(); } else if (null != MousePicker.Instance.curPickObj) { DragItemMousePickCarrier carrier = MousePicker.Instance.curPickObj as DragItemMousePickCarrier; if (null != carrier) { WhiteCat.CarrierController controller = carrier.GetComponent <WhiteCat.CarrierController> (); if (null != controller) { int seatIndex = controller.FindEmptySeatIndex(); if (seatIndex > -2) { if (GameConfig.IsMultiMode) { PEActionParamDrive param = PEActionParamDrive.param; param.controller = controller; param.seatIndex = seatIndex; if (mMotionMgr.CanDoAction(PEActionType.Drive, param)) { WhiteCat.CreationSkEntity skEntity = controller.GetComponent <WhiteCat.CreationSkEntity>(); if (skEntity != null && skEntity._net != null) { if (!ForceSetting.Instance.Conflict(skEntity._net.TeamId, PlayerNetwork.mainPlayerId)) { PlayerNetwork.mainPlayer.RPCServer(EPacketType.PT_InGame_GetOnVehicle, skEntity._net.Id); } else { new PeTipMsg(PELocalization.GetString(82209000), PeTipMsg.EMsgLevel.Warning); } } } } else { mPassenger.GetOn(controller, seatIndex, true); } } } } } } } if (PeInput.Get(PeInput.LogicFunction.Cut)) { mMotionMgr.DoAction(PEActionType.Fell); } else { mMotionMgr.EndAction(PEActionType.Fell); } if (PeInput.Get(PeInput.LogicFunction.EndShooting)) { mMotionMgr.EndAction(PEActionType.GunFire); mMotionMgr.EndAction(PEActionType.Pump); } else if (PeInput.Get(PeInput.LogicFunction.BegShooting)) { PEActionParamB param = PEActionParamB.param; param.b = false; mMotionMgr.DoAction(PEActionType.GunFire, param); mMotionMgr.DoAction(PEActionType.BowShoot); mMotionMgr.DoAction(PEActionType.Throw); mMotionMgr.DoAction(PEActionType.Pump); mMotionMgr.DoAction(PEActionType.RopeGunShoot); } if (m_MouseMoveMode) { if (PeInput.Get(PeInput.LogicFunction.BegShooting)) { mMove.MoveTo(m_MouseHitPos, SpeedState.Sprint); } if (Input.GetMouseButtonDown(1)) { mMove.MoveTo(Vector3.zero, SpeedState.Sprint); } } if (PeInput.Get(PeInput.LogicFunction.EndDigging)) { mMotionMgr.EndAction(PEActionType.Dig); } else if (PeInput.Get(PeInput.LogicFunction.BegDigging)) { PEActionParamV param = PEActionParamV.param; param.vec = Vector3.zero; mMotionMgr.DoAction(PEActionType.Dig, param); } if (PeInput.Get(PeInput.LogicFunction.Reload)) { mEquip.Reload(); } if (PeInput.Get(PeInput.LogicFunction.BuildMode)) { if (mMotionMgr.IsActionRunning(PEActionType.Build)) { mMotionMgr.EndAction(PEActionType.Build); } else { if (RandomDungenMgrData.InDungeon) { new PeTipMsg("[C8C800]" + PELocalization.GetString(82209004), PeTipMsg.EMsgLevel.Norm, PeTipMsg.EMsgType.Stroy); return; } if (Pathea.SingleGameStory.curType == Pathea.SingleGameStory.StoryScene.MainLand || Pathea.SingleGameStory.curType == Pathea.SingleGameStory.StoryScene.TrainingShip) { mMotionMgr.DoAction(PEActionType.Build); } else { new PeTipMsg("[C8C800]" + PELocalization.GetString(82209004), PeTipMsg.EMsgLevel.Norm, PeTipMsg.EMsgType.Stroy); } } } }