void DrawCounts() { SwfEditorUtils.DoWithEnabledGUI(false, () => { EditorGUILayout.IntField( "Clip count", _manager.clipCount); EditorGUILayout.IntField( "Controller count", _manager.controllerCount); }); }
// // // 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); }); }); }
void DrawGroupControls() { var group_names = GetAllGroupNames(); if (group_names.Count > 0) { _groupsFoldout = EditorGUILayout.Foldout(_groupsFoldout, "Groups"); if (_groupsFoldout) { foreach (var group_name in group_names) { SwfEditorUtils.DoWithEnabledGUI(false, () => { EditorGUILayout.TextField("Name", group_name); }); { EditorGUI.BeginChangeCheck(); var new_rate_scale = EditorGUILayout.FloatField( "Rate Scale", _manager.GetGroupRateScale(group_name)); if (EditorGUI.EndChangeCheck()) { _manager.SetGroupRateScale(group_name, new_rate_scale); } } { EditorGUI.BeginChangeCheck(); var new_user_unscaled_dt = EditorGUILayout.Toggle( "Use Unscaled Dt", _manager.IsGroupUseUnscaledDt(group_name)); if (EditorGUI.EndChangeCheck()) { _manager.SetGroupUseUnscaledDt(group_name, new_user_unscaled_dt); } } SwfEditorUtils.DoRightHorizontalGUI(() => { if (_manager.IsGroupPaused(group_name) && GUILayout.Button("Resume")) { _manager.ResumeGroup(group_name); } if (_manager.IsGroupPlaying(group_name) && GUILayout.Button("Pause")) { _manager.PauseGroup(group_name); } }); } } } }
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(); } }