Unity-UI-Extensions/com.unity.uiextensions

occurs error using UILineConnector in prefab without Canvas

Closed this issue · 1 comments

Issue created by ysalpha as Bitbucket Issue #​392 on 2021.12.07 03:02.
If I prefab a GameObject with UILineConnector and UILineRenderer assigned to it, excluding Canvas, when I try to edit this prefab, I get 'Object reference not set to an instance of an object' error occurs and UILineConnector enable is turned off.

Since the Prefab is saved in this state It is difficult to notice that the UILineConnector enable is turned off, and When you actually see the canvas with the prefab in place, the line will not be drawn for some reason, causing a misunderstanding.

The reason why I'm using a prefab without a canvas is because
In the development stage, there are many times when I want to apply the line thickness and sprite to all UILineRenderer Objects.
So I want to keep UILineRenderer and UILineConnector as a prefab (has no Canvas).


On 2022.01.17 11:57, @SimonDarksideJ commented:
Well, controls should certainly be able to operate even when used in a prefab, so I will look in to this. In UI Components in a prefab, the Editor creates a “fake” canvas to ensure that references should still work.