mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Remove broken culling code and fix flag switching
This commit is contained in:
parent
b09695d602
commit
38ce1184ea
Binary file not shown.
@ -51,7 +51,6 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DecalBoundsBehaviour.cs" />
|
||||
<Compile Include="DecalConfig.cs" />
|
||||
<Compile Include="DecalIconFixer.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");
|
||||
}
|
||||
|
||||
if (node.HasValue("tileRect") && !autoTile) {
|
||||
SetTile(ParsePropertyRect(node, "tileRect", true, _tileRect));
|
||||
if (node.HasValue("tile") && !autoTile) {
|
||||
SetTile(ParsePropertyRect(node, "tile", true, _tileRect));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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<DecalBoundsBehaviour>();
|
||||
boundsBehaviour.decalRenderer = this;
|
||||
|
||||
_boundsCollider = decalBoundsTransform.GetComponent<BoxCollider>();
|
||||
|
||||
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<MeshRenderer>().material = _previewMaterial;
|
||||
if (!_isAttached) decalFrontTransform.GetComponent<MeshRenderer>().material = _previewMaterial;
|
||||
}
|
||||
|
||||
protected void UpdateTargets() {
|
||||
|
@ -82,7 +82,7 @@ namespace ConformalDecals {
|
||||
}
|
||||
|
||||
private void OnEditorFlagSelected(string newFlagUrl) {
|
||||
if (useCustomFlag) {
|
||||
if (!useCustomFlag) {
|
||||
SetFlag(newFlagUrl);
|
||||
SetFlagSymmetryCounterparts(newFlagUrl);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user