Removed TOTU 103

This commit is contained in:
Ignacio Gómez Puga
2025-03-04 12:04:52 -06:00
commit 5847d844a5
675 changed files with 76582 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
using System.Collections.Generic;
using UnityEngine;
public class ObjectPlacementManager : MonoBehaviour
{
public LineManager lineManager; // Referencia al script LineManager
public GameObject myPrefab;
public void PlaceObject(Vector3 position)
{
if (!lineManager.IsPolygonClosed())
{
Debug.Log("No se puede colocar objetos: el pol<6F>gono no est<73> cerrado.");
FindObjectOfType<DebugLoggerUI>().AddMessage("No se puede colocar objetos: el pol<6F>gono no est<73> cerrado.");
return;
}
List<Vector3> polygon = lineManager.GetPolygonPoints();
Vector2 point2D = new Vector2(position.x, position.z);
if (!lineManager.IsPointInPolygon(point2D, polygon))
{
Debug.Log("El punto est<73> fuera del <20>rea permitida.");
FindObjectOfType<DebugLoggerUI>().AddMessage("El punto est<73> fuera del <20>rea permitida.");
return;
}
Instantiate(myPrefab, position, Quaternion.identity);
Debug.Log("Objeto colocado dentro del <20>rea.");
FindObjectOfType<DebugLoggerUI>().AddMessage("Objeto colocado dentro del <20>rea.");
}
}