(
ctx: &mut ScriptContext<'_, API>,
name: &str,
x: f32,
y: f32,
)
| 3957 | pub fn find_vec2_value(data: &SceneNodeData, field: &str) -> Option<Vector2> { |
| 3958 | for (name, value) in data.fields.iter() { |
| 3959 | if name.as_ref() == field { |
| 3960 | return match value { |
| 3961 | SceneValue::Vec2 { x, y } => Some(Vector2::new(*x, *y)), |
| 3962 | SceneValue::Vec3 { x, y, .. } => Some(Vector2::new(*x, *y)), |
| 3963 | _ => None, |
| 3964 | }; |
| 3965 | } |
| 3966 | } |
| 3967 | data.base_ref() |
| 3968 | .and_then(|base| find_vec2_value(base, field)) |
| 3969 | } |
| 3970 | |
| 3971 | pub fn find_vec3_value(data: &SceneNodeData, field: &str) -> Option<Vector3> { |
| 3972 | for (name, value) in data.fields.iter() { |
| 3973 | if name.as_ref() == field { |
no test coverage detected