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


Python SoundInterval.start方法代码示例

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


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

示例1: setMovie

# 需要导入模块: from direct.interval.IntervalGlobal import SoundInterval [as 别名]
# 或者: from direct.interval.IntervalGlobal.SoundInterval import start [as 别名]
 def setMovie(self, mode, avId):
     isLocalToon = avId == base.localAvatar.doId
     if isLocalToon:
         DistributedMailbox.notify.debug('setMovie( mode=%d, avId=%d ) called on a local toon' % (mode, avId))
     else:
         DistributedMailbox.notify.debug('setMovie( mode=%d, avId=%d ) called on a non-local toon' % (mode, avId))
     if mode == MailboxGlobals.MAILBOX_MOVIE_CLEAR:
         DistributedMailbox.notify.debug('setMovie: clear')
         return
     elif mode == MailboxGlobals.MAILBOX_MOVIE_EXIT:
         if random.random() < 0.5:
             sfx = base.loadSfx('phase_5.5/audio/sfx/mailbox_close_1.ogg')
         else:
             sfx = base.loadSfx('phase_5.5/audio/sfx/mailbox_close_2.ogg')
         sfxTrack = SoundInterval(sfx, node=self.model)
         sfxTrack.start()
         DistributedMailbox.notify.debug('setMovie: exit')
         return
     elif mode == MailboxGlobals.MAILBOX_MOVIE_EMPTY:
         DistributedMailbox.notify.debug('setMovie: empty')
         if isLocalToon:
             self.mailboxDialog = TTDialog.TTDialog(dialogName='MailboxEmpty', style=TTDialog.Acknowledge, text=TTLocalizer.DistributedMailboxEmpty, text_wordwrap=15, fadeScreen=1, command=self.__clearDialog)
         return
     elif mode == MailboxGlobals.MAILBOX_MOVIE_WAITING:
         DistributedMailbox.notify.debug('setMovie: waiting')
         if isLocalToon:
             self.mailboxDialog = TTDialog.TTDialog(dialogName='MailboxWaiting', style=TTDialog.Acknowledge, text=TTLocalizer.DistributedMailboxWaiting, text_wordwrap=15, fadeScreen=1, command=self.__clearDialog)
         return
     elif mode == MailboxGlobals.MAILBOX_MOVIE_READY:
         DistributedMailbox.notify.debug('setMovie: ready')
         if random.random() < 0.5:
             sfx = base.loadSfx('phase_5.5/audio/sfx/mailbox_open_1.ogg')
         else:
             sfx = base.loadSfx('phase_5.5/audio/sfx/mailbox_open_2.ogg')
         sfxTrack = SoundInterval(sfx, node=self.model)
         sfxTrack.start()
         if isLocalToon:
             self.mailboxGui = MailboxScreen.MailboxScreen(self, base.localAvatar, self.mailboxGuiDoneEvent)
             self.mailboxGui.show()
             self.accept(self.mailboxGuiDoneEvent, self.__handleMailboxDone)
         return
     elif mode == MailboxGlobals.MAILBOX_MOVIE_NOT_OWNER:
         DistributedMailbox.notify.debug('setMovie: not owner')
         if isLocalToon:
             self.mailboxDialog = TTDialog.TTDialog(dialogName='MailboxNotOwner', style=TTDialog.Acknowledge, text=TTLocalizer.DistributedMailboxNotOwner, text_wordwrap=15, fadeScreen=1, command=self.__clearDialog)
         return
     else:
         DistributedMailbox.notify.warning('unknown mode in setMovie: %s' % mode)
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:50,代码来源:DistributedMailbox.py

示例2: DistributedBanquetTable

# 需要导入模块: from direct.interval.IntervalGlobal import SoundInterval [as 别名]
# 或者: from direct.interval.IntervalGlobal.SoundInterval import start [as 别名]

#.........这里部分代码省略.........
    def setupChairCols(self):
        for i in xrange(self.numDiners):
            chairCol = self.tableGroup.find("**/collision_chair_%d" % (i + 1))
            colName = "ChairCol-%d-%d" % (self.index, i)
            chairCol.setTag("chairIndex", str(i))
            chairCol.setName(colName)
            chairCol.setCollideMask(ToontownGlobals.WallBitmask)
            self.accept("enter" + colName, self.touchedChair)

    def touchedChair(self, colEntry):
        chairIndex = int(colEntry.getIntoNodePath().getTag("chairIndex"))
        if chairIndex in self.dinerStatus:
            status = self.dinerStatus[chairIndex]
            if status in (self.HUNGRY, self.ANGRY):
                self.boss.localToonTouchedChair(self.index, chairIndex)

    def serveFood(self, food, chairIndex):
        self.removeFoodModel(chairIndex)
        serviceLoc = self.serviceLocs.get(chairIndex)
        if not food or food.isEmpty():
            foodModel = loader.loadModel("phase_12/models/bossbotHQ/canoffood")
            foodModel.setScale(ToontownGlobals.BossbotFoodModelScale)
            foodModel.reparentTo(serviceLoc)
        else:
            food.wrtReparentTo(serviceLoc)
            tray = food.find("**/tray")
            if not tray.isEmpty():
                tray.hide()

            ivalDuration = 1.5
            foodMoveIval = Parallel(
                SoundInterval(self.serveFoodSfx, node=food),
                ProjectileInterval(
                    food, duration=ivalDuration, startPos=food.getPos(serviceLoc), endPos=serviceLoc.getPos(serviceLoc)
                ),
                LerpHprInterval(food, ivalDuration, Point3(0, -360, 0)),
            )
            intervalName = "serveFood-%d-%d" % (self.index, chairIndex)
            foodMoveIval.start()
            self.activeIntervals[intervalName] = foodMoveIval

    def setDinerStatus(self, chairIndex, status):
        if chairIndex in self.dinerStatus:
            oldStatus = self.dinerStatus[chairIndex]
            self.dinerStatus[chairIndex] = status
            if oldStatus != status:
                if status == self.EATING:
                    self.changeDinerToEating(chairIndex)
                elif status == self.HUNGRY:
                    self.changeDinerToHungry(chairIndex)
                elif status == self.ANGRY:
                    self.changeDinerToAngry(chairIndex)
                elif status == self.DEAD:
                    self.changeDinerToDead(chairIndex)
                elif status == self.HIDDEN:
                    self.changeDinerToHidden(chairIndex)

    def removeFoodModel(self, chairIndex):
        serviceLoc = self.serviceLocs.get(chairIndex)
        if serviceLoc:
            for i in xrange(serviceLoc.getNumChildren()):
                serviceLoc.getChild(0).removeNode()

    def changeDinerToEating(self, chairIndex):
        indicator = self.dinerStatusIndicators.get(chairIndex)
        eatingDuration = self.dinerInfo[chairIndex][1]
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:70,代码来源:DistributedBanquetTable.py


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