Exemple #1
0
        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();
                        }
                    }
                });
            }
        }
Exemple #2
0
 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);
             });
         }
     });
 }
Exemple #3
0
        void DrawCurrentFrame()
        {
            var min_frame_count = GetMinClipsFrameCount();

            if (min_frame_count > 1)
            {
                EditorGUILayout.IntSlider(
                    SwfEditorUtils.GetPropertyByName(serializedObject, "_currentFrame"),
                    0,
                    min_frame_count - 1,
                    "Current frame");
                DrawClipControls();
            }
        }
Exemple #4
0
        void DrawGUISettingsControls()
        {
            var prop = SwfEditorUtils.GetPropertyByName(serializedObject, "Overridden");

            if (prop.isExpanded)
            {
                GUILayout.BeginHorizontal();
                {
                    if (GUILayout.Button("Reconvert"))
                    {
                        ApplyAllOverriddenSettings();
                    }
                    GUILayout.FlexibleSpace();
                    var default_settings = GetSettingsHolder().Settings;
                    SwfEditorUtils.DoWithEnabledGUI(
                        _assets.Any(p => !p.Overridden.CheckEquals(default_settings)), () => {
                        if (GUILayout.Button("Default"))
                        {
                            AllOverriddenSettingsToDefault();
                        }
                    });
                    SwfEditorUtils.DoWithEnabledGUI(
                        _assets.Any(p => !p.Overridden.CheckEquals(p.Settings)), () => {
                        if (GUILayout.Button("Revert"))
                        {
                            RevertAllOverriddenSettings();
                        }
                        if (GUILayout.Button("Apply"))
                        {
                            ApplyAllOverriddenSettings();
                        }
                    });
                }
                GUILayout.EndHorizontal();
            }
        }