Git Product home page Git Product logo

cs-dumper's Introduction

Dumper for Unity (c#)

dump object.

public fields and public property

Ex

c# code

using UnityEngine;
using System;

using K.Debug;

// main
{
    TestClass putturnA = new TestClass();
    putturnA.pubpubStrA = "pubpubStrA-1";
    putturnA.SetPubpriStrB("pubpriStrB-2");
    putturnA.pubpubIntC = 1231;
    putturnA.SetPripriIntD(4562);
    putturnA.pubpubObjE = new TestClass();
    putturnA.pubpubObjE.pubpubStrA = "pubpubStrA-2";
    putturnA.pubpubDictF = new Dictionary<int, string>();
    putturnA.pubpubDictF.Add(19, "nineteen");
    putturnA.pubpubDictF.Add(17, "seventeen");
    putturnA.pubpubListG = new List<int>();
    putturnA.pubpubListG.Add(21);
    putturnA.pubpubListG.Add(33);
    
    Debug.Log(Dumper.Dump(putturnA));
}

public class TestClass
{
    public string pubpubStrA;
 
    public string pubpriStrB
    {
        get; private set;
    }
 
    public void SetPubpriStrB(string val)
    {
        pubpriStrB = val;
    }
 
    public int pubpubIntC;
 
    private int pripriIntD;

    public void SetPripriIntD(int val)
    {
        pripriIntD = val;
    }

    public TestClass pubpubObjE;

    public IDictionary pubpubDictF;

    public IList pubpubListG;

    public string pubFunc()
    {
        return "str:" + pubpubStrA;
    }

    public TestClass(){}

}
class Foo
{
    void Metod(Bar bar)
    {
        Debug.Log(Dumper.Dump(bar);
    }
}

log

TestClass (
    (String) pubpubStrA = "pubpubStrA-1";
    (Int32) pubpubIntC = 1231;
    (TestClass) pubpubObjE = TestClass (
        (String) pubpubStrA = "pubpubStrA-2";
        (Int32) pubpubIntC = 0;
        (TestClass) pubpubObjE = Null;
        (IDictionary) pubpubDictF = Null;
        (IList) pubpubListG = Null;
        (String) pubpriStrB = Null;
    );
    (IDictionary) pubpubDictF = Dictionary`2<Int32,String> {
        19 : "nineteen",
        17 : "seventeen",
    };
    (IList) pubpubListG = List`1<Int32> [
        21,
        33,
    ];
    (String) pubpriStrB = "pubpriStrB-2";
)

cs-dumper's People

Contributors

ken39arg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

progm

cs-dumper's Issues

Dumping enum type results in endless logging

(QuizType) Poll = QuizType (
                                (Int32) value__ = 1;
                                (QuizType) Quiz = QuizType (
                                    (Int32) value__ = 0;
                                    (QuizType) Quiz = QuizType (
                                        (Int32) value__ = 0;
                                        (QuizType) Quiz = QuizType (
                                            (Int32) value__ = 0;
                                            (QuizType) Quiz = QuizType ...;
                                            (QuizType) Poll = QuizType ...;
                                            (QuizType) Unknown = QuizType ...;
                                        );
                                        (QuizType) Poll = QuizType (
                                            (Int32) value__ = 1;
                                            (QuizType) Quiz = QuizType ...;
                                            (QuizType) Poll = QuizType ...;
                                            (QuizType) Unknown = QuizType ...;
                                        );
                                        (QuizType) Unknown = QuizType (
                                            (Int32) value__ = 2;
                                            (QuizType) Quiz = QuizType ...;
                                            (QuizType) Poll = QuizType ...;
                                            (QuizType) Unknown = QuizType ...;

When the variable is enum type, it seems like to dump out endlessly.
Enum in question is defined as

public enum QuizType
{
    Quiz,
    Poll,
    Unknown
}

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.