本文整理汇总了Python中direct.distributed.DistributedNode.DistributedNode.generate方法的典型用法代码示例。如果您正苦于以下问题:Python DistributedNode.generate方法的具体用法?Python DistributedNode.generate怎么用?Python DistributedNode.generate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类direct.distributed.DistributedNode.DistributedNode
的用法示例。
在下文中一共展示了DistributedNode.generate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate
# 需要导入模块: from direct.distributed.DistributedNode import DistributedNode [as 别名]
# 或者: from direct.distributed.DistributedNode.DistributedNode import generate [as 别名]
def generate(self):
""" This method is called when the object is generated: when it
manifests for the first time on a particular client, or when it
is pulled out of the cache after a previous manifestation. At
the time of this call, the object has been created, but its
required fields have not yet been filled in. """
# Always call up to parent class
DistributedNode.generate(self)
示例2: generate
# 需要导入模块: from direct.distributed.DistributedNode import DistributedNode [as 别名]
# 或者: from direct.distributed.DistributedNode.DistributedNode import generate [as 别名]
def generate(self):
self.assign(render.attachNewNode('DistributedElectionCamera'))
DistributedNode.generate(self)
self.camera = loader.loadModel('phase_4/models/events/election_tvCamera')
self.camera.reparentTo(render)
self.camera.setScale(0.25)
propJoint = self.camera.find('**/hat')
self.camBody = self.camera.find('**/camera_body')
prop = BattleProps.globalPropPool.getProp('propeller')
prop.reparentTo(propJoint)
prop.setZ(1)
prop.loop('propeller', fromFrame=0, toFrame=8)
self.idleInterval = None
示例3: generate
# 需要导入模块: from direct.distributed.DistributedNode import DistributedNode [as 别名]
# 或者: from direct.distributed.DistributedNode.DistributedNode import generate [as 别名]
def generate(self):
DistributedNode.generate(self)
self.cart = loader.loadModel(self.cartModelPath)
self.cart.reparentTo(self)
self.cart.setH(180)
heads = []
for head in CIGlobals.SuitBodyData.keys():
if CIGlobals.SuitBodyData[head][0] != 'B':
heads.append(head)
head = random.choice(heads)
suitType = CIGlobals.SuitBodyData[head][0]
suitDept = CIGlobals.SuitBodyData[head][1]
self.suitInCar = Suit()
self.suitInCar.generateSuit(suitType, head, suitDept, 137, 0, False)
self.suitInCar.loop('sit')
self.suitInCar.disableRay()
self.suitInCar.setScale(0.7)
self.suitInCar.setH(180)
self.suitInCar.setPos(0, -1, -1.5)
self.suitInCar.reparentTo(self.cart.find('**/seat1'))
self.soundEngineLoop = base.audio3d.loadSfx('phase_6/audio/sfx/KART_Engine_loop_0.wav')
base.audio3d.attachSoundToObject(self.soundEngineLoop, self)
base.playSfx(self.soundEngineLoop, looping=1)
self.soundDriveByHorn = base.audio3d.loadSfx(self.honkSfxPath)
base.audio3d.attachSoundToObject(self.soundDriveByHorn, self)
self.soundDriveBy = base.audio3d.loadSfx('phase_14/audio/sfx/cogtropolis_citycar_driveby.mp3')
base.audio3d.attachSoundToObject(self.soundDriveBy, self)
sphere = CollisionSphere(0, 0, 0, 2.5)
sphere.setTangible(0)
node = CollisionNode(self.uniqueName('cartSphere'))
node.setCollideMask(CIGlobals.WallBitmask)
node.addSolid(sphere)
self.collNodePath = self.attachNewNode(node)
self.collNodePath.setZ(1.5)
self.collNodePath.setSy(2.0)
self.collNodePath.setSx(1.75)
示例4: generate
# 需要导入模块: from direct.distributed.DistributedNode import DistributedNode [as 别名]
# 或者: from direct.distributed.DistributedNode.DistributedNode import generate [as 别名]
def generate(self):
DistributedNode.generate(self)
示例5: generate
# 需要导入模块: from direct.distributed.DistributedNode import DistributedNode [as 别名]
# 或者: from direct.distributed.DistributedNode.DistributedNode import generate [as 别名]
def generate(self):
DistributedNode.generate(self)
self.load()
示例6: generate
# 需要导入模块: from direct.distributed.DistributedNode import DistributedNode [as 别名]
# 或者: from direct.distributed.DistributedNode.DistributedNode import generate [as 别名]
def generate(self):
DistributedNode.generate(self)
self.trolleyStation = self.cr.getCurrentHood().geom.find('**/*trolley_station*')
self.trolleyCar = self.trolleyStation.find('**/trolley_car')