mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2026-01-04 23:46:51 +07:00
little fixes
This commit is contained in:
@@ -67,6 +67,10 @@ namespace FlashTools.Internal {
|
||||
AllAssetsForeach(p => ApplyOverriddenSettings(p));
|
||||
}
|
||||
|
||||
void ReconvertAllAsset() {
|
||||
AllAssetsForeach(p => ReconvertAsset(p));
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -96,7 +100,12 @@ namespace FlashTools.Internal {
|
||||
void DrawGUISettingsControls() {
|
||||
var prop = SwfEditorUtils.GetPropertyByName(serializedObject, "Overridden");
|
||||
if ( prop.isExpanded ) {
|
||||
SwfEditorUtils.DoRightHorizontalGUI(() => {
|
||||
GUILayout.BeginHorizontal();
|
||||
{
|
||||
if ( GUILayout.Button("Reconvert") ) {
|
||||
ReconvertAllAsset();
|
||||
}
|
||||
GUILayout.FlexibleSpace();
|
||||
var default_settings = GetDefaultSettings().Settings;
|
||||
SwfEditorUtils.DoWithEnabledGUI(
|
||||
_assets.Any(p => !p.Overridden.CheckEquals(default_settings)), () => {
|
||||
@@ -113,7 +122,8 @@ namespace FlashTools.Internal {
|
||||
ApplyAllOverriddenSettings();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace FlashTools.Internal {
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
static SwfAssetData ConfigureClips(SwfAsset asset, SwfAssetData data) {
|
||||
asset.Clips = asset.Clips.Where(p => !!p).ToList();
|
||||
asset.Clips = asset.Clips.Where(p => !!p).Distinct().ToList();
|
||||
foreach ( var symbol in data.Symbols ) {
|
||||
ConfigureClip(asset, data, symbol);
|
||||
}
|
||||
|
||||
@@ -76,19 +76,11 @@ namespace FlashTools.Internal {
|
||||
return prop;
|
||||
}
|
||||
|
||||
public static void RemoveAllSubAssets(string asset_path) {
|
||||
var assets = AssetDatabase.LoadAllAssetsAtPath(asset_path);
|
||||
foreach ( var asset in assets ) {
|
||||
if ( !AssetDatabase.IsMainAsset(asset) ) {
|
||||
GameObject.DestroyImmediate(asset, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static T LoadOrCreateAsset<T>(string asset_path, System.Action<T> act) where T : ScriptableObject {
|
||||
var asset = AssetDatabase.LoadAssetAtPath<T>(asset_path);
|
||||
if ( asset ) {
|
||||
act(asset);
|
||||
EditorUtility.SetDirty(asset);
|
||||
} else {
|
||||
asset = ScriptableObject.CreateInstance<T>();
|
||||
act(asset);
|
||||
|
||||
Reference in New Issue
Block a user