Remove broken culling code and fix flag switching

This commit is contained in:
Andrew Cassidy 2020-06-11 21:58:04 -07:00
parent 4ed65bdf4a
commit f0c5a112fe
No known key found for this signature in database
GPG Key ID: 963017B38FD477A1
6 changed files with 6 additions and 28 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:81553ade6fce5028845f7a6753471e5106dc4768f79a2d482fa03dd0cc8f5d42 oid sha256:7e601de8640b2b5019203d5c39452e10c804efa5d6f6631dea8787da3012927c
size 38400 size 38400

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() {
@ -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);

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