Beispiel #1
0
            public void SetSaveDataValue(object value)
            {
                SaveDataBlock saveData = SaveData.GetByType(_saveDataType);

                if (saveData != null && value != null)
                {
                    saveData.SetValue(_valueID, value);
                }
            }
Beispiel #2
0
            public object CreateEditorValueInstance()
            {
                SaveDataBlock newData = CreateEditorSaveBlockInstance();

                if (newData != null)
                {
                    return(SerializedObjectMemberInfo.GetSerializedFieldInstance(newData, _valueID));
                }

                return(null);
            }
Beispiel #3
0
            public object GetSaveDataValue()
            {
                SaveDataBlock data = SaveData.GetByType(_saveDataType);

                if (data != null)
                {
                    return(SerializedObjectMemberInfo.GetSerializedFieldInstance(data, _valueID));
                }

                return(null);
            }
Beispiel #4
0
            public SaveDataBlock GetByType(Type type)
            {
                //Find existing blocks
                foreach (SaveDataBlock data in _dataBlocks)
                {
                    if (data.GetType() == type)
                    {
                        return(data);
                    }
                }

                //None found in save file, add new block and return it
                SaveDataBlock newData = Activator.CreateInstance(type) as SaveDataBlock;

                ArrayUtils.Add(ref _dataBlocks, newData);

                return(newData);
            }