Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Array of custom Struct not compiling

Discussion in 'Project Tiny' started by vincismurf, Dec 21, 2018.

  1. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    200
    I have a struct composed of an array of a custom enum (3 states) and a TileEnity. . . When I make a component for this struct it will compile as a single property but fails as an array

    IndexOutOfRangeException: Index was outside the bounds of the array.
    Unity.Tiny.TinyScriptedImporterEditorBase`2[TAssetImporterType,TRegistryObject].get_MainTinyGUID () (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/ScriptableObject/TinyScriptedImporterEditorBase.cs:22)
    Unity.Tiny.TinyScriptedImporterEditorBase`2[TAssetImporterType,TRegistryObject].GetMainEditableId () (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/ScriptableObject/TinyScriptedImporterEditorBase.cs:30)
    Unity.Tiny.TinyScriptedImporterEditorBase`2[TAssetImporterType,TRegistryObject].OnHeaderGUI () (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/ScriptableObject/TinyScriptedImporterEditorBase.cs:116)
    UnityEditor.Editor.DrawHeader () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:671)
    UnityEditor.InspectorWindow.DrawEditorLargeHeader (UnityEditor.Editor[] editors, System.Int32 editorIndex, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, UnityEditor.Editor editor, System.Boolean& wasVisible) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1536)
    UnityEditor.InspectorWindow.DrawEditorHeader (UnityEditor.Editor[] editors, System.Int32 editorIndex, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, UnityEditor.Editor editor, UnityEngine.Object target, System.Boolean& wasVisible) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1505)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, System.Int32 editorIndex, System.Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1433)
    UnityEditor.InspectorWindow.DrawEditors (UnityEditor.Editor[] editors) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1309)
    UnityEditor.InspectorWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:652)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:342)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:336)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:310)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean customBorder, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:363)
    UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:322)
    UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:244)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    AND

    GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
    Last edited: Dec 21, 2018