Added grid carving

This commit is contained in:
BOT Alex 2024-04-21 10:24:19 +02:00
parent 0d5f9f4803
commit 6241d237af
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: