feat: no longer need to manually create an overlay- attempting to change a value adds it. no longer Vector3 in creator

This commit is contained in:
Chris
2025-08-26 20:42:54 -04:00
parent 46dc94f1f8
commit 06bbc1e87f

View File

@@ -63,7 +63,7 @@ namespace Reset.Core.Tools{
public static DebugOverlayDrawer Instance;
public static void AddOnOverlay(string pageName, string sourceName, Vector3 position){
public static void AddOnOverlay(string pageName, string sourceName){
// Make sure the page exists. If it does, use it. If not, create it
GameObject thisPageObject = null;
bool alreadyExisted = false;
@@ -134,7 +134,18 @@ namespace Reset.Core.Tools{
// Publicly accessible method to change the value
public static void ChangeValue(string pageName, string sourceName, string newValue){
try {
Instance.values[$"{pageName}/{sourceName}"].text = newValue;
} catch (Exception e) {
try {
AddOnOverlay(pageName, sourceName);
Instance.values[$"{pageName}/{sourceName}"].text = newValue;
throw;
} catch (Exception exception) {
Debug.LogError($"Failed to both update an existing or create a new debug overlay: {exception.Message}" );
throw;
}
}
}
// Publicly accessible method to change the color