From 80b5f697f2a569f82655ab05a109db3efea4696d Mon Sep 17 00:00:00 2001 From: max Date: Mon, 25 Jan 2021 21:42:08 +0100 Subject: [PATCH] Added debugging option. Turn on/off logs. --- .../Scripts/VA_AnimationLibraryComponentAuthoring.cs | 12 ++++++++++-- Runtime/Scripts/VA_AnimatorSystem.cs | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Runtime/Scripts/VA_AnimationLibraryComponentAuthoring.cs b/Runtime/Scripts/VA_AnimationLibraryComponentAuthoring.cs index 48ee9e7..8d8e355 100644 --- a/Runtime/Scripts/VA_AnimationLibraryComponentAuthoring.cs +++ b/Runtime/Scripts/VA_AnimationLibraryComponentAuthoring.cs @@ -8,6 +8,7 @@ namespace TAO.VertexAnimation public class VA_AnimationLibraryComponentAuthoring : UnityEngine.MonoBehaviour { public VA_AnimationLibrary animationLibrary; + public bool debugMode = false; } public class VA_AnimationLibraryConversionSystem : GameObjectConversionSystem @@ -34,7 +35,11 @@ namespace TAO.VertexAnimation { // Copy data. animationDataArray[i] = animationLib.animationLibrary.animationData[i]; - UnityEngine.Debug.Log("VA_AnimationLibrary added " + animationDataArray[i].name.ToString()); + + if (animationLib.debugMode) + { + UnityEngine.Debug.Log("VA_AnimationLibrary added " + animationDataArray[i].name.ToString()); + } } // Construct blob asset reference. @@ -45,7 +50,10 @@ namespace TAO.VertexAnimation // Add it to the asset store. BlobAssetStore.TryAdd(new Hash128(VA_AnimationLibraryUtils.AnimationLibraryAssetStoreName), animLibAssetRef); - UnityEngine.Debug.Log("VA_AnimationLibrary has " + animLibAssetRef.Value.animations.Length.ToString() + " animations."); + if (animationLib.debugMode) + { + UnityEngine.Debug.Log("VA_AnimationLibrary has " + animLibAssetRef.Value.animations.Length.ToString() + " animations."); + } } // Remove the entity since we don't need it anymore. diff --git a/Runtime/Scripts/VA_AnimatorSystem.cs b/Runtime/Scripts/VA_AnimatorSystem.cs index b1308fa..00f56a0 100644 --- a/Runtime/Scripts/VA_AnimatorSystem.cs +++ b/Runtime/Scripts/VA_AnimatorSystem.cs @@ -34,6 +34,7 @@ namespace TAO.VertexAnimation } }) .WithNativeDisableContainerSafetyRestriction(animationData) + .WithName("VA_AnimatorSystem") .ScheduleParallel(); } }