rename refactor done

This commit is contained in:
2016-09-02 16:39:11 +07:00
parent 5d9bc9ee40
commit f56be1fbe9
4 changed files with 15 additions and 27 deletions

View File

@@ -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() {

View File

@@ -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();
}
}
}
}

View File

@@ -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;
}

View File

@@ -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