Пример #1
0
 /// <summary>
 /// 执行下这只怪物
 /// </summary>
 /// <param name="playerEntity">玩家Entity</param>
 public bool ExecUnRide(PeEntity playerEntity)
 {
     if (_monsterEntity && playerEntity && _rides)
     {
         Pathea.MotionMgrCmpt mmc     = playerEntity.motionMgr;
         OperateCmpt          operate = playerEntity.operateCmpt;
         if (null != mmc && mmc.IsActionRunning(Pathea.PEActionType.Ride) && null != operate)
         {
             PERide ride = _rides.GetRideByOperater(operate);
             if (ride)
             {
                 return(ride.StopOperate(operate, EOperationMask.Ride));
             }
             else
             {
                 Debug.Log("Try exec unRide failed!! ride is null!");
             }
         }
         else
         {
             Debug.LogFormat("Try exec unRide failed!! mmc is null:{0} ; operate is null:{1} ", null == mmc, null == operate);
         }
     }
     else
     {
         Debug.LogFormat("Try exec ride failed!! _monsterEntity is null:{0} ; playerEntity is null:{1} ; _rides is null:{2} ", null == _monsterEntity, null == playerEntity, null == _rides);
     }
     return(false);
 }
Пример #2
0
    /// <summary>
    /// 坐骑模型被重刷,ride点被重建,乘骑恢复
    /// </summary>
    /// <param name="playerEntity"></param>
    /// <returns></returns>
    public bool RecoverExecRide(PeEntity playerEntity)
    {
        if (_monsterEntity && playerEntity && _rides)
        {
            Pathea.MotionMgrCmpt mmc     = playerEntity.motionMgr;
            OperateCmpt          operate = playerEntity.operateCmpt;
            if (null != mmc && null != operate)
            {
                PERide ride = _rides.GetUseable();
                if (ride && ride.CanOperateMask(EOperationMask.Ride))
                {
                    if (mmc.IsActionRunning(Pathea.PEActionType.Ride))
                    {
                        mmc.EndImmediately(Pathea.PEActionType.Ride);
                    }

                    return(ride.StartOperate(operate, EOperationMask.Ride));
                }
                else
                {
                    Debug.Log("Try recover ride failed!! ride is null!");
                }
            }
            else
            {
                Debug.LogFormat("Try recover ride failed!! mmc is null:{0} ; operate is null:{1} ", null == mmc, null == operate);
            }
        }
        else
        {
            Debug.LogFormat("Try recover ride failed!! _monsterEntity is null:{0} ; playerEntity is null:{1} ; _rides is null:{2} ", null == _monsterEntity, null == playerEntity, null == _rides);
        }
        return(false);
    }