////////////////////////////////////////////////////////////////////////// public void iSave(Serialization.SerializationInfoWrapper info) { // get all components, serialize thous fields var componentDataList = new List <ComponentData>(); var componentList = new List <Component>(); gameObject.GetComponents(componentList); foreach (var serializableComponent in componentList .Where(n => n is Serialization.IComponent == false && n is SerializableObject == false && n is UniqueIDComponent == false)) { var type = serializableComponent.GetType(); var data = new ComponentData() { m_Type = type.FullName }; componentDataList.Add(data); info.Prefix += type.FullName; foreach (var field in type.GetFields(BindingFlags.Public | BindingFlags.Instance)) { //field.Attributes SerializeField //field.IsNotSerialized data.m_FieldDictionary[field.Name] = field.GetValue(serializableComponent); } info.Prefix = info.Prefix.Remove(info.Prefix.Length - type.FullName.Length); } //componentDataList.Select(n => n.m_Type) info.AddValue("componentList", componentDataList); }
////////////////////////////////////////////////////////////////////////// public void iSave(Serialization.SerializationInfoWrapper info) { info.AddValue(c_KeyPosition, gameObject.transform.localPosition); info.AddValue(c_KeyRotation, gameObject.transform.localRotation); info.AddValue(c_KeyScale, gameObject.transform.localScale); }