//! Reads/Writes struct properties from/to a stream public override void Serialize(PropertyStream stream) { base.Serialize(stream); bool bLighting = stream.Serialize<bool>("Lighting"); SetFlag(E_Flag.MF_Lighting, bLighting); m_Color = stream.Serialize<Color>("Color"); m_Color.A = (byte)(stream.Serialize<float>("Alpha")*255.0f); stream.SerializeArray<string>("Textures", m_strTextures); for(int i=0; i<m_strTextures.Count; ++i) { if(m_strTextures[i].Length > 0) { // remove extension string path = m_strTextures[i].Split('.')[0]; m_aTextures[i] = Engine.Instance().Content.Load<Texture2D>(path); } else { m_aTextures[i] = null; } } }