This package provides a solution for managing runtime anchors in Unity.
Runtime anchors is the primitive based on ScriptableObject, which helps us reference the Runtime (Game)Objects in the Unity Editor.
This is very useful in multi-scene projects, where you want to reference the objects between scenes without hassle. Also, it can be used to reference the runtime objects in other scriptable objects, like variables, events, scenarions, etc.
- Runtime Anchors - A set of ScriptableObjects that can be used to reference the runtime objects in the Unity Editor.
- Simply extendable the
RuntimeAnchorBase<T>
class to create your own anchor types, see examples in theGameObjectAnchor
folder.
- Simply extendable the
- Runtime Anchor References - A way to reference (Game)Objects using inlined reference or by using the (runtime) anchor reference.
- You can directly set the value in the Inspector or reference a runtime anchor.
- This makes flexible go to choice how to use the runtime anchors in your scripts.
- You can use the
AnchorReferenceBase<T>
class to create your own anchor references.
- Auto Anchor Provider - A component that will automatically set the (runtime) anchor reference to the GameObject it is attached to as soon as the
GameObject is instantiated.
- This is useful for automatically setting the anchor reference to the GameObject without having to manually initialize it in the code.
- You can extend the
AutoAnchorProviderBase
component to automatically set the anchor reference.
Install the package using npm scoped registry in Project Settings > Package Manager > Scoped Registries
{
"name": "NPM - xprees",
"url": "https://registry.npmjs.org",
"scopes": [
"cz.xprees",
"com.dbrizov.naughtyattributes"
]
}
Then simply install the package using the Unity Package Manager using the NPM - xprees scope or by the package name cz.xprees.runtime-anchors
.