From 059561d68fb2fe485bc62096756a239bcfc7b5f1 Mon Sep 17 00:00:00 2001 From: Manuel Brea Date: Tue, 20 Feb 2024 22:57:50 +0000 Subject: [PATCH] Add missing serialization impl --- src/curves/color_point.rs | 3 ++- src/randomized_values/mod.rs | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/curves/color_point.rs b/src/curves/color_point.rs index f2f8693..58cc1a3 100644 --- a/src/curves/color_point.rs +++ b/src/curves/color_point.rs @@ -1,10 +1,11 @@ use bevy::{reflect::Reflect, render::color::Color}; +use serde::{Deserialize, Serialize}; use std::{ iter::Sum, ops::{Add, Deref, Mul, Sub}, }; -#[derive(Reflect, Default, Debug, Clone, PartialEq, Copy)] +#[derive(Reflect, Default, Debug, Clone, PartialEq, Copy, Serialize, Deserialize)] pub struct ColorPoint { pub color: Color, } diff --git a/src/randomized_values/mod.rs b/src/randomized_values/mod.rs index 1fedb4f..46293ca 100644 --- a/src/randomized_values/mod.rs +++ b/src/randomized_values/mod.rs @@ -1,4 +1,5 @@ use bevy::prelude::*; +use serde::{Deserialize, Serialize}; use std::f32::consts::PI; pub trait RandValue { @@ -8,7 +9,7 @@ pub trait RandValue { fn constant(value: Self::Out) -> Self; } -#[derive(Debug, Clone, Copy, Reflect, Default)] +#[derive(Debug, Clone, Copy, Reflect, Default, Serialize, Deserialize)] pub struct RandF32 { pub min: f32, pub max: f32, @@ -29,7 +30,7 @@ impl RandValue for RandF32 { } } -#[derive(Debug, Clone, Copy, Reflect)] +#[derive(Debug, Clone, Copy, Reflect, Serialize, Deserialize)] pub struct RandVec3 { pub magnitude: RandF32, pub direction: Vec3,