diff --git a/Editor/PSXObjectExporterEditor.cs b/Editor/PSXObjectExporterEditor.cs index 7dbb41e..8b5d47d 100644 --- a/Editor/PSXObjectExporterEditor.cs +++ b/Editor/PSXObjectExporterEditor.cs @@ -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(); + } } -} +} \ No newline at end of file diff --git a/Editor/PSXSceneExporterEditor.cs b/Editor/PSXSceneExporterEditor.cs index bf6721a..459c60e 100644 --- a/Editor/PSXSceneExporterEditor.cs +++ b/Editor/PSXSceneExporterEditor.cs @@ -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; diff --git a/Runtime/PSXMesh.cs b/Runtime/PSXMesh.cs new file mode 100644 index 0000000..bd1c0fa --- /dev/null +++ b/Runtime/PSXMesh.cs @@ -0,0 +1,13 @@ +using UnityEngine; + +namespace PSXSplash.RuntimeCode { + + [System.Serializable] + public class PSXMesh { + public bool TriangulateMesh = true; + + public void Export() { + Debug.Log($"Export: {this}"); + } + } +} \ No newline at end of file diff --git a/Runtime/PSXMesh.cs.meta b/Runtime/PSXMesh.cs.meta new file mode 100644 index 0000000..b174097 --- /dev/null +++ b/Runtime/PSXMesh.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9025daa0c62549ee29d968f86c69eec9 \ No newline at end of file diff --git a/Runtime/PSXObjectExporter.cs b/Runtime/PSXObjectExporter.cs index 3809855..3bc681d 100644 --- a/Runtime/PSXObjectExporter.cs +++ b/Runtime/PSXObjectExporter.cs @@ -1,12 +1,16 @@ using UnityEngine; -namespace PSXSplash.Runtime +namespace PSXSplash.RuntimeCode { public class PSXObjectExporter : MonoBehaviour { + + public PSXMesh Mesh; + public PSXTexture Texture; + public void Export() { - Debug.Log($"Export: {this.name}"); + Debug.Log($"Export: {name}"); } } } diff --git a/Runtime/PSXSceneExporter.cs b/Runtime/PSXSceneExporter.cs index 28fbc5e..a2f8a46 100644 --- a/Runtime/PSXSceneExporter.cs +++ b/Runtime/PSXSceneExporter.cs @@ -1,10 +1,9 @@ -using UnityEditor; using UnityEngine; using UnityEngine.SceneManagement; -namespace PSXSplash.Runtime +namespace PSXSplash.RuntimeCode { - public class PSXSceneExporter : MonoBehaviour + public class PSXSceneExporter : MonoBehaviour { public void Export() { diff --git a/Runtime/PSXTexture.cs b/Runtime/PSXTexture.cs new file mode 100644 index 0000000..ea80062 --- /dev/null +++ b/Runtime/PSXTexture.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace PSXSplash.RuntimeCode { + public enum PSXTextureType { + TEX_4BPP, + + TEX_8BPP, + + TEX16_BPP + } + + [System.Serializable] + public class PSXTexture + { + public PSXTextureType TextureType; + public bool Dithering = true; + + public void Export() { + Debug.Log($"Export: {this}"); + } + } +} diff --git a/Runtime/PSXTexture.cs.meta b/Runtime/PSXTexture.cs.meta new file mode 100644 index 0000000..f5f3c69 --- /dev/null +++ b/Runtime/PSXTexture.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6d64b6bb75da33720b928203b2780952 \ No newline at end of file