Remove broken culling code and fix flag switching

This commit is contained in:
Andrew Cassidy 2020-06-11 21:58:04 -07:00
parent b09695d602
commit 38ce1184ea
6 changed files with 5 additions and 27 deletions

View File

@ -51,7 +51,6 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="DecalBoundsBehaviour.cs" />
<Compile Include="DecalConfig.cs" /> <Compile Include="DecalConfig.cs" />
<Compile Include="DecalIconFixer.cs" /> <Compile Include="DecalIconFixer.cs" />
<Compile Include="DecalPropertyIDs.cs" /> <Compile Include="DecalPropertyIDs.cs" />

View File

@ -1,12 +0,0 @@
using System;
using UnityEngine;
namespace ConformalDecals {
public class DecalBoundsBehaviour : MonoBehaviour {
public ModuleConformalDecal decalRenderer;
private void OnWillRenderObject() {
decalRenderer._shouldRender = true;
}
}
}

View File

@ -58,8 +58,8 @@ namespace ConformalDecals.MaterialModifiers {
TextureUrl = node.GetValue("textureUrl"); TextureUrl = node.GetValue("textureUrl");
} }
if (node.HasValue("tileRect") && !autoTile) { if (node.HasValue("tile") && !autoTile) {
SetTile(ParsePropertyRect(node, "tileRect", true, _tileRect)); SetTile(ParsePropertyRect(node, "tile", true, _tileRect));
} }
} }

View File

@ -144,8 +144,6 @@ namespace ConformalDecals {
private Material _previewMaterial; private Material _previewMaterial;
private BoxCollider _boundsCollider; private BoxCollider _boundsCollider;
internal bool _shouldRender;
private int DecalQueue { private int DecalQueue {
get { get {
_decalQueueCounter++; _decalQueueCounter++;
@ -318,9 +316,6 @@ namespace ConformalDecals {
materialProperties.RenderQueue = DecalQueue; materialProperties.RenderQueue = DecalQueue;
var boundsBehaviour = decalBoundsTransform.gameObject.AddComponent<DecalBoundsBehaviour>();
boundsBehaviour.decalRenderer = this;
_boundsCollider = decalBoundsTransform.GetComponent<BoxCollider>(); _boundsCollider = decalBoundsTransform.GetComponent<BoxCollider>();
UpdateMaterials(); UpdateMaterials();
@ -439,10 +434,6 @@ namespace ConformalDecals {
UpdateScale(); UpdateScale();
} }
protected void Update() {
_shouldRender = false;
}
protected void UpdateScale() { protected void UpdateScale() {
var aspectRatio = materialProperties.AspectRatio; var aspectRatio = materialProperties.AspectRatio;
Vector2 size; Vector2 size;
@ -509,7 +500,7 @@ namespace ConformalDecals {
_decalMaterial = materialProperties.DecalMaterial; _decalMaterial = materialProperties.DecalMaterial;
_previewMaterial = materialProperties.PreviewMaterial; _previewMaterial = materialProperties.PreviewMaterial;
decalFrontTransform.GetComponent<MeshRenderer>().material = _previewMaterial; if (!_isAttached) decalFrontTransform.GetComponent<MeshRenderer>().material = _previewMaterial;
} }
protected void UpdateTargets() { protected void UpdateTargets() {

View File

@ -82,7 +82,7 @@ namespace ConformalDecals {
} }
private void OnEditorFlagSelected(string newFlagUrl) { private void OnEditorFlagSelected(string newFlagUrl) {
if (useCustomFlag) { if (!useCustomFlag) {
SetFlag(newFlagUrl); SetFlag(newFlagUrl);
SetFlagSymmetryCounterparts(newFlagUrl); SetFlagSymmetryCounterparts(newFlagUrl);
} }