From 7105f08a3c29b2c3041668cf6c747dda8d8d201d Mon Sep 17 00:00:00 2001 From: drewcassidy Date: Sat, 6 Jun 2020 12:33:51 -0700 Subject: [PATCH] Some cleanup of debug statements --- .../MaterialModifiers/MaterialPropertyCollection.cs | 11 +---------- .../MaterialModifiers/MaterialTextureProperty.cs | 12 +++--------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/Source/ConformalDecals/MaterialModifiers/MaterialPropertyCollection.cs b/Source/ConformalDecals/MaterialModifiers/MaterialPropertyCollection.cs index 2e7ded1..764b0f9 100644 --- a/Source/ConformalDecals/MaterialModifiers/MaterialPropertyCollection.cs +++ b/Source/ConformalDecals/MaterialModifiers/MaterialPropertyCollection.cs @@ -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()}"); diff --git a/Source/ConformalDecals/MaterialModifiers/MaterialTextureProperty.cs b/Source/ConformalDecals/MaterialModifiers/MaterialTextureProperty.cs index 40ad668..8f6ad4e 100644 --- a/Source/ConformalDecals/MaterialModifiers/MaterialTextureProperty.cs +++ b/Source/ConformalDecals/MaterialModifiers/MaterialTextureProperty.cs @@ -16,15 +16,9 @@ namespace ConformalDecals.MaterialModifiers { public float AspectRatio { get { - if (texture == null) { - Debug.Log("Returning 1"); - return 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; }