Some cleanup of debug statements

This commit is contained in:
Andrew Cassidy 2020-06-06 12:33:51 -07:00
parent e6372b2703
commit 7105f08a3c
No known key found for this signature in database
GPG Key ID: 963017B38FD477A1
2 changed files with 3 additions and 18 deletions

View File

@ -56,16 +56,7 @@ namespace ConformalDecals.MaterialModifiers {
} }
} }
public float AspectRatio { public float AspectRatio => MainTexture == null ? 1 : MainTexture.AspectRatio;
get {
if (MainTexture == null) {
Debug.Log("No main texture specified! returning 1 for aspect ratio");
return 1;
}
return MainTexture.AspectRatio;
}
}
public void OnBeforeSerialize() { public void OnBeforeSerialize() {
Debug.Log($"Serializing MaterialPropertyCollection {this.GetInstanceID()}"); Debug.Log($"Serializing MaterialPropertyCollection {this.GetInstanceID()}");

View File

@ -16,15 +16,9 @@ namespace ConformalDecals.MaterialModifiers {
public float AspectRatio { public float AspectRatio {
get { get {
if (texture == null) { if (texture == null) return 1;
Debug.Log("Returning 1");
return 1;
}
if (!_hasTile) { if (!_hasTile) return ((float) texture.height) / texture.width;
Debug.Log("Returning texture aspect ratio");
return ((float) texture.height) / ((float) texture.width);
}
return _tileRect.height / _tileRect.width; return _tileRect.height / _tileRect.width;
} }