.riv
file to a Unity project, simply drag it into the Project Window. Once dropped, a Rive Asset will be automatically created.
Now you can display the Rive Asset within a Rive Panel and Rive Widget or create a custom script using the low-level API to display the graphic.
Rive.File
contains Artboards, StateMachines, and Animations.
Rive.File
class also provides several methods to load Rive content into Unity:
Rive.File
from an imported .riv
asset in the inspector:
Rive.File
from a Unity TextAsset
. This is useful if you have the bytes bundled as a TextAsset
in the Unity project.
.riv
file, you can load it directly from a byte array. This method provides flexibility if you’re loading the file data from a custom source or dynamically (e.g. from a CDN-stored file):