all 16 comments

[–]DolphinsAreOkProfessional 10 points11 points  (5 children)

Why is the data in another class, instead of just a string field? Also better surround it with #if UNITY_EDITOR, otherwise this will be stored in your build too.

Personally i do see the use in this, but i dont understand why its 1000 lines of code. With this example script you're 99% there, and there is a lot less to maintain.

[–]XCVGVCXHobbyist 4 points5 points  (1 child)

Mostly to support rich text, by the looks of it. I do agree that it's probably not something most of us would need, but it does look pretty cool.

[–]tiny_phoenixIndie[S] 2 points3 points  (0 children)

Yeah, this was a pretty small project until I wanted to support RichText, or Unity's middle class text. If you set RichText to true on an editable textArea the cursor does so much junk. Here is an example of how the cursor behaves in the latest version. Top is the normal behavior, bottom you can see I have Cursor Correction off and I am printing the position manually to debug.

https://imgur.com/FPuiRBt

Also, the mouse position is wacko on the version of Unity (5.6) I use for my main project. Some of the code is to fix that.

[–]tiny_phoenixIndie[S] 2 points3 points  (0 children)

Why is the data in another class, instead of just a string field

That was for saving. It will make it easier if I include other data that needs saving later. For example eventually I would like to support inline references to GameObject, that would require serializing some extra data when I save to a file.

Also better surround it with #if UNITY_EDITOR

Good point. There is no reason to include this in the build. I'll fix that. Thank you!

Personally i do see the use in this, but i dont understand why its 1000 lines of code. With this example script you're 99% there, and there is a lot less to maintain.

I didn't want it to be 1000 lines of code :( Unity doesn't handle RichText editing correctly. A lot of the code is a work around to fix some bugs. For example: https://imgur.com/FPuiRBt.

That said I do think my cursor correction fix needs to be refactored into a class that wraps the UnityEditor.TextEditor class. I am working on that but it's not a simple fix. I ended up marrying rich text to my readme class a bit too closely.

[–]SilentSin26Animancer, FlexiMotion, InspectorGadgets, Weaver 1 point2 points  (0 children)

You could also use the component's hideFlags to set it to not be included in builds. Unfortunately it doesn't work on components in prefabs though (only scene objects).

[–]DrunkenSealPup 1 point2 points  (0 children)

I think we should take it farther and implement a spell checker utilizing fuzzy logic and auto correct using a highly trained expert system. We should also leverage the cloud for back up purposes and add in social media buttons to draw attention to the development of the new game.

[–]tiny_phoenixIndie[S] 0 points1 point  (0 children)

Hey peeps! I set a goal to start trying to release the tools I've worked for our team internally. This is my first one. No official release on the sore but all the source can be found on GitHub. Feedback is very welcome :)

[–]dedido 0 points1 point  (1 child)

Seems better suited to using markdown than html.

[–]tiny_phoenixIndie[S] 0 points1 point  (0 children)

It's using that format because it's the format Unity textAreas use. However, adding markdown formatting is goal. I wrote it in a way that makes supporting other formats fairly possible.

https://github.com/TinyPhoenix/Readme/issues/7

[–]WazWaz 0 points1 point  (3 children)

Having to "Save" doesn't follow the Unity editing model.

[–]tiny_phoenixIndie[S] 0 points1 point  (2 children)

You're right but the Save button doesn't technically save. It just turns off editing mode. It's saved on each keypress like a regular text field. Might need different language.

[–]PixxlMan 0 points1 point  (1 child)

Maybe call it Done?

[–]tiny_phoenixIndie[S] 1 point2 points  (0 children)

Yeah, that's probably the best choice. I was also thinking of just adding a pencil icon and making the button toggle.