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:
@@ -63,7 +63,7 @@ namespace Reset.Core.Tools{
|
|||||||
|
|
||||||
public static DebugOverlayDrawer Instance;
|
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
|
// Make sure the page exists. If it does, use it. If not, create it
|
||||||
GameObject thisPageObject = null;
|
GameObject thisPageObject = null;
|
||||||
bool alreadyExisted = false;
|
bool alreadyExisted = false;
|
||||||
@@ -134,7 +134,18 @@ namespace Reset.Core.Tools{
|
|||||||
|
|
||||||
// Publicly accessible method to change the value
|
// Publicly accessible method to change the value
|
||||||
public static void ChangeValue(string pageName, string sourceName, string newValue){
|
public static void ChangeValue(string pageName, string sourceName, string newValue){
|
||||||
|
try {
|
||||||
Instance.values[$"{pageName}/{sourceName}"].text = newValue;
|
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
|
// Publicly accessible method to change the color
|
||||||
|
|||||||
Reference in New Issue
Block a user