Hello!
I’m not sure if this is the forum I should be asking, but it feels like a quite basic question.
I need to develop a generic tree graphic of the decisions made by the player through the story.
By generic I mean that every node can have n childs, and nodes should be connected by a dotted line.
Nodes are also shown with a small screen capture.
I need some orientation to face this problem as I am not sure how to do it.
Thanks in advance!
Hmm, tricky.
Well, for drawing the lines and boxes on screen, @Senshi 's Primitive UI might be just the ticket. It’s not exactly easy to use, if you’re a complete beginner. But it certainly works.
If you mean to create a document of your graph, then you should look instead at writing out a DOT file. These are easy to create and there are a variety of apps that can read them. I’m not sure about including images on each node, though.
As for actually creating the images, Application.CaptureScreenshot is probably what you need.
HTH,
- Joe
Thanks a lot for the orientation. I have chosen to create my own tree structure.
My main problem right now is loading the screenshots. I’m not sure of the best way to do it. I’m using:
Application.CaptureScreenshot (Application.persistentDataPath + “/” + name + “.jpg”);
to create the screenshot.
How should I load it the fastest possible way? I’ve seen some codes using System.IO.File, but I doubt Unity hasn’t got an improved way to do it.
No, that’s it. System.IO.File to read the bytes, then pass them to Texture2D.LoadImage.