Pedro Gomes c2b076ff5a Bugfixing null references corner cases
- fixed possible null on show tooltip of consumable item that was just used.
- fixed an issue preventing all characters from being loaded on character list if one in between was pointing to a null reference in playerprefs
2024-08-05 00:40:08 +01:00

29 lines
788 B
C#

using System.Collections.Generic;
using UnityEngine;
namespace BgTools.PlayerPrefsEditor
{
[System.Serializable]
public class PreferenceEntryHolder : ScriptableObject
{
public List<PreferenceEntry> userDefList;
public List<PreferenceEntry> unityDefList;
private void OnEnable()
{
hideFlags = HideFlags.DontSave;
if (userDefList == null)
userDefList = new List<PreferenceEntry>();
if (unityDefList == null)
unityDefList = new List<PreferenceEntry>();
}
public void ClearLists()
{
if (userDefList != null)
userDefList.Clear();
if (unityDefList != null)
unityDefList.Clear();
}
}
}