void Railway.IPassenger.GetOn(string pose) { mMotionMgr.FreezePhyState(GetType(), true); mMotionMgr.SetMaskState(PEActionMask.OnVehicle, true); PEActionParamS param = PEActionParamS.param; param.str = pose; mMotionMgr.DoActionImmediately(PEActionType.GetOnTrain, param); }
public override void DoAction(PEActionParam para = null) { if (null == trans || null == move) { return; } PEActionParamN paramN = para as PEActionParamN; PeEntity targetEntity = EntityMgr.Instance.Get(paramN.n); if (null != targetEntity) { m_TargetMotion = targetEntity.motionMgr; } else { return; } if (null != m_TargetMotion) { m_TargetAction = m_TargetMotion.GetAction <Action_Handed>(); } else { return; } m_TargetTrans = targetEntity.peTrans; if (null == m_TargetTrans) { return; } if (null == m_MoveAction) { m_MoveAction = motionMgr.GetAction <Action_Move>(); } m_AnimMatch = false; motionMgr.SetMaskState(PEActionMask.Hand, true); PEActionParamN param = PEActionParamN.param; param.n = motionMgr.Entity.Id; m_TargetMotion.DoActionImmediately(PEActionType.Handed, param); m_EndAction = false; m_StartTime = Time.time; m_CurTryCount = 0; if (PeGameMgr.IsMulti && entity == PeCreature.Instance.mainPlayer) { targetEntity.netCmpt.network.RPCServer(EPacketType.PT_NPC_RequestAiOp, (int)EReqType.Hand, entity.Id); } }
public void ActiveWeapon(PEHoldAbleEquipment handChangeEquipment, bool active, bool immediately = false) { if (null != m_Gloves && handChangeEquipment == m_Gloves as PEHoldAbleEquipment) { ActiveGloves(active); ActiveEquipment(m_Gloves, active); } else { if (null != m_Gloves && Weapon == m_Gloves) { ActiveGloves(false); } if (null != handChangeEquipment) { if (immediately) { if (active) { if (!m_MotionMgr.IsActionRunning(handChangeEquipment.m_HandChangeAttr.m_ActiveActionType)) { m_MotionMgr.DoActionImmediately(handChangeEquipment.m_HandChangeAttr.m_ActiveActionType); m_Weapon = handChangeEquipment as IWeapon; if (null != m_Weapon && null != handChangeEquipment.m_ItemObj) { m_WeaponID = handChangeEquipment.m_ItemObj.instanceId; } else { m_WeaponID = -1; } } } else { if (m_MotionMgr.IsActionRunning(handChangeEquipment.m_HandChangeAttr.m_ActiveActionType)) { m_MotionMgr.EndImmediately(handChangeEquipment.m_HandChangeAttr.m_ActiveActionType); m_WeaponID = -1; m_Weapon = null; } } } else { if (active) { if (!m_MotionMgr.IsActionRunning(handChangeEquipment.m_HandChangeAttr.m_ActiveActionType) && m_MotionMgr.DoAction(handChangeEquipment.m_HandChangeAttr.m_ActiveActionType)) { m_Weapon = handChangeEquipment as IWeapon; if (null != m_Weapon && null != handChangeEquipment.m_ItemObj) { m_WeaponID = handChangeEquipment.m_ItemObj.instanceId; } else { m_WeaponID = -1; } } } else { if (m_MotionMgr.IsActionRunning(handChangeEquipment.m_HandChangeAttr.m_ActiveActionType) && m_MotionMgr.DoAction(handChangeEquipment.m_HandChangeAttr.m_UnActiveActionType)) { m_Weapon = null; m_WeaponID = -1; } } } } } }