Is there a way to get lines that look exactly like Debug.DrawLine() in the game? I don’t want do use line-renderers, I want nice, simple, anti-aliased 1px lines. Oh and cheap to render, did I mention cheap?
Any ideas how to do that?
Is there a way to get lines that look exactly like Debug.DrawLine() in the game? I don’t want do use line-renderers, I want nice, simple, anti-aliased 1px lines. Oh and cheap to render, did I mention cheap?
Any ideas how to do that?
No that I know of :(.
BUT
If you have the Pro license, you can access to OpenGL functions and I know you can draw a line from OpenGL.
sadly I havent tried it and dont know for sure if it works
if you manage to do it, would be awesome if you post it on your blog! and here, as I’m following it :P.
Cheers!
As far as I know the GL functionality does not even work with Unity iPhone Advanced to its full (and the change log did not contain any information on that having changed with 1.5)
Debug.xxx as the name implies, is debug functionality, and won’t run on the release build.
also independent of what you do: you will not get antialiased lines, the iphone has no antialiasing.
Cheap can be achieved if you just use a single textured / colored quad for the line though which is and always has been possible.
thanks for the input you two!
yeah, I thought about building a Mesh at runtime that contains all the lines I want drawn, but it’s a bit of a pain to implement if I want all of them in the right place and at equal widths… I’d probably have to render a second orthographic camera on top of everything else… no fun…
Doing it in the GUI doesn’t seem to be a viable solution either, because each line would cost a drawcall… I might try that anyway though… at some point… if I can’t think of a better solution… maybe something without lines…
PS: I noticed that Gizmos don’t show in the Game window even if I turn the gizmos-button on (If it’s on I see Debug.DrawLine-stuff though). Is that how it’s supposed to be? because… you know… the button says “Gizmos” after all…
I use a line renderer for that sort of thing.
Gizmos are Editor functionality
I know. And I want to see them in the Game window inside the Editor. And I think I should be able to as I’m also able to see Debug.DrawLines and there’s a Gizmos button there… It’s off-topic, but I’d need it for a different reason: as stand-ins for objects that don’t have a mesh yet, but that you’re supposed to click on…
Debug is no editor functionality as such it works.
But Gizmos are.
Why don’t you just have a “dummy gameobject” that you use for such standins, potentially even one that offers exactly such a visualization?
should be a thing of a few minutes in a modeller: make arrow, clone twice, orient them along the axis and color them differently and store as 3DS, FBX, obj, collada and done
actually that’s exactly what I’m doing But I tried using Gizmos first and was confused that they don’t show in the Game window even though there seems to be a button for them…