Ejemplo n.º 1
0
        public override void WriteData(SerializedObject objSerializedObject)
        {
            base.WriteData(objSerializedObject);

            SerializedValueCollection objValues = objSerializedObject.Values;

            objValues.Add("FileName", FileName);
            objValues.Add("Directory", Directory);
        }
Ejemplo n.º 2
0
        public override void WriteData(SerializedObject objSerializedObject)
        {
            base.WriteData(objSerializedObject);

            if (_objItems.Count > 0)
            {
                SerializedObject objChildren = objSerializedObject.Objects.Add("Items");

                SerializedObjectCollection objObjects = objChildren.Objects;
                SerializedValueCollection  objValues  = objChildren.Values;

                SerializedValueType enuSerializedValueType = SerializedValueTypeHelper.GetTypeFromSystemType(typeof(TObjectType));
                foreach (TObjectType objChildItem in _objItems)
                {
                    if (enuSerializedValueType != SerializedValueType.Unknown)
                    {
                        objValues.Add("Item", objChildItem);
                    }
                    else if (objChildItem is ICustomSerializer)
                    {
                        objObjects.Add("Item", (ICustomSerializer)objChildItem);
                    }
                    else
                    {
                        objObjects.Add("Item", new SerializedWrapperObject(objChildItem));
                    }
                }
            }
        }