本文整理汇总了Python中direct.distributed.DistributedNode.DistributedNode类的典型用法代码示例。如果您正苦于以下问题:Python DistributedNode类的具体用法?Python DistributedNode怎么用?Python DistributedNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DistributedNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, cr):
DistributedNode.__init__(self, cr)
NodePath.__init__(self, 'DistributedTunnel')
StagedObject.__init__(self, StagedObject.OFF)
self.uniqueId = ''
self.fakeZoneId = PiratesGlobals.FakeZoneId
self.GridLOD = { }
self.visNodes = { }
self.geom = None
self.envEffects = None
self._links = { }
self.areaWorldZone = [
None,
None]
self.areaNode = [
None,
None]
self._DistributedTunnel__loadedArea = None
self.areaIndexLoading = None
self.pendingAreaUnload = False
self.pendingArea = None
self.minimapObj = None
self.builder = GridAreaBuilder.GridAreaBuilder(self)
self.connectorNodes = [
'portal_connector_1',
'portal_connector_2']
self.connectorNodePosHpr = []
self.ambientNames = [
None,
None]
self.avatarZoneContext = None
self.floorIndex = -1
self._inTransition = False
self.ownHandles = []
示例2: __init__
def __init__(self, cr):
# you have to initialize NodePath.__init__() here because it is
# not called in DistributedNode.__init__()
DistributedNode.__init__(self, cr)
NodePath.__init__(self, 'player')
self.player = Player(os.getenv('COMPUTERNAME'))
示例3: delete
def delete(self):
if base.zoneLODTarget == self:
base.disableZoneLODs()
for trigger in self.spawnTriggers:
trigger.removeNode()
del self.spawnTriggers
del self.connectors
del self.links
if self.envEffects:
self.envEffects.delete()
self.envEffects = None
DistributedNode.delete(self)
if self.islandWaterParameters:
del self.islandWaterParameters
if self.swamp_water:
self.swamp_water.delete()
del self.swamp_water
if self.popupDialog:
self.popupDialog.destroy()
del self.popupDialog
self.connectorsHereCallback = None
示例4: __init__
def __init__(self, cr):
DistributedNode.__init__(self, cr)
NodePath.__init__(self, 'GameArea')
MappableArea.__init__(self)
StagedObject.__init__(self, StagedObject.OFF)
self.uniqueId = ''
self.geom = None
self.funnelDisplayName = None
self.previousDisplayName = None
self.gameFSM = None
self.links = []
self.pendingSetupConnector = { }
self.connectors = { }
self.connectorInterests = set()
self.envEffects = None
self.spawnTriggers = []
self.blockerColls = []
self.islandWaterParameters = None
self.swamp_water = None
self.entryTime = [
None,
0]
self.timeCheck = 0
self.minimap = None
self.footprintNode = None
self.popupDialog = None
self.minimapArea = 0
self.laMinimapObj = None
self.footstepSound = None
self.environment = None
self.connectorsHereCallback = None
示例5: announceGenerate
def announceGenerate(self):
base.loadingScreen.tick()
DistributedNode.announceGenerate(self)
base.worldCreator.registerSpecialNodes(self, self.uniqueId)
self.areaType = base.worldCreator.getFieldFromUid(self.uniqueId, 'Visibility')
self.envSettings = base.worldCreator.getEnvSettingsByUid(self.uniqueId)
self.builder = base.worldCreator.getBuilder(self, self.areaType)
示例6: disable
def disable(self):
""" This method is called when the object is removed from the
scene, for instance because it left the zone. It is balanced
against generate(): for each generate(), there will be a
corresponding disable(). Everything that was done in
generate() or announceGenerate() should be undone in disable().
After a disable(), the object might be cached in memory in case
it will eventually reappear. The DistributedObject should be
prepared to receive another generate() for an object that has
already received disable().
Note that the above is only strictly true for *cacheable*
objects. Most objects are, by default, non-cacheable; you
have to call obj.setCacheable(True) (usually in the
constructor) to make it cacheable. Until you do this, your
non-cacheable object will always receive a delete() whenever
it receives a disable(), and it will never be stored in a
cache.
"""
# Take it out of the scene graph.
self.detachNode()
DistributedNode.disable(self)
示例7: handleChildArrive
def handleChildArrive(self, childObj, zoneId):
DistributedNode.handleChildArrive(self, childObj, zoneId)
if childObj.isLocal():
base.loadingScreen.endStep('enterArea')
base.enableZoneLODs(self)
childObj.refreshActiveQuestStep()
localAvatar.guiMgr.setMinimap(self.minimap)
localAvatar.setAreaFootstep(self.footstepSound)
localAvatar.guiMgr.radarGui.showLocation(self.uniqueId)
envName = base.worldCreator.environmentTable.get(self.uniqueId)
if envName:
environmentID = TODGlobals.ENVIRONMENT_NAMES_TO_ID.get(envName, TODGlobals.ENV_DEFAULT)
envData = { }
envSettings = base.worldCreator.uidEnvSettings.get(self.uniqueId)
if envSettings != None:
envData = envSettings
base.cr.timeOfDayManager.setEnvironment(environmentID, envData)
else:
envData = None
envSettings = base.worldCreator.uidEnvSettings.get(self.uniqueId)
if envSettings != None:
envData = envSettings
base.cr.timeOfDayManager.setEnvironment(TODGlobals.ENV_INTERIOR, envData)
self.builder.arrived()
self.accept('transferMinimapObjects', self.transferMinimapObject)
if self.minimap and hasattr(childObj, 'getMinimapObject'):
if childObj.getMinimapObject():
self.laMinimapObj = childObj.getMinimapObject()
self.minimap.addObject(childObj.getMinimapObject())
示例8: announceGenerate
def announceGenerate(self):
DistributedNode.announceGenerate(self)
self.kart = loader.loadModel('phase_6/models/karting/Kart3_Final.bam')
self.kart.find('**/decals').removeNode()
self.kart.reparentTo(self)
self.pod = loader.loadModel('phase_4/models/minigames/pods_truck.egg')
self.pod.reparentTo(self)
self.pod.setScale(0.2)
self.pod.setY(8.5)
self.pod.setH(180)
self.rope = Rope()
self.rope.ropeNode.setUseVertexColor(1)
self.rope.setup(3, ({'node': self.kart,
'point': (0, 1.5, 0.7),
'color': (0, 0, 0, 1),
'thickness': 1000}, {'node': self.kart,
'point': (0, 1.5, 0.7),
'color': (0, 0, 0, 1),
'thickness': 1000}, {'node': self.pod,
'point': (0, 31, 5),
'color': (0, 0, 0, 1),
'thickness': 1000}), [])
self.rope.setH(180)
self.rope.reparentTo(self)
sphere = CollisionSphere(0, 0, 0, 2)
sphere.setTangible(0)
node = CollisionNode(self.uniqueName('truck_trigger'))
node.addSolid(sphere)
node.setCollideMask(CIGlobals.WallBitmask)
self.triggerNP = self.attachNewNode(node)
self.triggerNP.setPos(0, 8.0, 2.0)
self.setScale(2.0)
self.accept('enter' + self.triggerNP.node().getName(), self.__handleTruckTrigger)
示例9: announceGenerate
def announceGenerate(self):
DistributedNode.announceGenerate(self)
if self.cr.activeWorld == None or self.cr.activeWorld.getType() != PiratesGlobals.INSTANCE_PVP:
self.setupCollisions()
self.geom.hide(OTPRender.MainCameraBitmask)
self.geom.showThrough(OTPRender.EnviroCameraBitmask)
示例10: generate
def generate(self):
""" This method is called when the object is generated: when it
manifests for the first time on a particular client, or when it
is pulled out of the cache after a previous manifestation. At
the time of this call, the object has been created, but its
required fields have not yet been filled in. """
# Always call up to parent class
DistributedNode.generate(self)
示例11: __init__
def __init__(self, cr):
DistributedNode.__init__(self, cr)
# Let the derived classes instantiate the NodePath
self.visAvatar = None
self.gridVisContext = None
# Do we have grid lines visualized?
self._onOffState = False
if __debug__:
self.haveGridLines = 0
示例12: announceGenerate
def announceGenerate(self):
DistributedNode.announceGenerate(self)
self.reparentTo(render)
self.loadBarrel()
self.loadIcon()
self.loadCollisions()
self.accept(self.uniqueName('enterBarrelSphere'), self.__handleEnterSphere)
开发者ID:Toontown-Electrified,项目名称:src-feature-the-experiment,代码行数:9,代码来源:DistributedExperimentBarrel.py
示例13: disable
def disable(self):
if self.avatarInTurret:
self.avatarInTurret.getPart('legs').show()
self.avatarInTurret.getPart('torso').show()
self.avatarInTurret.getPart('head').show()
self.avatarInTurret = None
self.removeCannon()
DistributedNode.disable(self)
return
示例14: handleChildArriveZone
def handleChildArriveZone(self, child, zoneId):
DistributedNode.handleChildArrive(self, child, zoneId)
if (zoneId >= self.startingZone):
if not child.gridParent:
child.gridParent = GridParent(child)
child.gridParent.setGridParent(self, zoneId)
elif child.gridParent:
child.gridParent.delete()
child.gridParent = None
示例15: __init__
def __init__(self, cr):
DistributedNode.__init__(self, cr)
NodePath.__init__(self, 'shop')
self.cr = cr
self.items = {}
self.destroyEvent = 'destroyShop-' + str(random.randint(0, 1000))
self.inShop = False
self.clerk = None
self.shopNP = None
return