Bug Fix: Blueprint overlapping

All blueprints now get deleted before when a new one gets created.
This commit is contained in:
DerTyp187
2021-09-27 11:07:41 +02:00
parent 05de734ecc
commit ed0c5cece6
3 changed files with 8 additions and 1 deletions

View File

@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 705507994} m_Sun: {fileID: 705507994}
m_IndirectSpecularColor: {r: 0.062805, g: 0.05929555, b: 0.058502227, a: 1} m_IndirectSpecularColor: {r: 0.2277222, g: 0.2251251, b: 0.2237271, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:

View File

@@ -19,6 +19,12 @@ public abstract class BuildingBlueprint : MonoBehaviour
private void Start() private void Start()
{ {
GameObject[] blueprints = GameObject.FindGameObjectsWithTag("Blueprint");
foreach (GameObject blueprint in blueprints)
GameObject.Destroy(blueprint);
gameObject.tag = "Blueprint";
terrain = GameObject.FindGameObjectWithTag("Terrain"); terrain = GameObject.FindGameObjectWithTag("Terrain");
Init(); Init();
} }

View File

@@ -8,6 +8,7 @@ TagManager:
- Event - Event
- Building - Building
- Terrain - Terrain
- Blueprint
layers: layers:
- Default - Default
- TransparentFX - TransparentFX