質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
C#

C#はマルチパラダイムプログラミング言語の1つで、命令形・宣言型・関数型・ジェネリック型・コンポーネント指向・オブジェクティブ指向のプログラミング開発すべてに対応しています。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

Q&A

解決済

2回答

1655閲覧

unity IndexOutOfRangeのエラーが出る

bur

総合スコア16

C#

C#はマルチパラダイムプログラミング言語の1つで、命令形・宣言型・関数型・ジェネリック型・コンポーネント指向・オブジェクティブ指向のプログラミング開発すべてに対応しています。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

0グッド

0クリップ

投稿2021/12/10 08:20

ゲームを再生していたところ,プレー途中で以下のようなエラーが得られました.
配列の定義域外を参照したことによるエラーであることは経験則から理解しましたが,該当の配列がおそらくデフォルトで存在しているものであると考えています.
unityの仕様について詳しくないのでこれらのエラーコードが意味しているところや原因,対処がわかりません

IndexOutOfRangeException: Index was outside the bounds of the array.
UnityEditor.ListViewShared.MultiSelection (UnityEditor.ListViewShared+InternalListViewState ilvState, System.Int32 prevSelected, System.Int32 currSelected, System.Int32& initialSelected, System.Boolean[]& selectedItems) (at <25e9afc147634a5ca855ab83fab425dd>:0)
UnityEditor.ListViewShared.MultiSelection (UnityEditor.ListViewShared+InternalListViewState ilvState, System.Int32 previousRow) (at <25e9afc147634a5ca855ab83fab425dd>:0)
UnityEditor.ListViewShared.SendKey (UnityEditor.ListViewShared+InternalListViewState ilvState, UnityEngine.KeyCode keyCode, System.Int32 totalCols) (at <25e9afc147634a5ca855ab83fab425dd>:0)
UnityEditor.ListViewShared.ListViewKeyboard (UnityEditor.ListViewShared+InternalListViewState ilvState, System.Int32 totalCols) (at <25e9afc147634a5ca855ab83fab425dd>:0)
UnityEditor.ListViewShared+ListViewElementsEnumerator.MoveNext () (at <25e9afc147634a5ca855ab83fab425dd>:0)
UnityEditor.ConsoleWindow.OnGUI () (at <25e9afc147634a5ca855ab83fab425dd>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <25e9afc147634a5ca855ab83fab425dd>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <25e9afc147634a5ca855ab83fab425dd>:0)
UnityEditor.DockArea.OldOnGUI () (at <25e9afc147634a5ca855ab83fab425dd>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.KeyboardEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <270875aa25744a3b8d4f4ee5dc922b56>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <6ddf8eac3856492ab1b8cf42618915cc>:0)

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

y_waiwai

2021/12/10 11:00

コードを提示しよう
guest

回答2

0

ベストアンサー

UnityEditor のエラーなので Unity 側の問題かもしれません。
恐らく下記の箇所で無効なインデックスにアクセスしてエラーになっているものと思われます。
https://github.com/Unity-Technologies/UnityCsReference/blob/2020.3/Editor/Mono/GUI/ListViewShared.cs#L250

事象が再現するようであればバグ報告か Unity Forum で質問(要英語)してみると良いかもしれません。
https://forum.unity.com/

投稿2021/12/11 10:50

cx20

総合スコア4633

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

google翻訳
IndexOutOfRangeException: インデックスが配列の範囲外だった。

とのことです

投稿2021/12/10 11:02

y_waiwai

総合スコア87747

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問