mirror of
https://github.com/maxartz15/VertexAnimation.git
synced 2025-07-03 06:46:05 +02:00
Model Baker Updates
... Added fps to book data. Cleanup. Preparing LOD generation.
This commit is contained in:
47
Editor/Scripts/Editor/AssetDatabaseUtils.cs
Normal file
47
Editor/Scripts/Editor/AssetDatabaseUtils.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace TAO.VertexAnimation.Editor
|
||||
{
|
||||
public static class AssetDatabaseUtils
|
||||
{
|
||||
public static bool HasChildAsset(Object parent, Object child)
|
||||
{
|
||||
var assets = AssetDatabase.LoadAllAssetsAtPath(AssetDatabase.GetAssetPath(parent));
|
||||
|
||||
foreach (var a in assets)
|
||||
{
|
||||
if (a == child)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void RemoveChildAssets(Object parent, Object[] filter = null)
|
||||
{
|
||||
var assets = AssetDatabase.LoadAllAssetsAtPath(AssetDatabase.GetAssetPath(parent));
|
||||
|
||||
foreach (var a in assets)
|
||||
{
|
||||
bool filterSkip = false;
|
||||
|
||||
foreach (var f in filter)
|
||||
{
|
||||
if (a == f)
|
||||
{
|
||||
filterSkip = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!filterSkip && a != parent)
|
||||
{
|
||||
AssetDatabase.RemoveObjectFromAsset(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Editor/Scripts/Editor/AssetDatabaseUtils.cs.meta
Normal file
11
Editor/Scripts/Editor/AssetDatabaseUtils.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d394aa43ff9889d45878e965ac0f1a30
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -68,6 +68,7 @@ namespace TAO.VertexAnimation.Editor
|
||||
using (new EditorGUILayout.VerticalScope())
|
||||
{
|
||||
EditorGUILayout.LabelField("General", EditorStyles.centeredGreyMiniLabel);
|
||||
EditorGUILayout.PropertyField(editorData.FindPropertyRelative("fps"));
|
||||
EditorGUILayout.PropertyField(editorData.FindPropertyRelative("maxFrames"));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user