mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2026-01-04 23:46:51 +07:00
rename refactor done
This commit is contained in:
@@ -106,19 +106,10 @@ namespace FlashTools.Internal {
|
||||
}
|
||||
|
||||
void DrawGUISettings() {
|
||||
SwfEditorUtils.DoWithEnabledGUI(false, () => {
|
||||
var clips_prop = SwfEditorUtils.GetPropertyByName(serializedObject, "Clips");
|
||||
if ( clips_prop.isArray ) {
|
||||
SwfEditorUtils.DoWithMixedValue(
|
||||
clips_prop.hasMultipleDifferentValues, () => {
|
||||
EditorGUILayout.IntField("Clips count", clips_prop.arraySize);
|
||||
});
|
||||
}
|
||||
});
|
||||
_settingsFoldout = EditorGUILayout.Foldout(_settingsFoldout, "Settings");
|
||||
if ( _settingsFoldout ) {
|
||||
var it = SwfEditorUtils.GetPropertyByName(serializedObject, "Overridden");
|
||||
while ( it.NextVisible(true) ) {
|
||||
while ( it.Next(true) ) {
|
||||
EditorGUILayout.PropertyField(it, true);
|
||||
}
|
||||
DrawGUISettingsControls();
|
||||
@@ -156,11 +147,8 @@ namespace FlashTools.Internal {
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
void OnEnable() {
|
||||
_assets = targets
|
||||
.OfType<SwfAsset>()
|
||||
.ToList();
|
||||
_settingsFoldout =
|
||||
_assets.Any(p => !p.Settings.CheckEquals(SwfSettings.GetDefault()));
|
||||
_assets = targets.OfType<SwfAsset>().ToList();
|
||||
_settingsFoldout = true;
|
||||
}
|
||||
|
||||
void OnDisable() {
|
||||
|
||||
@@ -87,17 +87,8 @@ namespace FlashTools.Internal {
|
||||
//
|
||||
//
|
||||
|
||||
void DrawGUIProperties() {
|
||||
void DrawGUISequences() {
|
||||
SwfEditorUtils.DoWithEnabledGUI(false, () => {
|
||||
var script_prop = SwfEditorUtils.GetPropertyByName(serializedObject, "m_Script");
|
||||
EditorGUILayout.PropertyField(script_prop, true);
|
||||
|
||||
var atlas_prop = SwfEditorUtils.GetPropertyByName(serializedObject, "Atlas");
|
||||
EditorGUILayout.PropertyField(atlas_prop, true);
|
||||
|
||||
var frame_rate_prop = SwfEditorUtils.GetPropertyByName(serializedObject, "FrameRate");
|
||||
EditorGUILayout.PropertyField(frame_rate_prop, true);
|
||||
|
||||
var sequences_prop = SwfEditorUtils.GetPropertyByName(serializedObject, "Sequences");
|
||||
if ( sequences_prop.isArray ) {
|
||||
SwfEditorUtils.DoWithMixedValue(
|
||||
@@ -134,8 +125,13 @@ namespace FlashTools.Internal {
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
DrawGUIProperties();
|
||||
serializedObject.Update();
|
||||
DrawDefaultInspector();
|
||||
DrawGUISequences();
|
||||
DrawGUIControls();
|
||||
if ( GUI.changed ) {
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@ namespace FlashTools.Internal.SwfEditorTools {
|
||||
|
||||
static SerializedProperty FindNextBoolProperty(SerializedProperty property, string next_prop) {
|
||||
var prop = property.Copy();
|
||||
while ( prop.NextVisible(false) ) {
|
||||
while ( prop.Next(false) ) {
|
||||
if ( prop.name == next_prop && prop.propertyType == SerializedPropertyType.Boolean ) {
|
||||
return prop;
|
||||
}
|
||||
|
||||
@@ -14,8 +14,12 @@ namespace FlashTools {
|
||||
public string Name = string.Empty;
|
||||
public List<Frame> Frames = new List<Frame>();
|
||||
}
|
||||
|
||||
[SwfReadOnly]
|
||||
public Texture2D Atlas;
|
||||
[SwfReadOnly]
|
||||
public float FrameRate;
|
||||
[HideInInspector]
|
||||
public List<Sequence> Sequences;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
||||
Reference in New Issue
Block a user