mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2025-12-15 12:29:49 +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);
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace FlashTools {
|
||||
}
|
||||
|
||||
public bool isStopped {
|
||||
get { return !isPlaying; }
|
||||
get { return !_isPlaying; }
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
@@ -48,10 +48,12 @@ namespace FlashTools {
|
||||
|
||||
public bool isPaused {
|
||||
get { return _isPaused; }
|
||||
set { _isPaused = value; }
|
||||
}
|
||||
|
||||
public bool isPlaying {
|
||||
get { return !isPaused; }
|
||||
get { return !_isPaused; }
|
||||
set { _isPaused = !value; }
|
||||
}
|
||||
|
||||
public float rateScale {
|
||||
@@ -66,11 +68,11 @@ namespace FlashTools {
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
public void Pause() {
|
||||
_isPaused = true;
|
||||
isPaused = true;
|
||||
}
|
||||
|
||||
public void Resume() {
|
||||
_isPaused = false;
|
||||
isPlaying = true;
|
||||
}
|
||||
|
||||
public void PauseGroup(string group_name) {
|
||||
@@ -172,7 +174,7 @@ namespace FlashTools {
|
||||
var group_name = ctrl.groupName;
|
||||
if ( string.IsNullOrEmpty(group_name) ) {
|
||||
ctrl.InternalUpdate(dt);
|
||||
} else if ( !IsGroupPaused(group_name) ) {
|
||||
} else if ( IsGroupPlaying(group_name) ) {
|
||||
var group_rate_scale = GetGroupRateScale(group_name);
|
||||
ctrl.InternalUpdate(group_rate_scale * dt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user