Recursive calling of ObjectExporters from a SceneExporter, icons

This commit is contained in:
2025-01-13 19:59:41 +01:00
commit d1c734f078
23 changed files with 1105 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
using UnityEngine;
namespace PSXSplash.Runtime
{
public class PSXObjectExporter : MonoBehaviour
{
public void Export()
{
Debug.Log($"Export: {this.name}");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bea0f31a495202580ac77bd9fd6e99f2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: e11677149a517ca5186e32dfda3ec088, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,40 @@
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace PSXSplash.Runtime
{
public class PSXSceneExporter : MonoBehaviour
{
public void Export()
{
Debug.Log($"Exporting scene: {SceneManager.GetActiveScene().name}");
Scene activeScene = SceneManager.GetActiveScene();
foreach (GameObject obj in activeScene.GetRootGameObjects())
{
ExportAllPSXExporters(obj.transform);
}
}
void ExportAllPSXExporters(Transform parentTransform)
{
PSXObjectExporter exporter = parentTransform.GetComponent<PSXObjectExporter>();
if (exporter != null)
{
exporter.Export();
}
foreach (Transform child in parentTransform)
{
ExportAllPSXExporters(child);
}
}
void OnDrawGizmos()
{
Gizmos.DrawIcon(transform.position, "Packages/net.psxsplash.splashedit/Icons/PSXSceneExporter.png", true);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ab5195ad94fd173cfb6d48ee06eaf245
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: 0be7a2d4700082dbc83b9274837c70bc, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,14 @@
{
"name": "net.psxsplash.splashedit.Runtime",
"rootNamespace": "",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1afaf17520143848ea52af093808349d
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: