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


Python DNAUtil.getBuildingClassFromName方法代码示例

本文整理汇总了Python中DNAUtil.getBuildingClassFromName方法的典型用法代码示例。如果您正苦于以下问题:Python DNAUtil.getBuildingClassFromName方法的具体用法?Python DNAUtil.getBuildingClassFromName怎么用?Python DNAUtil.getBuildingClassFromName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DNAUtil的用法示例。


在下文中一共展示了DNAUtil.getBuildingClassFromName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _postGenerate

# 需要导入模块: import DNAUtil [as 别名]
# 或者: from DNAUtil import getBuildingClassFromName [as 别名]
    def _postGenerate(self, storage, np):
        height = np.getPythonTag('wall_height') or 0.0
        np.clearPythonTag('wall_height')

        # First, set up collisions. We need a (self.width, height)-sized square.
        barrierNode = storage.findNode('wall_camera_barrier')
        if not barrierNode:
            raise DNAError('No wall_camera_barrier in storage.')

        barrier = barrierNode.copyTo(np)
        barrier.setScale(self.width, 1, height)

        type = DNAUtil.getBuildingClassFromName(self.id)
        if type == 'tb':
            self.generateSuitGeometry(storage, np, height, barrier)
            self.generateCogdoGeometry(storage, np, height, barrier)

        # We need to set collisions on all of our knock knock doors:
        block = DNAUtil.getBlockFromName(self.name)
        if block is not None:
            for collisionNP in np.findAllMatches('**/door_*/+CollisionNode'):
                collisionNP.setName('KnockKnockDoorSphere_%d' % block)

        # Finally, flatten down:
        np.flattenStrong()
开发者ID:ponyboy837,项目名称:SecretGitLolYoloSweg2015,代码行数:27,代码来源:DNAFlatBuilding.py

示例2: setupSuitBuildingOrigin

# 需要导入模块: import DNAUtil [as 别名]
# 或者: from DNAUtil import getBuildingClassFromName [as 别名]
    def setupSuitBuildingOrigin(self, nodePath):
        building = DNAUtil.getBuildingClassFromName(self.id)
        if building != 'tb':
            return

        name = 'sb' + self.id[2:]

        node = nodePath.find('**/*suit_building_origin')
        if node.isEmpty():
            #TODO: dna logging
            #print 'DNALandmarkBuilding ' + name + ' did not find **/*suit_building_origin'
            node = nodePath.attachNewNode(ModelNode(self.name))
        else:
            node.wrtReparentTo(nodePath)
            node.setName(name)

        node.node().setPreserveTransform(ModelNode.PTNet)
        node.hide()
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:20,代码来源:DNALandmarkBuilding.py


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