Add most of research

This commit is contained in:
Bram verhulst
2025-05-31 15:54:23 +02:00
commit 70f128f092
270 changed files with 80847 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
using UnityEngine;
[ExecuteInEditMode]
public class AI_Area : MonoBehaviour
{
[Header("Area Settings")]
public Vector2 size = new Vector2(10f, 10f); // Width x Depth
public Color gizmoColor = new Color(0f, 1f, 0f, 0.25f);
public Vector3 GetRandomPointInArea()
{
float halfX = size.x / 2f;
float halfZ = size.y / 2f;
float randomX = Random.Range(-halfX, halfX);
float randomZ = Random.Range(-halfZ, halfZ);
Vector3 localOffset = new Vector3(randomX, 0f, randomZ);
return transform.position + transform.rotation * localOffset;
}
void OnDrawGizmos()
{
Gizmos.color = gizmoColor;
Matrix4x4 oldMatrix = Gizmos.matrix;
Gizmos.matrix = transform.localToWorldMatrix;
Gizmos.DrawCube(Vector3.zero, new Vector3(size.x, 0.01f, size.y));
Gizmos.matrix = oldMatrix;
Gizmos.color = Color.green;
Gizmos.DrawWireCube(transform.position, new Vector3(size.x, 0.01f, size.y));
}
}