當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。