From 63747c7f7ffcf3dd19d6079f702102e0d3329f77 Mon Sep 17 00:00:00 2001 From: nothke Date: Sat, 17 Aug 2024 13:08:28 +0200 Subject: [PATCH] Added texture preprocessor to enforce no filtering --- Assets/Scripts/Editor.meta | 8 ++++++++ Assets/Scripts/Editor/TexturePreprocessor.cs | 12 ++++++++++++ Assets/Scripts/Editor/TexturePreprocessor.cs.meta | 11 +++++++++++ Assets/Scripts/WeightDetector.cs | 8 ++++---- Assets/Textures/blockout_conveyor.png.meta | 2 +- 5 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 Assets/Scripts/Editor.meta create mode 100644 Assets/Scripts/Editor/TexturePreprocessor.cs create mode 100644 Assets/Scripts/Editor/TexturePreprocessor.cs.meta diff --git a/Assets/Scripts/Editor.meta b/Assets/Scripts/Editor.meta new file mode 100644 index 0000000..7713af6 --- /dev/null +++ b/Assets/Scripts/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 51fc89590d392e4458728c087b430687 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/TexturePreprocessor.cs b/Assets/Scripts/Editor/TexturePreprocessor.cs new file mode 100644 index 0000000..f020acf --- /dev/null +++ b/Assets/Scripts/Editor/TexturePreprocessor.cs @@ -0,0 +1,12 @@ +using UnityEngine; +using UnityEditor; + +class TexturePreprocessor : AssetPostprocessor +{ + void OnPreprocessTexture() + { + // if (assetPath.Contains("_bumpmap")) + TextureImporter textureImporter = (TextureImporter)assetImporter; + textureImporter.filterMode = FilterMode.Point; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Editor/TexturePreprocessor.cs.meta b/Assets/Scripts/Editor/TexturePreprocessor.cs.meta new file mode 100644 index 0000000..b9b86d1 --- /dev/null +++ b/Assets/Scripts/Editor/TexturePreprocessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d33006e1540e5a649b300c3c7954e1f3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/WeightDetector.cs b/Assets/Scripts/WeightDetector.cs index bb1a178..c131f29 100644 --- a/Assets/Scripts/WeightDetector.cs +++ b/Assets/Scripts/WeightDetector.cs @@ -37,8 +37,8 @@ public class WeightDetector : MonoBehaviour return totalMass; } - private void Update() - { - Debug.Log(GetTotalWeight()); - } + //private void Update() + //{ + // Debug.Log(GetTotalWeight()); + //} } diff --git a/Assets/Textures/blockout_conveyor.png.meta b/Assets/Textures/blockout_conveyor.png.meta index 452ce31..04b9729 100644 --- a/Assets/Textures/blockout_conveyor.png.meta +++ b/Assets/Textures/blockout_conveyor.png.meta @@ -34,7 +34,7 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: 1 + filterMode: 0 aniso: 1 mipBias: 0 wrapU: 0