Open all-iver opened 3 years ago
Same probelm.
Case 1 will works fail:
Case 2 will works fine:
Will the new version fix this problem? :(
Same probelm.
Case 1 will works fail:
1. Instantiate a shape prefab in a Canvas(with scale 0.01) 2. shape.SetPathWorldSegments 3. then path is wrong,It looks 100 times magnified.
Case 2 will works fine:
1. Instantiate a shape prefab in a Canvas(with scale 0.01) 2. StartCoroutine and wait a frame. 3. shape.SetPathWorldSegments 4. then path is right.
Will the new version fix this problem? :(
Hey @dyguests, I think that's actually a different issue - this one is about in-editor and yours is at runtime. I did a test and I can see your results. If you run shape.Configure() right after instantiating and before SetPathWorldSegments(), does that fix it? I think the problem is that Configure() usually gets run from Start() but it hasn't run yet when you're trying to edit it.
Edit - made a new issue for this (#18)
When editing a UI prefab in the scene, if you have a CanvasScaler or are using a ScreenSpace canvas with a Render Camera set, the shape's scale seems to be wrong in the prefab editing view. Using edit in isolation seems to do a bit better, and then you can provide a scene for Unity to use, but it's not a perfect solution. I believe Unity is using a world space canvas for prefab editing instead of using the canvas from the scene.