-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
To increase customization, I'd like to suggest a change to the currentType:
public int currentType
{
get => _currentType;
set
{
if (value > maxType) _currentType = 0;
else if(value < 0)_currentType = maxType;
else _currentType = value;
}
}
So we can go back and forth in the array.
I also incremented a change in InitChange and created its variation to return.
public void InitChangeAdd()
{
if (volumes == null) return;
currentType++;
PlayerPrefs.SetInt("Accessibility.ColorblindType", currentType);
StartCoroutine(ApplyFilter());
#if UNITY_EDITOR
// TODO: Use a public event system to announce the change of the activated filter
Debug.Log($"Color changed to <b>{(ColorblindTypes)currentType} {currentType}</b>/{maxType}");
#endif
}
public void InitChangeRemove()
{
if (volumes == null) return;
currentType--;
PlayerPrefs.SetInt("Accessibility.ColorblindType", currentType);
StartCoroutine(ApplyFilter());
#if UNITY_EDITOR
// TODO: Use a public event system to announce the change of the activated filter
Debug.Log($"Color changed to <b>{(ColorblindTypes)currentType} {currentType}</b>/{maxType}");
#endif
}
There is a way to simplify this in just one method, but for a while I ended up not doing it.
Thank you for developing this solution for color blindness!
Metadata
Metadata
Assignees
Labels
No labels