Пример #1
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();
             }
         }
     }
 }
Пример #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);
                }
            }
        }
    }
Пример #3
0
        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;
                }
            }
        }
Пример #4
0
//    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);
        }
    }
Пример #6
0
 protected override void CheckOperate()
 {
     if (PeInput.Get(PeInput.LogicFunction.OpenItemMenu) || PeInput.Get(PeInput.LogicFunction.InteractWithItem))
     {
         GameUI.Instance.mKickstarterCtrl.Show();
     }
 }
Пример #7
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(!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();
        }
        //}
    }
Пример #9
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;
        }
    }
Пример #10
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();
            }
        }
    }
Пример #12
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();
     }
 }
Пример #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());
     }
 }
Пример #15
0
 protected virtual void CheckOperate()
 {
     if (PeInput.Get(PeInput.LogicFunction.OpenItemMenu))
     {
         RMouseClickEvent e = new RMouseClickEvent();
         e.mousePickable = this;
         eventor.Dispatch(e);
     }
 }
Пример #16
0
    protected override void CheckOperate()
    {
        base.CheckOperate();

        if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) && CanCmd())
        {
            TryExecAction();
        }
    }
Пример #17
0
 void CheckIfCreat()
 {
     if (PeInput.Get(PeInput.LogicFunction.Item_Drag))
     {
         if (null == UICamera.hoveredObject && mCreatEnable)
         {
             CreatTower();
         }
     }
 }
Пример #18
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);
     }
 }
Пример #19
0
        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);
        }
Пример #20
0
    void CheckMenu()
    {
        if (openMenuEnable && PeInput.Get(PeInput.LogicFunction.OpenItemMenu))
        {
            if (null == RailwayPointGuiCtrl.Instance)
            {
                return;
            }

            RailwayPointGuiCtrl.Instance.SetInfo(point);
        }
    }
Пример #21
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);
        }
    }
Пример #22
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();
        }
    }
Пример #24
0
    protected override void CheckOperate()
    {
        base.CheckOperate();

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

            OnDoOperate();
        }
    }
Пример #25
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);
                    }
                }
            }
        }
    }
Пример #26
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();
        }
 protected override void CheckOperate()
 {
     base.CheckOperate();
     if (PeInput.Get(PeInput.LogicFunction.InteractWithItem) && CanCmd())
     {
         if (door.IsOpen)
         {
             ShutDoor();
         }
         else
         {
             OpenDoor();
         }
     }
 }
Пример #28
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;
        }
    }
Пример #29
0
        // 更新锁定目标
        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());
        }
    }