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