本文整理汇总了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)
示例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
示例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)
示例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')
示例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
示例6: exit
def exit(self):
StateData.exit(self)
messenger.send('exitSafeZone')
for link in self.linkTunnels:
link.cleanup()
self.linkTunnels = []
示例7: exit
def exit(self):
StateData.exit(self)
if self.window:
self.window.delete()
self.newHealth = None
self.healCooldownDoneSfx = None
self.originalSupply = {}
return
示例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
示例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)
示例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)
示例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)
示例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
示例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')
示例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()
示例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