public void SetSaveDataValue(object value) { SaveDataBlock saveData = SaveData.GetByType(_saveDataType); if (saveData != null && value != null) { saveData.SetValue(_valueID, value); } }
public object CreateEditorValueInstance() { SaveDataBlock newData = CreateEditorSaveBlockInstance(); if (newData != null) { return(SerializedObjectMemberInfo.GetSerializedFieldInstance(newData, _valueID)); } return(null); }
public object GetSaveDataValue() { SaveDataBlock data = SaveData.GetByType(_saveDataType); if (data != null) { return(SerializedObjectMemberInfo.GetSerializedFieldInstance(data, _valueID)); } return(null); }
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); }