Example #1
0
    private void UpdateDriveHelpContent()
    {
        string content = PELocalization.GetString(82201084);

        if (string.IsNullOrEmpty(content))
        {
            return;
        }

        content = content.Replace("$W$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.MoveForward).ToString());
        content = content.Replace("$S$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.MoveBackward).ToString());
        content = content.Replace("$A$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.MoveLeft).ToString());
        content = content.Replace("$D$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.MoveRight).ToString());

        content = content.Replace("$E$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.InteractWithItem).ToString());
        content = content.Replace("$L$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.SwitchLight).ToString());
        content = content.Replace("$F$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.Vehicle_AttackModeOnOff).ToString());

        content = content.Replace("$Space$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.Vehicle_LiftUp).ToString());
        content = content.Replace("$Alt$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.Vehicle_LiftDown).ToString());

        content = content.Replace("$F1$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.VehicleWeaponGrp1).ToString());
        content = content.Replace("$F2$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.VehicleWeaponGrp2).ToString());
        content = content.Replace("$F3$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.VehicleWeaponGrp3).ToString());
        content = content.Replace("$F4$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.VehicleWeaponGrp4).ToString());

        content = content.Replace("$Shift$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.Vehicle_Sprint).ToString());

        content = content.Replace("$Z$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.MissleTarget).ToString());
        content = content.Replace("$X$", PeInput.GetKeyCodeByLogicFunKey(PeInput.LogicFunction.MissleLaunch).ToString());

        driveHelpLbl.text = content;
        driveHelpLbl.MakePixelPerfect();
    }
Example #2
0
    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);
                }
            }
        }
    }
Example #3
0
    void Update()
    {
        if (_targetTrans)
        {
            _tempZ = PeInput.GetAxisH();
            _tempX = PeInput.GetAxisV();

            if (Mathf.Abs(_tempX) > float.Epsilon)
            {
                _offsetRotate.x = (_tempX * Time.deltaTime) * TameMonsterConfig.instance.CtrlRotateSpeed;
            }
            else
            {
                _offsetRotate.x = 0f;
            }

            if (Mathf.Abs(_tempZ) > float.Epsilon)
            {
                _offsetRotate.z = -(_tempZ * Time.deltaTime) * TameMonsterConfig.instance.CtrlRotateSpeed;
            }
            else
            {
                _offsetRotate.z = 0f;
            }

            _offsetRotate.y = 0f;
        }
    }
Example #4
0
//    public bool IsChild(Transform child)
//    {
//        return child.IsChildOf(mSkillRunner.transform);
//    }

    protected virtual void CheckMainPlayerCtrl()
    {
        if (PeInput.Get(PeInput.LogicFunction.Item_Drag))
        {
            CostSkill();
        }
    }
Example #5
0
 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();
             }
         }
     }
 }
Example #6
0
 protected override void CheckOperate()
 {
     if (PeInput.Get(PeInput.LogicFunction.OpenItemMenu) || PeInput.Get(PeInput.LogicFunction.InteractWithItem))
     {
         GameUI.Instance.mKickstarterCtrl.Show();
     }
 }
        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;
                }
            }
        }
Example #8
0
 // 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 (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()
    {
        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();
        }
        //}
    }
Example #11
0
    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;
        }
    }
Example #12
0
 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();
            }
        }
    }
Example #14
0
 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());
     }
 }
Example #15
0
 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();
     }
 }
Example #17
0
 protected virtual void CheckOperate()
 {
     if (PeInput.Get(PeInput.LogicFunction.OpenItemMenu))
     {
         RMouseClickEvent e = new RMouseClickEvent();
         e.mousePickable = this;
         eventor.Dispatch(e);
     }
 }
Example #18
0
    protected override void CheckOperate()
    {
        base.CheckOperate();

        if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) && CanCmd())
        {
            TryExecAction();
        }
    }
Example #19
0
 void CheckIfCreat()
 {
     if (PeInput.Get(PeInput.LogicFunction.Item_Drag))
     {
         if (null == UICamera.hoveredObject && mCreatEnable)
         {
             CreatTower();
         }
     }
 }
        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);
        }
Example #21
0
 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);
     }
 }
Example #22
0
    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);
        }
    }
Example #23
0
    void CheckMenu()
    {
        if (openMenuEnable && PeInput.Get(PeInput.LogicFunction.OpenItemMenu))
        {
            if (null == RailwayPointGuiCtrl.Instance)
            {
                return;
            }

            RailwayPointGuiCtrl.Instance.SetInfo(point);
        }
    }
Example #24
0
 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();
        }
    }
Example #26
0
    protected override void CheckOperate()
    {
        base.CheckOperate();

        if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) && CanCmd())
        {
            if (!Operatable())
            {
                return;
            }

            OnDoOperate();
        }
    }
Example #27
0
    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);
                    }
                }
            }
        }
    }
Example #28
0
        /// <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();
        }
Example #29
0
    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;
        }
    }
 protected override void CheckOperate()
 {
     base.CheckOperate();
     if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) && CanCmd())
     {
         if (door.IsOpen)
         {
             ShutDoor();
         }
         else
         {
             OpenDoor();
         }
     }
 }