def PrepareComponent(self, sceneID, entityID, component): if not self.actionTickManager: self.LogError( 'ActionTickManager was not present at zaction prepare component, things will now crash' ) if component.treeInstance is None: if self.entityService.IsClientSideOnly(sceneID): component.treeInstance = GameWorld.ActionTreeInstance( entityID, component.TreeInstanceID) else: component.treeInstance = GameWorld.ActionTreeInstanceClient( entityID, component.TreeInstanceID) component.rootNode = self.treeManager.GetTreeNodeByID(component.rootID) self.entityService.entitySceneManager.PrepareComponent( entityID, sceneID, component.treeInstance)
def PrepareComponent(self, sceneID, entityID, component): """ Gets called in order to prepare a component. No other components can be referred to We create the 'ActionTreeInstanceClient' object when we need client behavior with respect to the server. Otherwise, we can create a plain 'ActionTreeInstance' if, as with client side only scenes, there will be no client-server communication . """ if not self.actionTickManager: self.LogError( 'ActionTickManager was not present at zaction prepare component, things will now crash' ) if component.treeInstance is None: if self.entityService.IsClientSideOnly(sceneID): component.treeInstance = GameWorld.ActionTreeInstance( entityID, component.TreeInstanceID) else: component.treeInstance = GameWorld.ActionTreeInstanceClient( entityID, component.TreeInstanceID) component.rootNode = self.treeManager.GetTreeNodeByID(component.rootID) self.entityService.entitySceneManager.PrepareComponent( entityID, sceneID, component.treeInstance)