當前位置: 首頁>>代碼示例>>Python>>正文


Python StateData.StateData類代碼示例

本文整理匯總了Python中direct.fsm.StateData.StateData的典型用法代碼示例。如果您正苦於以下問題:Python StateData類的具體用法?Python StateData怎麽用?Python StateData使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了StateData類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: load

 def load(self, zoneId):
     StateData.load(self)
     self.zoneId = zoneId
     self.branchZone = ZoneUtil.getBranchZone(zoneId)
     self.canonicalBranchZone = ZoneUtil.getCanonicalBranchZone(zoneId)
     self.music = base.loadMusic(self.musicFile)
     self.interiorMusic = base.loadMusic(self.interiorMusicFile)
開發者ID:coginvasion,項目名稱:src,代碼行數:7,代碼來源:TownLoader.py

示例2: exit

 def exit(self):
     StateData.exit(self)
     if self._requestStatus.get('how', None) != 'doorOut':
         base.transitions.noTransitions()
     del self._requestStatus
     self.fsm.request('off')
     return
開發者ID:coginvasion,項目名稱:src,代碼行數:7,代碼來源:QuietZoneState.py

示例3: __init__

 def __init__(self, book, parentFSM):
     self.book = book
     self.parentFSM = parentFSM
     StateData.__init__(self, 'optionPageDone')
     self.fsm = ClassicFSM('OptionPage', [State('off', self.enterOff, self.exitOff), State('basePage', self.enterBasePage, self.exitBasePage), State('displayPage', self.enterDisplayPage, self.exitDisplayPage)], 'off', 'off')
     self.fsm.enterInitialState()
     self.parentFSM.getStateNamed('optionPage').addChild(self.fsm)
開發者ID:coginvasion,項目名稱:src,代碼行數:7,代碼來源:OptionPage.py

示例4: load

 def load(self):
     StateData.load(self)
     self.book_contents = loader.loadModel('phase_3.5/models/gui/stickerbook_gui.bam')
     self.book_texture = self.book_contents.find('**/big_book')
     self.book_open = loader.loadSfx('phase_3.5/audio/sfx/GUI_stickerbook_open.mp3')
     self.book_close = loader.loadSfx('phase_3.5/audio/sfx/GUI_stickerbook_delete.mp3')
     self.book_turn = loader.loadSfx('phase_3.5/audio/sfx/GUI_stickerbook_turn.mp3')
開發者ID:coginvasion,項目名稱:src,代碼行數:7,代碼來源:ShtickerBook.py

示例5: load

    def load(self):
        StateData.load(self)
        if self.pgMusicFilename:
            self.music = base.loadMusic(self.pgMusicFilename)
        if self.battleMusicFile:
            self.battleMusic = base.loadMusic(self.battleMusicFile)
        if self.invasionMusicFiles:
            self.invasionMusic = None
        if self.bossBattleMusicFile:
            self.bossBattleMusic = base.loadMusic(self.bossBattleMusicFile)
        if self.interiorMusicFilename:
            self.interiorMusic = base.loadMusic(self.interiorMusicFilename)
        if self.tournamentMusicFiles:
            self.tournamentMusic = None
        self.createSafeZone(self.dnaFile)
        self.parentFSMState.addChild(self.fsm)
        width, height, fs, music, sfx, tex_detail, model_detail, aa, af = SettingsManager().getSettings('settings.json')
        if af == 'on':
            self.notify.info('Anisotropic Filtering is on, applying to textures.')
            for nodepath in self.geom.findAllMatches('*'):
                try:
                    for node in nodepath.findAllMatches('**'):
                        try:
                            node.findTexture('*').setAnisotropicDegree(8)
                        except:
                            pass

                except:
                    continue

        return
開發者ID:coginvasion,項目名稱:src,代碼行數:31,代碼來源:SafeZoneLoader.py

示例6: exit

    def exit(self):
        StateData.exit(self)
        messenger.send('exitSafeZone')
        for link in self.linkTunnels:
            link.cleanup()

        self.linkTunnels = []
開發者ID:coginvasion,項目名稱:src,代碼行數:7,代碼來源:SafeZoneLoader.py

示例7: exit

 def exit(self):
     StateData.exit(self)
     if self.window:
         self.window.delete()
         self.newHealth = None
         self.healCooldownDoneSfx = None
         self.originalSupply = {}
     return
開發者ID:coginvasion,項目名稱:src,代碼行數:8,代碼來源:Shop.py

示例8: __init__

 def __init__(self, doneEvent, moveOn = 1):
     StateData.__init__(self, doneEvent)
     self.fsm = ClassicFSM('quietZone', [State('off', self.enterOff, self.exitOff, ['waitForQuietZoneResponse']),
      State('waitForQuietZoneResponse', self.enterWaitForQuietZoneResponse, self.exitWaitForQuietZoneResponse, ['waitForSetZoneResponse']),
      State('waitForSetZoneResponse', self.enterWaitForSetZoneResponse, self.exitWaitForSetZoneResponse, ['waitForSetZoneComplete']),
      State('waitForSetZoneComplete', self.enterWaitForSetZoneComplete, self.exitWaitForSetZoneComplete, ['off'])], 'off', 'off')
     self.fsm.enterInitialState()
     self.moveOn = moveOn
開發者ID:coginvasion,項目名稱:src,代碼行數:8,代碼來源:QuietZoneState.py

