A Unity package that merges PlayerScript and ItemScript callbacks from multiple input scripts in Cluster.
PSMerger allows you to combine multiple ItemScript or PlayerScript source files into a single script, enabling you to use multiple script functionalities simultaneously in Cluster.
onCollide()
onCommentReceived()
onExternalCallEnd()
onGetOwnProducts()
onGiftSent()
onGrab()
onInteract()
onPhysicsUpdate()
onPurchaseUpdated()
onReceive()
onRequestGrantProductResult()
onRequestPurchaseStatus()
onRide()
onStart()
onSteer()
onSteerAdditionalAxis()
onTextInput()
onUpdate()
onUse()
onButton()
onFrame()
onReceive()
OscHandle.onReceive()
Add the following to your Packages/manifest.json
:
{
"dependencies": {
"net.kaikoga.psmerger": "https://github.com/kaikoga/PSMerger-Unity.git"
}
}
Two modes are supported:
PlayerScriptMerger
or ItemScriptMerger
component to ScriptableItems to merge scripts in place.
PlayerScriptMerger
, ItemScript of the item is automatically set up to apply the merged PlayerScript to all players in the space.ClusterScriptAssetMerger
via Assets
-> Create
-> Silksprite
-> ClusterScriptAssetMerger
to merge scripts into a JavaScriptAsset.When using PSMerger, there are some behavioral differences from standard Cluster scripting:
ClusterScript.onReceive()
receives messages from both ItemHandle and PlayerHandle, regardless of the second parameterClusterScript.onPurchaseUpdated()
receives all subscribed purchases from all input scriptsUnityComponent.onClick()
registrations are not merged - only the last registration takes effectmeta
parameter to filter responsesnet.kaikoga.psmerger
Undefined
1.0.0
2021.3 or later
No dependencies
No legacy packages