Model groups.

Added model group support, you can now have multiple meshes in one export.
Removed OBJ and mesh replace export options.
Mesh replace didn't work, might get added again in the feature.
OBJ needs to be rewritten as well to support the multiple meshes, and Unity now has model export options in engine.
Version 1.8.0+ is now only supports Unity2018.3+.
This commit is contained in:
max
2020-04-20 22:30:08 +02:00
parent 3532465e69
commit 8ff2db7e87
20 changed files with 469 additions and 453 deletions

View File

@ -0,0 +1,41 @@
//-
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace MA_Toolbox.Utils.Editor
{
public static class MA_PrefabUtils
{
public static string CreatePrefab(string prefabName, string savePath)
{
if(string.IsNullOrEmpty(prefabName) || string.IsNullOrWhiteSpace(prefabName))
{
Debug.LogError("Invalid prefab name.");
return null;
}
GameObject gameObject = new GameObject
{
name = prefabName
};
string assetPath = savePath + prefabName + ".prefab";
PrefabUtility.SaveAsPrefabAsset(gameObject, assetPath);
UnityEngine.Object.DestroyImmediate(gameObject);
return assetPath;
}
public static void AddChild(GameObject prefab, GameObject child)
{
GameObject p = PrefabUtility.InstantiatePrefab(prefab) as GameObject;
child.transform.SetParent(p.transform);
PrefabUtility.ApplyPrefabInstance(p, InteractionMode.AutomatedAction);
UnityEngine.Object.DestroyImmediate(p);
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 04e1a62b7d6bb434eb0314336ac94f8f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: