Better navmesh, Added icons, Added PSXPlayer component
This commit is contained in:
31
Editor/PSXNavMeshEditor.cs
Normal file
31
Editor/PSXNavMeshEditor.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using SplashEdit.RuntimeCode;
|
||||
using System.Linq;
|
||||
|
||||
namespace SplashEdit.EditorCode
|
||||
{
|
||||
[CustomEditor(typeof(PSXNavMesh))]
|
||||
public class PSXNavMeshEditor : Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
DrawDefaultInspector();
|
||||
|
||||
PSXNavMesh comp = (PSXNavMesh)target;
|
||||
if (GUILayout.Button("Create preview"))
|
||||
{
|
||||
PSXSceneExporter exporter = FindObjectsByType<PSXSceneExporter>(FindObjectsSortMode.None).FirstOrDefault();
|
||||
if(exporter != null)
|
||||
{
|
||||
comp.CreateNavmesh(exporter.GTEScaling);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("No PSXSceneExporter found in the scene. We can't pull the GTE scaling from the exporter.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Editor/PSXNavMeshEditor.cs.meta
Normal file
2
Editor/PSXNavMeshEditor.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d3bd83aac4c3ce9ab1698a6a2bc735d
|
||||
Reference in New Issue
Block a user