Split Editor and Runtime into separate namespaces, Created Texture and Mesh classes

This commit is contained in:
2025-01-13 20:28:06 +01:00
parent d1c734f078
commit 4c108f2ad6
8 changed files with 77 additions and 18 deletions

View File

@@ -1,19 +1,37 @@
using UnityEngine;
using UnityEditor;
using PSXSplash.Runtime;
using PSXSplash.RuntimeCode;
[CustomEditor(typeof(PSXObjectExporter))]
public class PSXObjectExporterEditor : Editor
namespace PSXSplash.EditorCode
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
DrawDefaultInspector();
PSXObjectExporter comp = (PSXObjectExporter)target;
if (GUILayout.Button("Export"))
[CustomEditor(typeof(PSXObjectExporter))]
public class PSXObjectExporterEditor : Editor
{
public override void OnInspectorGUI()
{
comp.Export();
PSXObjectExporter comp = (PSXObjectExporter)target;
serializedObject.Update();
EditorGUILayout.BeginVertical("box");
EditorGUILayout.PropertyField(serializedObject.FindProperty("Mesh"));
if (GUILayout.Button("Export mesh"))
{
comp.Mesh.Export();
}
EditorGUILayout.EndVertical();
EditorGUILayout.BeginVertical("box");
EditorGUILayout.PropertyField(serializedObject.FindProperty("Texture"));
if (GUILayout.Button("Export texture"))
{
comp.Texture.Export();
}
EditorGUILayout.EndVertical();
serializedObject.ApplyModifiedProperties();
}
}
}
}

View File

@@ -1,11 +1,10 @@
using UnityEngine;
using UnityEditor;
using PSXSplash.Runtime;
using PSXSplash.RuntimeCode;
[CustomEditor(typeof(PSXSceneExporter))]
public class PSXSceneExporterEditor : Editor {
public override void OnInspectorGUI() {
base.OnInspectorGUI();
DrawDefaultInspector();
PSXSceneExporter comp = (PSXSceneExporter)target;