diff --git a/plugins/unity/Assets/Samples/Runtime/SceneSwitcher.cs b/plugins/unity/Assets/Samples/Runtime/SceneSwitcher.cs index 963c0f2..cc5bdc3 100644 --- a/plugins/unity/Assets/Samples/Runtime/SceneSwitcher.cs +++ b/plugins/unity/Assets/Samples/Runtime/SceneSwitcher.cs @@ -16,7 +16,7 @@ private void OnGUI () private static Rect GetRectForSceneAt (int index) { - var yPos = Screen.height - (buttonHeight + buttonHeight * index); + var yPos = Screen.height - (buttonHeight + (buttonHeight * index)); return new Rect(0, yPos, buttonWidth, buttonHeight); } diff --git a/plugins/unity/Assets/SpriteDicing/Editor/Editors/AtlasBuilder.cs b/plugins/unity/Assets/SpriteDicing/Editor/Editors/AtlasBuilder.cs index 82b3354..36592a9 100644 --- a/plugins/unity/Assets/SpriteDicing/Editor/Editors/AtlasBuilder.cs +++ b/plugins/unity/Assets/SpriteDicing/Editor/Editors/AtlasBuilder.cs @@ -70,7 +70,7 @@ private SourceSprite[] CollectSourceSprites () AtlasPOT = ForcePot, PPU = PPU, Pivot = new Native.Pivot { X = DefaultPivot.x, Y = DefaultPivot.y }, - OnProgress = p => DisplayProgressBar(p.Activity, .25f + p.Ratio / 4) + OnProgress = p => DisplayProgressBar(p.Activity, .25f + (p.Ratio / 4)) }; private Texture2D[] ImportAtlases (IReadOnlyList atlases) @@ -85,7 +85,7 @@ private Texture2D[] ImportAtlases (IReadOnlyList atlases) var imported = new Texture2D[paths.Length]; for (int i = 0; i < paths.Length; i++) { - var progress = .5f + .25f * ((i + 1f) / paths.Length); + var progress = .5f + (.25f * ((i + 1f) / paths.Length)); DisplayProgressBar($"Importing atlases... ({i + 1} of {paths.Length})", progress); imported[i] = importer.Import(paths[i]); } @@ -128,7 +128,7 @@ private void BuildDicedSprites (IReadOnlyList diced, IReadOn var builder = new SpriteBuilder(PPU, atlases); for (int i = 0; i < diced.Count; i++) { - var progress = .75f + .25f * ((i + 1f) / diced.Count); + var progress = .75f + (.25f * ((i + 1f) / diced.Count)); DisplayProgressBar($"Building diced sprites... ({i + 1} of {diced.Count})", progress); sprites.Add(builder.Build(diced[i])); } diff --git a/plugins/unity/Assets/SpriteDicing/Editor/Native/Native.cs b/plugins/unity/Assets/SpriteDicing/Editor/Native/Native.cs index fc32bd5..aa43162 100644 --- a/plugins/unity/Assets/SpriteDicing/Editor/Native/Native.cs +++ b/plugins/unity/Assets/SpriteDicing/Editor/Native/Native.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.InteropServices; using UnityEngine.TestTools; @@ -9,6 +10,7 @@ namespace SpriteDicing /// /// Managed wrapper over native dicing library. /// + [SuppressMessage("ReSharper", "MemberHidesStaticFromOuterClass")] public static unsafe class Native { public readonly struct SourceSprite @@ -187,7 +189,7 @@ private struct CDicedSprite public CSlice uvs; public CSlice indices; public CRect rect; - public CPivot Pivot; + public CPivot pivot; } [StructLayout(LayoutKind.Sequential)] @@ -280,7 +282,7 @@ private static T[] MarshalSlice (CSlice c, List pts) for (long i = 0; i < (int)c.len; i++) { - var ins = new IntPtr(c.ptr.ToInt64() + i * size); + var ins = new IntPtr(c.ptr.ToInt64() + (i * size)); structs[i] = Marshal.PtrToStructure(ins); } @@ -326,7 +328,7 @@ private static CSlice MarshalSourceSprites (IEnumerable sources, L UVs = MarshalSlice(c.uvs, pts).Select(MarshalUV).ToArray(), Indices = MarshalIndices(c.indices), Rect = MarshalRect(c.rect), - Pivot = MarshalPivot(c.Pivot) + Pivot = MarshalPivot(c.pivot) }; private static DicedSprite[] MarshalDicedSprites (CSlice c, List pts)