IndexOutOfRangeException in TextureInspector
"IndexOutOfRangeException: Array index is out of range. UnityEditor.TextureInspector.RenderStaticPreview (System.String assetPath, UnityEngine.Object[] subAssets, Int32 width, Int32 height) (at C:/buildslave/unity/build/Editor/Mono/Inspector/TextureInspector.cs:575) UnityEditor.AssetPreviewUpdater.CreatePreviewForAsset (UnityEngine.Object obj, UnityEngine.Object[] subAssets, System.String assetPath) (at C:/buildslave/unity/build/Editor/Mono/AssetPreviewUpdater.cs:33) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)"
This is the error message i get all the time coming from Unity (2017.1.1f1) after pressing the Play button.
oh yeah, this message aswell: "NullReferenceException: (null) UnityEditor.SerializedObject..ctor (UnityEngine.Object[] objs, UnityEngine.Object context) (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/SerializedObject.cs:26) UnityEditor.Editor.GetSerializedObjectInternal () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorBindings.gen.cs:193) UnityEditor.Editor.get_serializedObject () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorBindings.gen.cs:185) UnityEditor.TextureInspector.OnEnable () (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/Inspector/TextureInspector.cs:112)"
Answer by horotv · Sep 30, 2017 at 04:57 PM
Had the same problem. I fixed it by setting the "SpriteMode" of every Sprite in my Project to "Single" (even for the spritesheets) and then adjusting the settings back to "Multiple" and cropping the sprites again. After hitting play again the Problem was solved.
Your answer
Follow this Question
Related Questions
I Have an C# error and I can't fix it @username 1 Answer
Error stage @username 1 Answer
UI Sprite not changing when button is pressed 1 Answer
Survival Shooter Error CS0120 1 Answer
Script errors 1 Answer