/// <summary> /// Saves the values of all GlobalVariables in the list, mapped to the provided keys. /// </summary> /// <param name="writer">The ISaveSateWriter used for serialization.</param> public void Save(ISavestateWriter writer) { writer.PreSave(); foreach (var entry in entries) { if (entry.key != "") { try { entry.value.SaveValue(writer, entry.key); } catch (System.NotSupportedException) { Debug.LogError("Trying to save value for a GlobalVariable that does not support it."); } catch { Debug.LogError("Unspecified error while trying to save value for a GlobalVariable."); } } else { Debug.LogError("Trying to save Savestate with empty key."); } } writer.PostSave(); }
public override void SaveValue(ISavestateWriter writer, string key) { writer.SetFloat(key, value); }
public override void SaveValue(ISavestateWriter writer, string key) { writer.SetComposed(key, value.r, value.g, value.b, value.a); }
public override void SaveValue(ISavestateWriter writer, string key) { writer.SetComposed(key, value.x, value.y, value.z); }