mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2025-12-16 22:19:31 +07:00
little fixes
This commit is contained in:
@@ -67,6 +67,10 @@ namespace FlashTools.Internal {
|
|||||||
AllAssetsForeach(p => ApplyOverriddenSettings(p));
|
AllAssetsForeach(p => ApplyOverriddenSettings(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReconvertAllAsset() {
|
||||||
|
AllAssetsForeach(p => ReconvertAsset(p));
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@@ -96,7 +100,12 @@ namespace FlashTools.Internal {
|
|||||||
void DrawGUISettingsControls() {
|
void DrawGUISettingsControls() {
|
||||||
var prop = SwfEditorUtils.GetPropertyByName(serializedObject, "Overridden");
|
var prop = SwfEditorUtils.GetPropertyByName(serializedObject, "Overridden");
|
||||||
if ( prop.isExpanded ) {
|
if ( prop.isExpanded ) {
|
||||||
SwfEditorUtils.DoRightHorizontalGUI(() => {
|
GUILayout.BeginHorizontal();
|
||||||
|
{
|
||||||
|
if ( GUILayout.Button("Reconvert") ) {
|
||||||
|
ReconvertAllAsset();
|
||||||
|
}
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
var default_settings = GetDefaultSettings().Settings;
|
var default_settings = GetDefaultSettings().Settings;
|
||||||
SwfEditorUtils.DoWithEnabledGUI(
|
SwfEditorUtils.DoWithEnabledGUI(
|
||||||
_assets.Any(p => !p.Overridden.CheckEquals(default_settings)), () => {
|
_assets.Any(p => !p.Overridden.CheckEquals(default_settings)), () => {
|
||||||
@@ -113,7 +122,8 @@ namespace FlashTools.Internal {
|
|||||||
ApplyAllOverriddenSettings();
|
ApplyAllOverriddenSettings();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ namespace FlashTools.Internal {
|
|||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
static SwfAssetData ConfigureClips(SwfAsset asset, SwfAssetData data) {
|
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 ) {
|
foreach ( var symbol in data.Symbols ) {
|
||||||
ConfigureClip(asset, data, symbol);
|
ConfigureClip(asset, data, symbol);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,19 +76,11 @@ namespace FlashTools.Internal {
|
|||||||
return prop;
|
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 {
|
public static T LoadOrCreateAsset<T>(string asset_path, System.Action<T> act) where T : ScriptableObject {
|
||||||
var asset = AssetDatabase.LoadAssetAtPath<T>(asset_path);
|
var asset = AssetDatabase.LoadAssetAtPath<T>(asset_path);
|
||||||
if ( asset ) {
|
if ( asset ) {
|
||||||
act(asset);
|
act(asset);
|
||||||
|
EditorUtility.SetDirty(asset);
|
||||||
} else {
|
} else {
|
||||||
asset = ScriptableObject.CreateInstance<T>();
|
asset = ScriptableObject.CreateInstance<T>();
|
||||||
act(asset);
|
act(asset);
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace FlashTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public bool isStopped {
|
public bool isStopped {
|
||||||
get { return !isPlaying; }
|
get { return !_isPlaying; }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
|||||||
@@ -48,10 +48,12 @@ namespace FlashTools {
|
|||||||
|
|
||||||
public bool isPaused {
|
public bool isPaused {
|
||||||
get { return _isPaused; }
|
get { return _isPaused; }
|
||||||
|
set { _isPaused = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool isPlaying {
|
public bool isPlaying {
|
||||||
get { return !isPaused; }
|
get { return !_isPaused; }
|
||||||
|
set { _isPaused = !value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public float rateScale {
|
public float rateScale {
|
||||||
@@ -66,11 +68,11 @@ namespace FlashTools {
|
|||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
public void Pause() {
|
public void Pause() {
|
||||||
_isPaused = true;
|
isPaused = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Resume() {
|
public void Resume() {
|
||||||
_isPaused = false;
|
isPlaying = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PauseGroup(string group_name) {
|
public void PauseGroup(string group_name) {
|
||||||
@@ -172,7 +174,7 @@ namespace FlashTools {
|
|||||||
var group_name = ctrl.groupName;
|
var group_name = ctrl.groupName;
|
||||||
if ( string.IsNullOrEmpty(group_name) ) {
|
if ( string.IsNullOrEmpty(group_name) ) {
|
||||||
ctrl.InternalUpdate(dt);
|
ctrl.InternalUpdate(dt);
|
||||||
} else if ( !IsGroupPaused(group_name) ) {
|
} else if ( IsGroupPlaying(group_name) ) {
|
||||||
var group_rate_scale = GetGroupRateScale(group_name);
|
var group_rate_scale = GetGroupRateScale(group_name);
|
||||||
ctrl.InternalUpdate(group_rate_scale * dt);
|
ctrl.InternalUpdate(group_rate_scale * dt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<Properties StartupItem="Assembly-CSharp.csproj">
|
<Properties StartupItem="Assembly-CSharp.csproj">
|
||||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Unity.Instance.Unity Editor" />
|
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Unity.Instance.Unity Editor" />
|
||||||
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/FlashTools/Scripts/Internal/Editor/Postprocessors/SwfAssetPostprocessor.cs">
|
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/FlashTools/CHANGELOG.txt">
|
||||||
<Files>
|
<Files>
|
||||||
<File FileName="Assets/FlashTools/Scripts/Internal/Editor/Postprocessors/SwfAssetPostprocessor.cs" Line="160" Column="33" />
|
<File FileName="Assets/FlashTools/Scripts/Internal/Editor/Postprocessors/SwfPostprocessor.cs" Line="38" Column="25" />
|
||||||
<File FileName="Assets/FlashTools/Scripts/Internal/Editor/Editors/SwfAssetEditor.cs" Line="1" Column="1" />
|
<File FileName="Assets/FlashTools/Scripts/Internal/Editor/Postprocessors/SwfAssetPostprocessor.cs" Line="173" Column="17" />
|
||||||
|
<File FileName="Assets/FlashTools/Scripts/Internal/Editor/Tests/SwfUtilsTests.cs" Line="22" Column="3" />
|
||||||
|
<File FileName="Assets/FlashTools/Scripts/Internal/Editor/SwfEditorUtils.cs" Line="109" Column="40" />
|
||||||
|
<File FileName="Assets/FlashTools/Scripts/Internal/Editor/SwfPropertyDrawers.cs" Line="293" Column="2" />
|
||||||
|
<File FileName="Assets/FlashTools/CHANGELOG.txt" Line="7" Column="16" />
|
||||||
</Files>
|
</Files>
|
||||||
</MonoDevelop.Ide.Workbench>
|
</MonoDevelop.Ide.Workbench>
|
||||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||||
|
|||||||
Reference in New Issue
Block a user