-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruletiles #168
Comments
Investigation needed. NavMeshModifierTilemapEditor is not documented. This component still under integration into extensions system. |
Hello, I also encountered this issue. I solved it by making a custom tile class MyRuleTile that extends RuleTile and handles the scenario in which the tilemap is null: public class MyRuleTile : RuleTile
{
public override void GetTileData(Vector3Int position, ITilemap tilemap, ref TileData tileData)
{
if (tilemap == null)
{
tileData = new TileData();
tileData.sprite = m_DefaultSprite;
tileData.colliderType = m_DefaultColliderType;
tileData.gameObject = m_DefaultGameObject;
}
else
{
base.GetTileData(position, tilemap, ref tileData);
}
}
} |
Thx, I was investigating this issue, seems bug in Unity's package. But I maybe Ill find workaround. |
here the null parameter is passed as ITilemap to the method. Quick fix: `
` |
@FoolishEL can you make Merge Request? |
…Tile and other classes inherited from TileBase
will work with all types except those that do not have a preview method defined in the custom inspector |
…and other classes inherited from TileBase
Great job! |
Would it be possible to get Navigation Modifier Tilemap work with ruletiles?
This is the error I'm getting with ruletiles:
Error
NullReferenceException: Object reference not set to an instance of an object UnityEngine.RuleTile.RuleMatches (UnityEngine.RuleTile+TilingRule rule, UnityEngine.Vector3Int position, UnityEngine.Tilemaps.ITilemap tilemap, System.Int32 angle, System.Boolean mirrorX) (at ./Library/PackageCache/com.unity.2d.tilemap.extras@3.1.1/Runtime/Tiles/RuleTile/RuleTile.cs:774) UnityEngine.RuleTile.RuleMatches (UnityEngine.RuleTile+TilingRule rule, UnityEngine.Vector3Int position, UnityEngine.Tilemaps.ITilemap tilemap, UnityEngine.Matrix4x4& transform) (at ./Library/PackageCache/com.unity.2d.tilemap.extras@3.1.1/Runtime/Tiles/RuleTile/RuleTile.cs:614) UnityEngine.RuleTile.GetTileData (UnityEngine.Vector3Int position, UnityEngine.Tilemaps.ITilemap tilemap, UnityEngine.Tilemaps.TileData& tileData) (at ./Library/PackageCache/com.unity.2d.tilemap.extras@3.1.1/Runtime/Tiles/RuleTile/RuleTile.cs:420) NavMeshPlus.Editors.Components.NavMeshModifierTilemapEditor+TileModifierPropertyDrawer.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Assets/NavMeshComponents/Editor/NavMeshModifierTilemapEditor.cs:121) UnityEditor.PropertyDrawer.OnGUISafe (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at <35c0e5f206594d2fa707969117964d70>:0) UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at <35c0e5f206594d2fa707969117964d70>:0) UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <35c0e5f206594d2fa707969117964d70>:0) UnityEditorInternal.ReorderableList+Defaults.DrawElement (UnityEngine.Rect rect, UnityEditor.SerializedProperty element, System.Object listItem, System.Boolean selected, System.Boolean focused, System.Boolean draggable, System.Boolean editable) (at <35c0e5f206594d2fa707969117964d70>:0) UnityEditorInternal.ReorderableList.DoListElements (UnityEngine.Rect listRect, UnityEngine.Rect visibleRect) (at <35c0e5f206594d2fa707969117964d70>:0) UnityEditorInternal.ReorderableList.DoList (UnityEngine.Rect rect, UnityEngine.Rect visibleRect) (at <35c0e5f206594d2fa707969117964d70>:0) UnityEditorInternal.ReorderableListWrapper.DrawChildren (UnityEngine.Rect listRect, UnityEngine.Rect headerRect, UnityEngine.Rect sizeRect, UnityEngine.Rect visibleRect, UnityEngine.EventType previousEvent) (at <35c0e5f206594d2fa707969117964d70>:0) UnityEditorInternal.ReorderableListWrapper.Draw (UnityEngine.GUIContent label, UnityEngine.Rect r, UnityEngine.Rect visibleArea, System.String tooltip, System.Boolean includeChildren) (at <35c0e5f206594d2fa707969117964d70>:0) UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at <35c0e5f206594d2fa707969117964d70>:0) UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <35c0e5f206594d2fa707969117964d70>:0) UnityEditor.PropertyHandler.OnGUILayout (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <35c0e5f206594d2fa707969117964d70>:0) UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <35c0e5f206594d2fa707969117964d70>:0) UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUILayoutOption[] options) (at <35c0e5f206594d2fa707969117964d70>:0) NavMeshPlus.Editors.Components.NavMeshModifierTilemapEditor.OnInspectorGUI () (at Assets/NavMeshComponents/Editor/NavMeshModifierTilemapEditor.cs:33) UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.b__0 () (at <35c0e5f206594d2fa707969117964d70>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)The text was updated successfully, but these errors were encountered: