Remove broken culling code and fix flag switching

feature-multiSDF
Andrew Cassidy 4 years ago
parent b09695d602
commit 38ce1184ea

@ -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" />

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

@ -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));
} }
} }

@ -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() {
@ -618,7 +609,7 @@ namespace ConformalDecals {
public void Render(Camera camera) { public void Render(Camera camera) {
if (!_isAttached) return; if (!_isAttached) return;
// render on each target object // render on each target object
foreach (var target in _targets) { foreach (var target in _targets) {
target.Render(_decalMaterial, part.mpb, camera); target.Render(_decalMaterial, part.mpb, camera);

@ -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);
} }

Loading…
Cancel
Save