示例#1
0
 public bool GetOff(Vector3 getOffPos)
 {
     Railway.Route route = Railway.Manager.Instance.GetRoute(mRailRouteId);
     if (route == null)
     {
         Debug.LogError("cant find route to get off, route id:" + mRailRouteId);
         return(false);
     }
     mMotionMgr.EndAction(PEActionType.GetOnTrain);
     mRailRouteId = Railway.Manager.InvalId;
     return(route.RemovePassenger(this, getOffPos));
 }
示例#2
0
        public override void OnUpdate()
        {
            base.OnUpdate();

            if (null == mMove)
            {
                return;
            }

            if (null == mTarget)
            {
                return;
            }

            float dis = Vector3.Distance(mTarget.position, mTrans.position);

            if (dis > setPosDis)
            {
                mTrans.position = mTarget.position;
                return;
            }

            if (dis > lostDis)
            {
                mMotionMgr.EndAction(PEActionType.Move);
                return;
            }

            Vector3 pos = mSmoothFollower.Update(mTarget.position, Time.deltaTime);

            //Vector3 pos = mTarget.position;

            mMove.MoveTo(pos);
        }
示例#3
0
 public void EndAction(PEActionType type)
 {
     if (m_Motion != null)
     {
         m_Motion.EndAction(type);
     }
 }
示例#4
0
 public void QuitBuildMode()
 {
     if (null != Pathea.PeCreature.Instance && null != Pathea.PeCreature.Instance.mainPlayer)
     {
         Pathea.MotionMgrCmpt mmc = Pathea.PeCreature.Instance.mainPlayer.GetCmpt <Pathea.MotionMgrCmpt>();
         if (null != mmc)
         {
             mmc.EndAction(Pathea.PEActionType.Build);
         }
     }
     else
     {
         QuitBlock();
     }
 }
示例#5
0
        void OnEndAction(bool immediately)
        {
            motionMgr.SetMaskState(PEActionMask.Hand, false);

            if (null != m_Interaction)
            {
                m_Interaction.EndInteraction(immediately);
                m_Interaction = null;
            }

            if (null != m_TargetMotion)
            {
                m_TargetMotion.EndAction(PEActionType.Handed);
            }

            if (null != m_MoveAction)
            {
                m_MoveAction.rotateSpeedScale = 1f;
            }
        }
示例#6
0
        public void CloseMission_buildCreateISO()
        {
            GameObject.Destroy(isoCube1);
            GameObject.Destroy(isoCube2);

            BSBlock45Data.voxelWrite -= AddRecordVoxel;
            BSVoxel vol = new BSVoxel(0, 0);

            for (int i = 0; i < recordVoxelRemove.Count; i++)
            {
                int[] tmp = recordVoxelRemove[i];
                BuildingMan.Blocks.SafeWrite(vol, tmp[0], tmp[1], tmp[2]);
            }
            Pathea.MotionMgrCmpt mmc = Pathea.PeCreature.Instance.mainPlayer.GetCmpt <Pathea.MotionMgrCmpt>();
            if (mmc != null)
            {
                mmc.EndAction(Pathea.PEActionType.Build);
            }

            receiverGroup.SetActive(false);
            DestroyTerrian();
        }
示例#7
0
            void CheckRelation(bool doImmediately)
            {
                //End other action
                for (int i = 0; i < m_RelationData.m_PauseAction.Count; ++i)
                {
                    m_MotionMgr.PauseAction(m_RelationData.m_PauseAction[i], m_Action.ActionType);
                }

                for (int i = 0; i < m_RelationData.m_EndAction.Count; ++i)
                {
                    if (doImmediately)
                    {
                        m_MotionMgr.EndImmediately(m_RelationData.m_EndAction[i]);
                    }
                    else
                    {
                        m_MotionMgr.EndAction(m_RelationData.m_EndAction[i]);
                    }
                }
                for (int i = 0; i < m_RelationData.m_EndImmediately.Count; ++i)
                {
                    m_MotionMgr.EndImmediately(m_RelationData.m_EndImmediately[i]);
                }
            }
示例#8
0
        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);
                    }
                }
            }
        }