Search Unity

How to check Sizeof(MyClass) in unity4.5.and mono 4.0.1

Discussion in 'Scripting' started by Most_Incredible, Aug 9, 2014.

  1. Most_Incredible

    Most_Incredible

    Joined:
    Jan 25, 2012
    Posts:
    36
    Hi ,
    I was trying to find the sizeof(myclass) in unity,but i am unable to use Marshal.sizeof(myClass) in mono.
    so pls let me know is there a way to determine the sizof(myClass) in unity3d4.5

    Thanks in advance.
     
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
  3. DiRe

    DiRe

    Joined:
    Jun 14, 2013
    Posts:
    12
    You cant get size of object if you dont use unsafe coding (marshal)
    You can use a tool like:

    CLR Profiler
    VSTS Profiler
    .NET Memory Profiler
     
  4. Most_Incredible

    Most_Incredible

    Joined:
    Jan 25, 2012
    Posts:
    36
    @DiRe
    Thanks for the reply , I will look into it.
    Sorry for the late reply