Compare commits

...

2 Commits

Author SHA1 Message Date
BOT Alex debe9b2184 Merge branch 'main' of https://gitea.deprived.dev/Sveskejuice/3DTD 2024-04-21 10:24:25 +02:00
BOT Alex 6241d237af Added grid carving 2024-04-21 10:24:19 +02:00
3 changed files with 1363 additions and 214 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public class SlotPathDeleter : MonoBehaviour
{
[SerializeField] private GridManager TargetCarveGrid;
private void Start()
{
Invoke(nameof(LateStart), 0.1f);
}
private void LateStart()
{
MeshCollider[] targets = TargetCarveGrid.SpawnedSlots.Select(x=>x.GetComponentInChildren<MeshCollider>()).ToArray();
BoxCollider[] colliders = GetComponentsInChildren<BoxCollider>();
for (int i = 0; i < colliders.Length; i++)
{
for (int j = 0; j < targets.Length; j++)
{
if (colliders[i].bounds.Intersects(targets[j].bounds))
{
Destroy(targets[j].gameObject);
}
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 37a80941383726449a76228f163f0a26
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: