Git Product home page Git Product logo

Comments (5)

Frozenfire92 avatar Frozenfire92 commented on July 4, 2024

Hi Michael,

thanks for the feedback! I think this should be quite easy to do, I'm thinking the Unity File Debug prefab will get a reference to a UI Text component. If set it will append the output. Is this something like you were thinking?

from unity-file-debug.

michaelheiml avatar michaelheiml commented on July 4, 2024

Sounds good, maybe use a scroll view text rather than just a text component for a better overview/scrolling with a lot of Debug output.

from unity-file-debug.

Frozenfire92 avatar Frozenfire92 commented on July 4, 2024

After investigating this I think its outside of the scope of this repository. It can be very quick that a Scroll Rect / UI Text component fills up with logs and will start to error out like so

ArgumentException: Mesh can not have more than 65000 vertices
UnityEngine.UI.VertexHelper.FillMesh

and

String too long for TextMeshGenerator. Cutting off characters.
UnityEngine.Canvas:SendWillRenderCanvases()

A proper solution I would expect needs something like occlusion culling. One of the goals of this repository is to be small, and easy to understand and hack yourself. I think adding something like this in is only going to complicate things for most users. I will paste the code I did in an experiment incase you want to do this yourself (it was using Text on a Scroll Rect)

// UnityFileDebug/Lib/Logger/Scripts/UnityFileDebug.cs
using UnityEngine.UI;
...
public Text uiTextOutput;
...
Application.logMessageReceived += HandleLog;

if (uiTextOutput != null)
{
    uiTextOutput.text = "";
    Application.logMessageReceived += OutputLogToText;
}
...
void OutputLogToText(string logString, string stackTrack, LogType type)
{
    uiTextOutput.text += logString;
}
// UnityFileDebug/Lib/Logger/Editor/UnityFileDebugEditor.cs
...
SerializedProperty uiTextOutput;
GUIContent uiTextOutputContent;
...
uiTextOutputContent = new GUIContent
{
    text = "UI Text Output",
    tooltip = "Unity UI Text component"
};
...
uiTextOutput = serializedObject.FindProperty("uiTextOutput");
...
EditorGUILayout.PropertyField(uiTextOutput, uiTextOutputContent);

from unity-file-debug.

Frozenfire92 avatar Frozenfire92 commented on July 4, 2024

This may be relevant/help in displaying large amounts of logs https://bitbucket.org/Unity-Technologies/list-view-framework

from unity-file-debug.

Frozenfire92 avatar Frozenfire92 commented on July 4, 2024

also check out https://github.com/bbbscarter/UberLogger

from unity-file-debug.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.