示例9: __init__

 def __init__(self, book, parentFSM):
     self.book = book
     self.parentFSM = parentFSM
     StateData.__init__(self, 'adminPageDone')
     self.fsm = ClassicFSM('AdminPage', [State('off', self.enterOff, self.exitOff),
      State('basePage', self.enterBasePage, self.exitBasePage),
      State('kickSection', self.enterKickSection, self.exitKickSection),
      State('sysMsgSection', self.enterSysMsgSection, self.exitSysMsgSection)], 'off', 'off')
     self.fsm.enterInitialState()
     self.parentFSM.getStateNamed('adminPage').addChild(self.fsm)
開發者ID:coginvasion,項目名稱:src,代碼行數:10,代碼來源:AdminPage.py

示例10: exit

 def exit(self):
     if not self.entered:
         return
     self.entered = 0
     base.setBackgroundColor(CIGlobals.DefaultBackgroundColor)
     render.show()
     self.book_img.destroy()
     del self.book_img
     self.book_close.play()
     self.fsm.request('off')
     StateData.exit(self)
開發者ID:coginvasion,項目名稱:src,代碼行數:11,代碼來源:ShtickerBook.py

示例11: enter

 def enter(self):
     StateData.enter(self)
     self.avMoney = base.localAvatar.getMoney()
     self.origHealth = base.localAvatar.getHealth()
     self.window = ShopWindow(self, image='phase_4/maps/FrameBlankA.jpg')
     self.window.setup()
     self.window.setOKCommand(self.confirmPurchase)
     self.window.setCancelCommand(self.cancelPurchase)
     self.window.makePages(self.distShop.getItems())
     self.window.setPage(0)
     self.healCooldownDoneSfx = base.loadSfx(self.healCooldownDoneSoundPath)
開發者ID:coginvasion,項目名稱:src,代碼行數:11,代碼來源:Shop.py

示例12: __init__

 def __init__(self, parentFSM):
     StateData.__init__(self, 'avChooseDone')
     self.avChooseFSM = ClassicFSM('avChoose', [State('getToonData', self.enterGetToonData, self.exitGetToonData),
      State('avChoose', self.enterAvChoose, self.exitAvChoose),
      State('waitForToonDelResponse', self.enterWaitForToonDelResponse, self.exitWaitForToonDelResponse),
      State('off', self.enterOff, self.exitOff)], 'off', 'off')
     self.avChooseFSM.enterInitialState()
     self.parentFSM = parentFSM
     self.parentFSM.getStateNamed('avChoose').addChild(self.avChooseFSM)
     self.pickAToon = None
     self.setAvatarsNone()
     return
開發者ID:coginvasion,項目名稱:src,代碼行數:12,代碼來源:AvChooser.py

示例13: enter

 def enter(self):
     if self.entered:
         return
     self.entered = 1
     StateData.enter(self)
     render.hide()
     base.setBackgroundColor(0.05, 0.15, 0.4)
     self.book_img = OnscreenImage(image=self.book_texture, scale=(2, 1, 1.5))
     self.book_open.play()
     if base.localAvatar.getAdminToken() > -1:
         self.fsm.request('adminPage')
     else:
         self.fsm.request('mapPage')
開發者ID:coginvasion,項目名稱:src,代碼行數:13,代碼來源:ShtickerBook.py

示例14: enter

 def enter(self, requestStatus):
     StateData.enter(self)
     hoodId = requestStatus['hoodId']
     zoneId = requestStatus['zoneId']
     rootZone = ZoneUtil.getZoneId(hoodId)
     if base.localAvatar.getLastHood() != rootZone and hoodId != CIGlobals.MinigameArea:
         base.localAvatar.b_setLastHood(rootZone)
     if not base.localAvatar.hasDiscoveredHood(rootZone):
         hoodsDiscovered = list(base.localAvatar.getHoodsDiscovered())
         hoodsDiscovered.append(rootZone)
         base.localAvatar.b_setHoodsDiscovered(hoodsDiscovered)
     text = self.getHoodText(zoneId)
     self.titleText = OnscreenText(text, fg=self.titleColor, font=CIGlobals.getMickeyFont(), scale=0.15, pos=(0, -0.65))
     self.titleText.hide()
開發者ID:coginvasion,項目名稱:src,代碼行數:14,代碼來源:Hood.py

示例15: __init__

 def __init__(self, hood, parentFSMState, doneEvent):
     self.hood = hood
     self.parentFSMState = parentFSMState
     StateData.__init__(self, doneEvent)
     self.fsm = ClassicFSM('TownLoader', [State('start', self.enterStart, self.exitStart, ['quietZone', 'street']),
      State('street', self.enterStreet, self.exitStreet, ['quietZone']),
      State('toonInterior', self.enterToonInterior, self.exitToonInterior, ['quietZone']),
      State('quietZone', self.enterQuietZone, self.exitQuietZone, ['street', 'toonInterior']),
      State('final', self.enterFinal, self.exitFinal, ['start'])], 'start', 'final')
     self.branchZone = None
     self.canonicalBranchZone = None
     self.placeDoneEvent = 'placeDone'
     self.linkTunnels = []
     return
開發者ID:coginvasion,項目名稱:src,代碼行數:14,代碼來源:TownLoader.py


注:本文中的direct.fsm.StateData.StateData類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。