void DrawSequence() { var all_sequences = GetAllSequences(true); if (all_sequences.Count > 0) { var sequence_prop = SwfEditorUtils.GetPropertyByName(serializedObject, "_sequence"); SwfEditorUtils.DoWithMixedValue( sequence_prop.hasMultipleDifferentValues, () => { var sequence_index = EditorGUILayout.Popup( "Sequence", sequence_prop.hasMultipleDifferentValues ? all_sequences.FindIndex(p => string.IsNullOrEmpty(p)) : all_sequences.FindIndex(p => p == sequence_prop.stringValue), all_sequences.ToArray()); if (sequence_index >= 0 && sequence_index < all_sequences.Count) { var new_sequence = all_sequences[sequence_index]; if (!string.IsNullOrEmpty(new_sequence)) { if (sequence_prop.hasMultipleDifferentValues) { sequence_prop.stringValue = string.Empty; } sequence_prop.stringValue = new_sequence; sequence_prop.serializedObject.ApplyModifiedProperties(); } } }); } }
// // // void DrawGUIFrameCount() { var counts = _clips.Select(p => GetFrameCount(p)); var mixed_value = counts.GroupBy(p => p).Count() > 1; SwfEditorUtils.DoWithEnabledGUI(false, () => { SwfEditorUtils.DoWithMixedValue( mixed_value, () => { EditorGUILayout.IntField("Frame count", counts.First()); }); }); }
void DrawGUISequences() { SwfEditorUtils.DoWithEnabledGUI(false, () => { var sequences_prop = SwfEditorUtils.GetPropertyByName( serializedObject, "Sequences"); if (sequences_prop.isArray) { SwfEditorUtils.DoWithMixedValue( sequences_prop.hasMultipleDifferentValues, () => { EditorGUILayout.IntField("Sequence count", sequences_prop.arraySize); }); } }); }
void DrawGUISourceAsset() { var asset_guids = _clips.Select(p => p.AssetGUID); var mixed_value = asset_guids.GroupBy(p => p).Count() > 1; SwfEditorUtils.DoWithEnabledGUI(false, () => { SwfEditorUtils.DoWithMixedValue( mixed_value, () => { var source_asset = AssetDatabase.LoadAssetAtPath <SwfAsset>( AssetDatabase.GUIDToAssetPath(asset_guids.First())); EditorGUILayout.ObjectField( "Source Asset", source_asset, typeof(SwfAsset), false); }); }); }