当前位置: 首页>>代码示例>>Python>>正文


Python DistributedNode.generate方法代码示例

本文整理汇总了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)
开发者ID:mcgillcomp361,项目名称:COMP361Project,代码行数:11,代码来源:distributedPlayer.py

示例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
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:15,代码来源:DistributedElectionCamera.py

示例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)
开发者ID:coginvasion,项目名称:src,代码行数:39,代码来源:DistributedCityCart.py

示例4: generate

# 需要导入模块: from direct.distributed.DistributedNode import DistributedNode [as 别名]
# 或者: from direct.distributed.DistributedNode.DistributedNode import generate [as 别名]
 def generate(self):
     DistributedNode.generate(self)
开发者ID:AdrianF98,项目名称:Toontown-2-Revised,代码行数:4,代码来源:DistributedCartesianGrid.py

示例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()
开发者ID:coginvasion,项目名称:src,代码行数:5,代码来源:DistributedDroppableCollectableObject.py

示例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')
开发者ID:coginvasion,项目名称:src,代码行数:6,代码来源:DistributedTrolley.py


注:本文中的direct.distributed.DistributedNode.DistributedNode.generate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。