diff --git a/Source/Editor/CustomEditors/Dedicated/ClothEditor.cs b/Source/Editor/CustomEditors/Dedicated/ClothEditor.cs index c6043e8b6..4053c6e16 100644 --- a/Source/Editor/CustomEditors/Dedicated/ClothEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/ClothEditor.cs @@ -36,7 +36,7 @@ namespace FlaxEditor.CustomEditors.Dedicated return; var gizmos = gizmoOwner.Gizmos; _gizmoMode = new ClothPaintingGizmoMode(); - + var projectCache = Editor.Instance.ProjectCache; if (projectCache.TryGetCustomData("ClothGizmoPaintValue", out var cachedPaintValue)) _gizmoMode.PaintValue = JsonSerializer.Deserialize(cachedPaintValue); @@ -48,7 +48,7 @@ namespace FlaxEditor.CustomEditors.Dedicated _gizmoMode.BrushSize = JsonSerializer.Deserialize(cachedBrushSize); if (projectCache.TryGetCustomData("ClothGizmoBrushStrength", out var cachedBrushStrength)) _gizmoMode.BrushStrength = JsonSerializer.Deserialize(cachedBrushStrength); - + gizmos.AddMode(_gizmoMode); _prevMode = gizmos.ActiveMode; gizmos.ActiveMode = _gizmoMode; diff --git a/Source/Editor/Editor.cs b/Source/Editor/Editor.cs index 1b46222ea..b384b6515 100644 --- a/Source/Editor/Editor.cs +++ b/Source/Editor/Editor.cs @@ -364,7 +364,7 @@ namespace FlaxEditor { foreach (var preview in activePreviews) { - if (preview == loadingPreview || + if (preview == loadingPreview || (preview.Instance != null && (preview.Instance == control || preview.Instance.HasActorInHierarchy(control)))) { // Link it to the prefab preview to see it in the editor diff --git a/Source/Editor/GUI/AssetPicker.cs b/Source/Editor/GUI/AssetPicker.cs index 3e5d22eb0..8d6b0f9e2 100644 --- a/Source/Editor/GUI/AssetPicker.cs +++ b/Source/Editor/GUI/AssetPicker.cs @@ -482,8 +482,8 @@ namespace FlaxEditor.GUI Focus(); }); if (_selected != null) - { - var selectedAssetName = Path.GetFileNameWithoutExtension(_selected.Path); + { + var selectedAssetName = Path.GetFileNameWithoutExtension(_selected.Path); popup.ScrollToAndHighlightItemByName(selectedAssetName); } } diff --git a/Source/Editor/GUI/ContextMenu/ContextMenuChildMenu.cs b/Source/Editor/GUI/ContextMenu/ContextMenuChildMenu.cs index 7af36fae0..49a60a04e 100644 --- a/Source/Editor/GUI/ContextMenu/ContextMenuChildMenu.cs +++ b/Source/Editor/GUI/ContextMenu/ContextMenuChildMenu.cs @@ -72,7 +72,7 @@ namespace FlaxEditor.GUI.ContextMenu // Hide parent CM popups and set itself as child parentContextMenu.ShowChild(ContextMenu, PointToParent(ParentContextMenu, new Float2(Width, 0))); } - + /// public override bool OnMouseUp(Float2 location, MouseButton button) { diff --git a/Source/Editor/GUI/Dialogs/Dialog.cs b/Source/Editor/GUI/Dialogs/Dialog.cs index 07fc3ff0d..5054aee98 100644 --- a/Source/Editor/GUI/Dialogs/Dialog.cs +++ b/Source/Editor/GUI/Dialogs/Dialog.cs @@ -293,7 +293,7 @@ namespace FlaxEditor.GUI.Dialogs if (Root != null) { bool shiftDown = Root.GetKey(KeyboardKeys.Shift); - Root.Navigate(shiftDown ? NavDirection.Previous : NavDirection.Next); + Root.Navigate(shiftDown ? NavDirection.Previous : NavDirection.Next); } return true; } diff --git a/Source/Editor/GUI/Input/SearchBox.cs b/Source/Editor/GUI/Input/SearchBox.cs index 994ef14b1..73cfe55bf 100644 --- a/Source/Editor/GUI/Input/SearchBox.cs +++ b/Source/Editor/GUI/Input/SearchBox.cs @@ -20,7 +20,7 @@ namespace FlaxEditor.GUI.Input : this(false, 0, 0) { } - + /// /// Init search box /// @@ -28,7 +28,7 @@ namespace FlaxEditor.GUI.Input : base(isMultiline, x, y, width) { WatermarkText = "Search..."; - + ClearSearchButton = new Button { Parent = this, diff --git a/Source/Editor/GUI/Row.cs b/Source/Editor/GUI/Row.cs index b07d693e5..cb9cb09b2 100644 --- a/Source/Editor/GUI/Row.cs +++ b/Source/Editor/GUI/Row.cs @@ -241,7 +241,7 @@ namespace FlaxEditor.GUI { DoubleClick?.Invoke(); RowDoubleClick?.Invoke(this); - + return base.OnMouseDoubleClick(location, button); } diff --git a/Source/Editor/Modules/ContentEditingModule.cs b/Source/Editor/Modules/ContentEditingModule.cs index 1a8920916..f262864dd 100644 --- a/Source/Editor/Modules/ContentEditingModule.cs +++ b/Source/Editor/Modules/ContentEditingModule.cs @@ -104,7 +104,7 @@ namespace FlaxEditor.Modules hint = "Too long name."; return false; } - + if (item.IsFolder && shortName.EndsWith(".")) { hint = "Name cannot end with '.'"; diff --git a/Source/Editor/Modules/PrefabsModule.cs b/Source/Editor/Modules/PrefabsModule.cs index bb76e125b..adb5f7685 100644 --- a/Source/Editor/Modules/PrefabsModule.cs +++ b/Source/Editor/Modules/PrefabsModule.cs @@ -133,7 +133,7 @@ namespace FlaxEditor.Modules return; var actorsList = new List(); Utilities.Utils.GetActorsTree(actorsList, actor); - + var actions = new IUndoAction[actorsList.Count]; for (int i = 0; i < actorsList.Count; i++) actions[i] = BreakPrefabLinkAction.Linked(actorsList[i]); diff --git a/Source/Editor/Modules/SceneEditingModule.cs b/Source/Editor/Modules/SceneEditingModule.cs index 2b8bf718e..970ca8e99 100644 --- a/Source/Editor/Modules/SceneEditingModule.cs +++ b/Source/Editor/Modules/SceneEditingModule.cs @@ -453,7 +453,7 @@ namespace FlaxEditor.Modules { Editor.Windows.SceneWin.Focus(); } - + // fix scene window layout Editor.Windows.SceneWin.PerformLayout(); Editor.Windows.SceneWin.PerformLayout(); @@ -520,7 +520,7 @@ namespace FlaxEditor.Modules Undo.AddAction(new MultiUndoAction(pasteAction, selectAction)); OnSelectionChanged(); } - + // Scroll to new selected node while pasting Editor.Windows.SceneWin.ScrollToSelectedNode(); } @@ -620,7 +620,7 @@ namespace FlaxEditor.Modules Undo.AddAction(new MultiUndoAction(undoActions)); OnSelectionChanged(); } - + // Scroll to new selected node while duplicating Editor.Windows.SceneWin.ScrollToSelectedNode(); } diff --git a/Source/Editor/Modules/SceneModule.cs b/Source/Editor/Modules/SceneModule.cs index 257262585..7789eb7c4 100644 --- a/Source/Editor/Modules/SceneModule.cs +++ b/Source/Editor/Modules/SceneModule.cs @@ -332,7 +332,7 @@ namespace FlaxEditor.Modules continue; scenes.Add(s); } - + // In play-mode Editor mocks the level streaming script if (Editor.IsPlayMode) { diff --git a/Source/Editor/Modules/SourceCodeEditing/CodeEditingModule.cs b/Source/Editor/Modules/SourceCodeEditing/CodeEditingModule.cs index 4089f6d79..e9ff4c5b5 100644 --- a/Source/Editor/Modules/SourceCodeEditing/CodeEditingModule.cs +++ b/Source/Editor/Modules/SourceCodeEditing/CodeEditingModule.cs @@ -29,10 +29,10 @@ namespace FlaxEditor.Modules.SourceCodeEditing private static bool CheckFunc(ScriptType scriptType) { - if (scriptType.IsStatic || - scriptType.IsGenericType || - !scriptType.IsPublic || - scriptType.HasAttribute(typeof(HideInEditorAttribute), true) || + if (scriptType.IsStatic || + scriptType.IsGenericType || + !scriptType.IsPublic || + scriptType.HasAttribute(typeof(HideInEditorAttribute), true) || scriptType.HasAttribute(typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute), false)) return false; var managedType = TypeUtils.GetType(scriptType); diff --git a/Source/Editor/Modules/UIModule.cs b/Source/Editor/Modules/UIModule.cs index c882efb87..492d78918 100644 --- a/Source/Editor/Modules/UIModule.cs +++ b/Source/Editor/Modules/UIModule.cs @@ -299,7 +299,7 @@ namespace FlaxEditor.Modules else text = "Ready"; - if(ProgressVisible) + if (ProgressVisible) { color = Style.Current.Statusbar.Loading; } @@ -402,7 +402,7 @@ namespace FlaxEditor.Modules { UpdateStatusBar(); } - else if(ProgressVisible) + else if (ProgressVisible) { UpdateStatusBar(); } @@ -557,7 +557,7 @@ namespace FlaxEditor.Modules cm.AddButton("Game Settings", () => { var item = Editor.ContentDatabase.Find(GameSettings.GameSettingsAssetPath); - if(item != null) + if (item != null) Editor.ContentEditing.Open(item); }); diff --git a/Source/Editor/Progress/ProgressHandler.cs b/Source/Editor/Progress/ProgressHandler.cs index 2738b7c57..9581a0de6 100644 --- a/Source/Editor/Progress/ProgressHandler.cs +++ b/Source/Editor/Progress/ProgressHandler.cs @@ -16,7 +16,7 @@ namespace FlaxEditor.Progress /// /// The calling handler. public delegate void ProgressDelegate(ProgressHandler handler); - + /// /// Progress failed handler event delegate /// @@ -127,7 +127,7 @@ namespace FlaxEditor.Progress { if (!_isActive) throw new InvalidOperationException("Already ended."); - + _isActive = false; _progress = 0; _infoText = string.Empty; diff --git a/Source/Editor/Surface/Archetypes/Animation.cs b/Source/Editor/Surface/Archetypes/Animation.cs index 9bdb88054..a05ede1e7 100644 --- a/Source/Editor/Surface/Archetypes/Animation.cs +++ b/Source/Editor/Surface/Archetypes/Animation.cs @@ -78,7 +78,7 @@ namespace FlaxEditor.Surface.Archetypes { base.ConnectionTick(box); - if(box.ID != _assetBox.ID) + if (box.ID != _assetBox.ID) return; _assetSelect.Visible = !box.HasAnyConnection; diff --git a/Source/Editor/Surface/Archetypes/Parameters.cs b/Source/Editor/Surface/Archetypes/Parameters.cs index 3fe727840..6ed5a61e6 100644 --- a/Source/Editor/Surface/Archetypes/Parameters.cs +++ b/Source/Editor/Surface/Archetypes/Parameters.cs @@ -510,7 +510,7 @@ namespace FlaxEditor.Surface.Archetypes for (var i = 0; i < elements.Length; i++) { - if(elements[i].Type != NodeElementType.Output) + if (elements[i].Type != NodeElementType.Output) continue; if (VisjectSurface.FullCastCheck(elements[i].ConnectionsType, inputType, hint)) @@ -533,7 +533,7 @@ namespace FlaxEditor.Surface.Archetypes for (var i = 0; i < elements.Length; i++) { - if(elements[i].Type != NodeElementType.Input) + if (elements[i].Type != NodeElementType.Input) continue; if (VisjectSurface.FullCastCheck(elements[i].ConnectionsType, outputType, hint)) return true; @@ -725,7 +725,7 @@ namespace FlaxEditor.Surface.Archetypes /// protected override bool UseNormalMaps => false; - + internal new static bool IsOutputCompatible(NodeArchetype nodeArch, ScriptType inputType, ConnectionsHint hint, VisjectSurfaceContext context) { if (inputType == ScriptType.Object) @@ -743,7 +743,7 @@ namespace FlaxEditor.Surface.Archetypes for (var i = 0; i < elements.Length; i++) { - if(elements[i].Type != NodeElementType.Output) + if (elements[i].Type != NodeElementType.Output) continue; if (VisjectSurface.FullCastCheck(elements[i].ConnectionsType, inputType, hint)) return true; @@ -765,7 +765,7 @@ namespace FlaxEditor.Surface.Archetypes for (var i = 0; i < elements.Length; i++) { - if(elements[i].Type != NodeElementType.Input) + if (elements[i].Type != NodeElementType.Input) continue; if (VisjectSurface.FullCastCheck(elements[i].ConnectionsType, outputType, hint)) return true; @@ -789,7 +789,7 @@ namespace FlaxEditor.Surface.Archetypes /// protected override bool UseNormalMaps => false; - + internal new static bool IsOutputCompatible(NodeArchetype nodeArch, ScriptType inputType, ConnectionsHint hint, VisjectSurfaceContext context) { if (inputType == ScriptType.Object) @@ -987,7 +987,7 @@ namespace FlaxEditor.Surface.Archetypes _combobox.Width = Width - 50; } } - + internal static bool IsOutputCompatible(NodeArchetype nodeArch, ScriptType inputType, ConnectionsHint hint, VisjectSurfaceContext context) { return inputType == ScriptType.Void; @@ -997,7 +997,7 @@ namespace FlaxEditor.Surface.Archetypes { if (outputType == ScriptType.Void) return true; - + SurfaceParameter parameter = context.GetParameter((Guid)nodeArch.DefaultValues[0]); ScriptType type = parameter?.Type ?? ScriptType.Null; diff --git a/Source/Editor/Surface/VisjectSurface.Draw.cs b/Source/Editor/Surface/VisjectSurface.Draw.cs index f60f6ff3a..e7b76a538 100644 --- a/Source/Editor/Surface/VisjectSurface.Draw.cs +++ b/Source/Editor/Surface/VisjectSurface.Draw.cs @@ -141,7 +141,7 @@ namespace FlaxEditor.Surface if (_connectionInstigator is Archetypes.Tools.RerouteNode) { - if (endPos.X < startPos.X && _lastInstigatorUnderMouse is null or Box { IsOutput: true}) + if (endPos.X < startPos.X && _lastInstigatorUnderMouse is null or Box { IsOutput: true }) { actualStartPos = endPos; actualEndPos = startPos; diff --git a/Source/Editor/ViewportDebugDrawData.cs b/Source/Editor/ViewportDebugDrawData.cs index 48b551675..7fccd697f 100644 --- a/Source/Editor/ViewportDebugDrawData.cs +++ b/Source/Editor/ViewportDebugDrawData.cs @@ -97,7 +97,7 @@ namespace FlaxEditor if (_highlightMaterial == null || (_highlights.Count == 0 && _highlightTriangles.Count == 0) || renderContext.View.Pass == DrawPass.Depth - ) + ) return; Profiler.BeginEvent("ViewportDebugDrawData.OnDraw"); diff --git a/Source/Editor/Windows/Assets/PrefabWindow.Actions.cs b/Source/Editor/Windows/Assets/PrefabWindow.Actions.cs index 6de553a30..05b59b800 100644 --- a/Source/Editor/Windows/Assets/PrefabWindow.Actions.cs +++ b/Source/Editor/Windows/Assets/PrefabWindow.Actions.cs @@ -153,7 +153,7 @@ namespace FlaxEditor.Windows.Assets { OnPasteAction(pasteAction); } - + // Scroll to new selected node ScrollToSelectedNode(); } @@ -183,7 +183,7 @@ namespace FlaxEditor.Windows.Assets { OnPasteAction(pasteAction); } - + // Scroll to new selected node ScrollToSelectedNode(); } @@ -334,7 +334,7 @@ namespace FlaxEditor.Windows.Assets }, action2.ActionString); action.Do(); Undo.AddAction(action); - + _treePanel.PerformLayout(); _treePanel.PerformLayout(); } diff --git a/Source/Editor/Windows/Assets/PrefabWindow.cs b/Source/Editor/Windows/Assets/PrefabWindow.cs index 4deaf5d7d..4face0dc0 100644 --- a/Source/Editor/Windows/Assets/PrefabWindow.cs +++ b/Source/Editor/Windows/Assets/PrefabWindow.cs @@ -207,7 +207,7 @@ namespace FlaxEditor.Windows.Assets InputActions.Add(options => options.Rename, Rename); InputActions.Add(options => options.FocusSelection, _viewport.FocusSelection); } - + /// /// Enables or disables vertical and horizontal scrolling on the tree panel. /// @@ -257,7 +257,7 @@ namespace FlaxEditor.Windows.Assets { if (base.OnMouseUp(location, button)) return true; - + if (button == MouseButton.Right && _treePanel.ContainsPoint(ref location)) { _tree.Deselect(); diff --git a/Source/Editor/Windows/Profiler/Network.cs b/Source/Editor/Windows/Profiler/Network.cs index dbee0e8e7..78d84ad9d 100644 --- a/Source/Editor/Windows/Profiler/Network.cs +++ b/Source/Editor/Windows/Profiler/Network.cs @@ -128,7 +128,7 @@ namespace FlaxEditor.Windows.Profiler _tableRep.IsLayoutLocked = true; RecycleTableRows(_tableRpc, _tableRowsCache); RecycleTableRows(_tableRep, _tableRowsCache); - + var events = _events.Get(selectedFrame); var rowCount = Int2.Zero; if (events != null && events.Length != 0) @@ -186,7 +186,7 @@ namespace FlaxEditor.Windows.Profiler _tableRep.Visible = rowCount.Y != 0; _tableRpc.Children.Sort(SortRows); _tableRep.Children.Sort(SortRows); - + _tableRpc.UnlockChildrenRecursive(); _tableRpc.PerformLayout(); _tableRep.UnlockChildrenRecursive(); diff --git a/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp b/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp index 29288f658..a19b84370 100644 --- a/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp +++ b/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp @@ -530,7 +530,7 @@ void AnimGraphExecutor::UpdateStateTransitions(AnimGraphContext& context, const transitionData.Position = 0; transitionData.Length = ZeroTolerance; } - + const bool useDefaultRule = EnumHasAnyFlags(transition.Flags, AnimGraphStateTransition::FlagTypes::UseDefaultRule); if (transition.RuleGraph && !useDefaultRule) { @@ -765,10 +765,10 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu // Override animation when animation reference box is connected auto animationAssetBox = node->GetBox(8); - if(animationAssetBox->HasConnection()) + if (animationAssetBox->HasConnection()) { const Value assetBoxValue = tryGetValue(animationAssetBox, Value::Null); - if(assetBoxValue != Value::Null) + if (assetBoxValue != Value::Null) anim = (Animation*)assetBoxValue.AsAsset; else anim = nullptr;