本文整理汇总了Python中pirates.battle.WeaponGlobals.getProjectileAnimT方法的典型用法代码示例。如果您正苦于以下问题:Python WeaponGlobals.getProjectileAnimT方法的具体用法?Python WeaponGlobals.getProjectileAnimT怎么用?Python WeaponGlobals.getProjectileAnimT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.battle.WeaponGlobals
的用法示例。
在下文中一共展示了WeaponGlobals.getProjectileAnimT方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getProjectileInfo
# 需要导入模块: from pirates.battle import WeaponGlobals [as 别名]
# 或者: from pirates.battle.WeaponGlobals import getProjectileAnimT [as 别名]
def getProjectileInfo(self, skillId, target):
throwSpeed = WeaponGlobals.getProjectileSpeed(skillId)
if not throwSpeed:
return (None, None, None)
placeHolder = self.attachNewNode('projectilePlaceHolder')
if target:
if not target.isEmpty():
placeHolder.setPos(render, target.getPos(render))
placeHolder.setZ(placeHolder, target.getHeight() * 0.66600000000000004)
else:
range = WeaponGlobals.getProjectileDefaultRange(skillId)
if self == localAvatar:
placeHolder.setPos(camera, 0, range[0], range[1])
else:
placeHolder.setPos(self, 0, range[0], 4.0)
dist = self.getDistance(placeHolder)
time = dist / throwSpeed
impactT = time
animT = WeaponGlobals.getProjectileAnimT(skillId)
if animT:
impactT += animT
targetPos = placeHolder.getPos(render)
placeHolder.removeNode()
return (targetPos, time, impactT)