docs(unity): add RenderTextureImageSource docs#733
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
| @@ -0,0 +1,19 @@ | |||
| export const ExperimentalFeature = ({ defineSymbol = "RIVE_USING_EXPERIMENTAL", children }) => { | |||
There was a problem hiding this comment.
Nit pic - Does this need defineSymbol and children as props? Maybe you plan to use this in other scenarios?
Otherwise this can be just plain mdx.
|
|
||
| | Mode | Behavior | | ||
| | --- | --- | | ||
| | `PerFrame` | Rebuild and re-push every frame. Default. Use for live sources such as video or camera output. | |
|
|
||
| | Mode | Behavior | | ||
| | --- | --- | | ||
| | `Auto` | Apply orientation and color fixes when needed. Default. | |
There was a problem hiding this comment.
Pull request overview
Adds Unity documentation describing how to bind live RenderTexture sources to Rive view model image properties via RenderTextureImageSource, and introduces a reusable MDX warning component to flag Unity APIs gated behind RIVE_USING_EXPERIMENTAL.
Changes:
- Adds a new reusable
ExperimentalFeatureMDX snippet that renders an “Experimental Feature” warning and explains how to enableRIVE_USING_EXPERIMENTAL. - Expands the Unity Data Binding “Images” documentation with a new Render Textures section, including usage guidance, limitations, and lifecycle recommendations for
RenderTextureImageSource.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| snippets/experimental-feature.mdx | Introduces a reusable warning component for experimental Unity features guarded by a scripting define. |
| game-runtimes/unity/data-binding.mdx | Adds a new Render Textures documentation section and imports/uses the new ExperimentalFeature snippet. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import { ExperimentalFeature } from "/snippets/experimental-feature.mdx"; | ||
| import { YouTube } from "/snippets/youtube.mdx"; | ||
| import { Demos } from "/snippets/demos.jsx"; |
| ViewModelInstance viewModelInstance = riveWidget.StateMachine.ViewModelInstance; | ||
| if (viewModelInstance == null) | ||
| { | ||
| Debug.LogWarning("No ViewModelInstance on the widget."); | ||
| yield break; | ||
| } | ||
|
|
||
| ViewModelInstanceImageProperty imageProperty = | ||
| viewModelInstance.GetImageProperty(viewModelImagePath); | ||
| if (imageProperty == null) | ||
| { | ||
| Debug.LogWarning($"Image property '{viewModelImagePath}' not found."); | ||
| yield break; | ||
| } | ||
|
|
||
| imageProperty.SetFromRenderTextureImageSource(renderTextureSource); |
Adds documentation for binding live Unity RenderTextures to Rive view model image properties using
RenderTextureImageSource.The new Render Textures section lives in the Unity data binding docs under Images, after the existing
ImageOutOfBandAssetexample.Also adds a reusable
ExperimentalFeaturecomponent for Unity APIs gated behindRIVE_USING_EXPERIMENTAL.