validate(definition:nodeResourceMapping:skeletonResource:)
Compiles an animation graph definition and returns any diagnostic messages the compiler produced, without producing a resource.
Declaration
static func validate(definition: Data, nodeResourceMapping: [Int : AnimationResource] = [:], skeletonResource: SkeletonResource) -> [String]Parameters
- definition:
The animation graph definition to validate.
- nodeResourceMapping:
A mapping from graph-node IDs to the Animationresource clips those nodes reference. Defaults to empty.
- skeletonResource:
The Skeletonresource the graph targets.
Return Value
An array of diagnostic messages produced by the compiler. An empty array indicates the definition compiled cleanly.
Discussion
Call this method to validate a definition at editor time without paying the cost of holding on to the compiled resource and without having to handle a thrown error. To produce a usable AnimationGraphResource, call init(definition:nodeResourceMapping:skeletonResource:) instead.