Migrating from 0.24 to 0.25
See the release notes for what’s new. Most important changes first.
Rust
Documentation tooling
ThroughTypeInfohas new variants:Function { params, returns }(FunctionOf),Literal(ByName) andData(a type derivingScriptData, with aScriptDataShapeofFieldsorUnion). In the LAD file, structs are referred to byLadTypeKind::Fieldsand enums byLadTypeKind::Val.LadFile::typesholdsLadTypes:LadType::Reference(Box<LadTypeDefinition>)for the types so far (serialized as before), andLadType::Data(LadDataType)forScriptDatatypes, whoseLadDataShapeisfieldsor aunionof kinds. Useget_reference_type/reference_typeswhere aLadTypeDefinitionwas expected.- New
LadTypeKind::Function { params, returns }andLadTypeKind::Literal: implementations ofArgumentVisitoraddvisit_functionandvisit_literal.
Functions
- Conversions moved from
functiontoconversions:function::{from, into, from_ref, into_ref}areconversions::{from, into, from_ref, into_ref}(FromScript,IntoScript,V,R,M,Union,FromScriptErased,IntoScriptErased). The crate root re-exports are unchanged, i.e.bevy_mod_scripting_bindings::V. ValueOf<M>isValueOf<M, R = ReflectReference>:ValueOf<A>is unchanged,newandinto_innertake and give theR.GetFunctionInfoimplementations providefunction_info(name, namespace), which needs no value.get_function_infocalls it.Union<T1, T2>only tries the types which could convert the value, seeFromScript::could_convert. When onlyT1could, the error isT1’s rather thanT2’s. Overridecould_convertin hand-writtenFromScriptimplementations to rule out the kinds of values they never convert.