diff --git a/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll b/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll index d26d9ad..60acaaf 100644 Binary files a/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll and b/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll differ diff --git a/Source/ConformalDecals/ConformalDecals.csproj b/Source/ConformalDecals/ConformalDecals.csproj index 01f2a01..912b4f8 100644 --- a/Source/ConformalDecals/ConformalDecals.csproj +++ b/Source/ConformalDecals/ConformalDecals.csproj @@ -51,7 +51,6 @@ - diff --git a/Source/ConformalDecals/DecalBoundsBehaviour.cs b/Source/ConformalDecals/DecalBoundsBehaviour.cs deleted file mode 100644 index 4b6cc0b..0000000 --- a/Source/ConformalDecals/DecalBoundsBehaviour.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using UnityEngine; - -namespace ConformalDecals { - public class DecalBoundsBehaviour : MonoBehaviour { - public ModuleConformalDecal decalRenderer; - - private void OnWillRenderObject() { - decalRenderer._shouldRender = true; - } - } -} \ No newline at end of file diff --git a/Source/ConformalDecals/MaterialModifiers/MaterialTextureProperty.cs b/Source/ConformalDecals/MaterialModifiers/MaterialTextureProperty.cs index 595e66c..e6004bb 100644 --- a/Source/ConformalDecals/MaterialModifiers/MaterialTextureProperty.cs +++ b/Source/ConformalDecals/MaterialModifiers/MaterialTextureProperty.cs @@ -58,8 +58,8 @@ namespace ConformalDecals.MaterialModifiers { TextureUrl = node.GetValue("textureUrl"); } - if (node.HasValue("tileRect") && !autoTile) { - SetTile(ParsePropertyRect(node, "tileRect", true, _tileRect)); + if (node.HasValue("tile") && !autoTile) { + SetTile(ParsePropertyRect(node, "tile", true, _tileRect)); } } diff --git a/Source/ConformalDecals/ModuleConformalDecal.cs b/Source/ConformalDecals/ModuleConformalDecal.cs index 04097b7..c85030c 100644 --- a/Source/ConformalDecals/ModuleConformalDecal.cs +++ b/Source/ConformalDecals/ModuleConformalDecal.cs @@ -144,8 +144,6 @@ namespace ConformalDecals { private Material _previewMaterial; private BoxCollider _boundsCollider; - internal bool _shouldRender; - private int DecalQueue { get { _decalQueueCounter++; @@ -318,9 +316,6 @@ namespace ConformalDecals { materialProperties.RenderQueue = DecalQueue; - var boundsBehaviour = decalBoundsTransform.gameObject.AddComponent(); - boundsBehaviour.decalRenderer = this; - _boundsCollider = decalBoundsTransform.GetComponent(); UpdateMaterials(); @@ -439,10 +434,6 @@ namespace ConformalDecals { UpdateScale(); } - protected void Update() { - _shouldRender = false; - } - protected void UpdateScale() { var aspectRatio = materialProperties.AspectRatio; Vector2 size; @@ -509,7 +500,7 @@ namespace ConformalDecals { _decalMaterial = materialProperties.DecalMaterial; _previewMaterial = materialProperties.PreviewMaterial; - decalFrontTransform.GetComponent().material = _previewMaterial; + if (!_isAttached) decalFrontTransform.GetComponent().material = _previewMaterial; } protected void UpdateTargets() { @@ -618,7 +609,7 @@ namespace ConformalDecals { public void Render(Camera camera) { if (!_isAttached) return; - + // render on each target object foreach (var target in _targets) { target.Render(_decalMaterial, part.mpb, camera); diff --git a/Source/ConformalDecals/ModuleConformalFlag.cs b/Source/ConformalDecals/ModuleConformalFlag.cs index 31f226f..d82ea41 100644 --- a/Source/ConformalDecals/ModuleConformalFlag.cs +++ b/Source/ConformalDecals/ModuleConformalFlag.cs @@ -82,7 +82,7 @@ namespace ConformalDecals { } private void OnEditorFlagSelected(string newFlagUrl) { - if (useCustomFlag) { + if (!useCustomFlag) { SetFlag(newFlagUrl); SetFlagSymmetryCounterparts(newFlagUrl); }