Spaces:
Sleeping
Sleeping
Update UnityProject/Assets/Editor/TestBuilder.cs
Browse files
UnityProject/Assets/Editor/TestBuilder.cs
CHANGED
|
@@ -12,9 +12,9 @@ public class TestBuilder
|
|
| 12 |
{
|
| 13 |
try
|
| 14 |
{
|
| 15 |
-
Debug.Log("🛠️ [UNITY] Memulai Rampingkan & Embed Prefab...");
|
| 16 |
|
| 17 |
-
// Scan prefab hasil ekstraksi Python di folder InputRaw
|
| 18 |
string[] prefabPaths = Directory.GetFiles("Assets/InputRaw", "*.prefab", SearchOption.AllDirectories);
|
| 19 |
|
| 20 |
foreach (string path in prefabPaths)
|
|
@@ -23,9 +23,7 @@ public class TestBuilder
|
|
| 23 |
if (go != null)
|
| 24 |
{
|
| 25 |
Debug.Log($"📦 Memadatkan Mesh ke Prefab: {path}");
|
| 26 |
-
// Proses perampingan & penanaman mesh ke dalam prefab (Embedding)
|
| 27 |
ProcessAndEmbed(go, path);
|
| 28 |
-
|
| 29 |
PrefabUtility.SaveAsPrefabAsset(go, path);
|
| 30 |
PrefabUtility.UnloadPrefabContents(go);
|
| 31 |
}
|
|
@@ -35,12 +33,12 @@ public class TestBuilder
|
|
| 35 |
AssetDatabase.Refresh();
|
| 36 |
|
| 37 |
// ==========================================
|
| 38 |
-
// PACKING RESMI ZEPETO SDK
|
| 39 |
// ==========================================
|
| 40 |
Debug.Log("🚀 [UNITY] Menjalankan ZepetoPackageCliBuilder...");
|
| 41 |
ZepetoPackageCliBuilder.BuildWithArgs();
|
| 42 |
|
| 43 |
-
Debug.Log("✅ [UNITY]
|
| 44 |
EditorApplication.Exit(0);
|
| 45 |
}
|
| 46 |
catch (Exception e)
|
|
@@ -67,7 +65,7 @@ public class TestBuilder
|
|
| 67 |
Mesh newMesh = simplifier.ToMesh();
|
| 68 |
newMesh.name = sourceMesh.name + "_Internal";
|
| 69 |
|
| 70 |
-
// PEMADATAN: Tanamkan data mesh ke dalam prefab asli
|
| 71 |
AssetDatabase.AddObjectToAsset(newMesh, assetPath);
|
| 72 |
|
| 73 |
if (ren is MeshRenderer) ren.GetComponent<MeshFilter>().sharedMesh = newMesh;
|
|
|
|
| 12 |
{
|
| 13 |
try
|
| 14 |
{
|
| 15 |
+
Debug.Log("🛠️ [UNITY] Memulai Proses Rampingkan & Embed Prefab...");
|
| 16 |
|
| 17 |
+
// Scan prefab hasil ekstraksi Python di folder Assets/InputRaw
|
| 18 |
string[] prefabPaths = Directory.GetFiles("Assets/InputRaw", "*.prefab", SearchOption.AllDirectories);
|
| 19 |
|
| 20 |
foreach (string path in prefabPaths)
|
|
|
|
| 23 |
if (go != null)
|
| 24 |
{
|
| 25 |
Debug.Log($"📦 Memadatkan Mesh ke Prefab: {path}");
|
|
|
|
| 26 |
ProcessAndEmbed(go, path);
|
|
|
|
| 27 |
PrefabUtility.SaveAsPrefabAsset(go, path);
|
| 28 |
PrefabUtility.UnloadPrefabContents(go);
|
| 29 |
}
|
|
|
|
| 33 |
AssetDatabase.Refresh();
|
| 34 |
|
| 35 |
// ==========================================
|
| 36 |
+
// PACKING RESMI ZEPETO SDK 1.22.1
|
| 37 |
// ==========================================
|
| 38 |
Debug.Log("🚀 [UNITY] Menjalankan ZepetoPackageCliBuilder...");
|
| 39 |
ZepetoPackageCliBuilder.BuildWithArgs();
|
| 40 |
|
| 41 |
+
Debug.Log("✅ [UNITY] Pengepakan Selesai.");
|
| 42 |
EditorApplication.Exit(0);
|
| 43 |
}
|
| 44 |
catch (Exception e)
|
|
|
|
| 65 |
Mesh newMesh = simplifier.ToMesh();
|
| 66 |
newMesh.name = sourceMesh.name + "_Internal";
|
| 67 |
|
| 68 |
+
// PEMADATAN: Tanamkan data mesh ke dalam prefab asli agar padat
|
| 69 |
AssetDatabase.AddObjectToAsset(newMesh, assetPath);
|
| 70 |
|
| 71 |
if (ren is MeshRenderer) ren.GetComponent<MeshFilter>().sharedMesh = newMesh;
|