Better navmesh, Added icons, Added PSXPlayer component

This commit is contained in:
2025-04-07 17:47:48 +02:00
parent 9037937d3c
commit 93c50866f8
12 changed files with 434 additions and 24 deletions

30
Runtime/PSXPlayer.cs Normal file
View File

@@ -0,0 +1,30 @@
using UnityEngine;
using UnityEngine.AI;
namespace SplashEdit.RuntimeCode
{
public class PSXPlayer : MonoBehaviour
{
public float PlayerHeight;
[HideInInspector]
public Vector3 camPoint;
float maxDistance = 1000f;
public void FindNavmesh()
{
NavMeshHit hit;
if (NavMesh.SamplePosition(transform.position, out hit, maxDistance, NavMesh.AllAreas))
{
camPoint = hit.position + new Vector3(0, PlayerHeight, 0);
}
}
void OnDrawGizmos()
{
FindNavmesh();
Gizmos.color = Color.red;
Gizmos.DrawSphere(camPoint, 0.2f);
}
}
}