diff --git a/CustomKnight/DebugLogger.cs b/CustomKnight/DebugLogger.cs deleted file mode 100644 index 4343121..0000000 --- a/CustomKnight/DebugLogger.cs +++ /dev/null @@ -1,13 +0,0 @@ - -namespace CustomKnight -{ - public static class DebugLogger{ - public static bool enabled = false; - - internal static void Log(string s){ - if(enabled){ - CustomKnight.Instance.Log(s); - } - } - } -} \ No newline at end of file diff --git a/CustomKnight/Skin/Base/SelectableSkin.cs b/CustomKnight/Skin/Base/SelectableSkin.cs index 36d2df0..dad6948 100644 --- a/CustomKnight/Skin/Base/SelectableSkin.cs +++ b/CustomKnight/Skin/Base/SelectableSkin.cs @@ -138,7 +138,7 @@ public string GetCinematicUrl(string CinematicName){ if(File.Exists(file+".webm")){ path = file+".webm"; } - CustomKnight.Instance.Log("[getCine]"+CinematicName+":"+path); + CustomKnight.Instance.LogFine("[GetCinematicUrl]" + CinematicName+":"+path); return path; } diff --git a/CustomKnight/Skin/Base/Skinable.cs b/CustomKnight/Skin/Base/Skinable.cs index 67d0f04..4861f87 100644 --- a/CustomKnight/Skin/Base/Skinable.cs +++ b/CustomKnight/Skin/Base/Skinable.cs @@ -55,7 +55,7 @@ public virtual void prepare(){} /// Wrapper Method for SaveDefaultTexture, used for logging. /// public void SaveTexture(){ - DebugLogger.Log($"SaveTexture skinable {name}"); + CustomKnight.Instance.LogFine($"SaveTexture skinable {name}"); SaveDefaultTexture(); } @@ -63,7 +63,7 @@ public void SaveTexture(){ /// Wrapper Method for ApplyTexture, used for logging. /// public void Apply(){ - DebugLogger.Log($"Apply skinable {name}"); + CustomKnight.Instance.LogFine($"Apply skinable {name}"); ApplyTexture(ckTex.currentTexture); } @@ -71,7 +71,7 @@ public void Apply(){ /// Wrapper Method for ApplyTexture, used for Resetting the skin to default texture. /// public virtual void Reset(){ - DebugLogger.Log($"Reset skinable {name}"); + CustomKnight.Instance.LogFine($"Reset skinable {name}"); ApplyTexture(ckTex.defaultTex); } @@ -166,7 +166,7 @@ public override void ApplyTexture(Texture2D tex){ if(!ckTex.missing){ ApplySprite(Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f), ckTex.defaultSprite.pixelsPerUnit)); } else { - DebugLogger.Log($"Missing Sprite for skinable {name}"); + CustomKnight.Instance.Log($"Missing Sprite for skinable {name}"); Reset(); } } @@ -176,7 +176,7 @@ public override void ApplyTexture(Texture2D tex){ /// public abstract void ApplySprite(Sprite sprite); public override void Reset(){ - DebugLogger.Log($"Reset skinable {name}"); + CustomKnight.Instance.LogFine($"Reset skinable {name}"); ApplySprite(ckTex.defaultSprite); } } diff --git a/CustomKnight/Skin/Cinematics/CinematicsManager.cs b/CustomKnight/Skin/Cinematics/CinematicsManager.cs index 520281b..4d45900 100644 --- a/CustomKnight/Skin/Cinematics/CinematicsManager.cs +++ b/CustomKnight/Skin/Cinematics/CinematicsManager.cs @@ -116,7 +116,7 @@ public string GetCinematicUrl(string CinematicName){ if(File.Exists(file+".webm")){ path = file+".webm"; } - CustomKnight.Instance.Log("[getCine]"+CinematicName+":"+path); + CustomKnight.Instance.LogFine("[GetCinematicUrl]" + CinematicName+":"+path); return path; } diff --git a/CustomKnight/Skin/Swapper/DumpManager.cs b/CustomKnight/Skin/Swapper/DumpManager.cs index fbe6d57..14ee5a4 100644 --- a/CustomKnight/Skin/Swapper/DumpManager.cs +++ b/CustomKnight/Skin/Swapper/DumpManager.cs @@ -163,7 +163,7 @@ internal IEnumerator walkScenes(){ try{ AsyncOperation asyncLoad = loadScene(i); } catch(Exception e){ - Modding.Logger.Log($"error in dumpng scene {i} with {e.ToString()}"); + CustomKnight.Instance.Log($"Error in dumpng scene {i} with {e.ToString()}"); } yield return new WaitForSeconds(5); dumpAllSprites(); @@ -178,7 +178,7 @@ internal IEnumerator walkScenes(){ UnityEngine.SceneManagement.SceneManager.UnloadSceneAsync(i); } } catch(Exception e){ - Modding.Logger.Log($"error in dumpng scene {i} with {e.ToString()}"); + CustomKnight.Instance.Log($"error in dumpng scene {i} with {e.ToString()}"); } i++; } diff --git a/CustomKnight/Skin/Swapper/SwapManager.cs b/CustomKnight/Skin/Swapper/SwapManager.cs index 17f0f48..6e6baf5 100644 --- a/CustomKnight/Skin/Swapper/SwapManager.cs +++ b/CustomKnight/Skin/Swapper/SwapManager.cs @@ -140,7 +140,7 @@ private void SwapSkinForGo(string objectPath,GameObject GO){ if(anim != null || SpecialCases.childSpriteAnimatedByParent(objectPath)){ //maybe animated things can be replaced with a single sprite if(anim != null){ - CustomKnight.Instance.Log($"Animation : {anim.name}"); + this.LogFine($"Animation : {anim.name}"); } var behaviour = GO.GetAddComponent(); MaterialPropertyBlock block = new MaterialPropertyBlock(); @@ -152,7 +152,7 @@ private void SwapSkinForGo(string objectPath,GameObject GO){ } else { //currentSkinnedSceneObjs.Add(objectPath); re add sprites for a while //some sprites are still not perfectly matched - CustomKnight.Instance.Log($"game object : {sr.name} "); + this.LogFine($"game object : {sr.name} "); var pivot = new Vector2(0.5f, 0.5f); // this needs offset sometimes sr.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), pivot ,sr.sprite.pixelsPerUnit); //Log($"pivot post application {sr.sprite.pivot/new Vector2(tex.width, tex.height)}");