

If you are interested in Mastering C# Structure here is a great article by mikejames Please let me know how I can solve the problem. Cause, i am handling structure in managed space. So how should I represent byte buffer into C# Structure When I can't determine size of Structure in run time ? Without using ? Another way around is providing size on my own. Result: failed, it returns 0 in Web Player. Public int yTop // Y-offset of highest point in room (world coordinates) (actually lowest value) Public int yBottom // Y-offset of lowest point in room (world coordinates) (actually highest value) Public int z // Z-offset of room (world coordinates) Public int x // X-offset of room (world coordinates) Lets see if that return expected result in web player. I want to know size of a C# structure through Marshal.SizeOf(). Then I am going check simple marshaling related code. That way I ensure there is no loose end behind.įirst I am going check simple IO operation in Web Player, like stream read, that will possibly succeed. I never investigate issues arbitrary way- investigate low level issue, test, if success go for higher level. When I know bottom level issues are not causing problem I will move to upper level issues in dependency. So I will follow my confidence hierarchy.

I am determining what causing Web Player stopping Marshaling structure. I have my own problem solving strategies.I am solving the problem bottom up. And intuitively you know it needs field information, for example field size and offset, to pick data for that field from byte buffer.ĭoes works in Unity Web Player? InteropService Marshaling do that picking for you whenever you want to represent a buffer into C# Structure. I'm not sure block data assignment is possible that way in C#. C# Structure members are stored along with member type information. C# structure is not represented that simply in memory.

Structure members are layid out sequentially and contiguously.But case is not same for C#. In C, casting byte buffer with required struct type would be enough. I am using Marshaling to convert byte buffer that lays out C Structure into C# Structure. I am going to upload my updated work demo. I thought 'Level Viewer ' would be more friendlier then 'Parser'. I titled this thread Tomb Raider Level Viewer Development In Unit圓D instead of 'Tomb Raider 2 Parser Development In Unit圓D'. I represented it to unit圓D animation curve.You can watch it in Original animation system was key frame based. I have represented model's skeletal transformation hierarchy in unit圓D. In original file models were not defined in complete mesh.Model parts are stored separately.They were rearranged procedurally using attached position and rotation information. I have used single texture to render every thing in the level.Which is way faster the original rendering process. Texture UV mapping was completely redone in Unity for vertex buffer support. I used vertex buffer instead of separate geometry commands.Original UV mapping was texture Id based.That would required lots of texture load/unload to render triangles. I converted it to modern data driven shader model. Tomb Raider's original rendering pipe line was fixed function. It parses Tomb Raider 2 level data like models, animation, textures.Then it renders them back in unit圓D. So far I have implemented following features: After some cleanups I have a plane to make it open source.Meanwhile creative feed backs are highly welcome

I will happily share my experience of this development. Which helped me to understand difference between managed and undamaged programing behavior.This cross platform level viewer can load any Tomb Raider II format file.It can play cut scene.It is able to export level / model in obj file. I represented Tomb Raider 2 data structure in C#. My intention was to learn Unit圓D rendering pipeline through comparative conversion of original Tomb Raider 2 rendering system.Which is mostly fixed function and procedural.It helped me to get deeper into mesh and animation representation structure of Unit圓D. I started developing Tomb Raider 2 level viewer as a hobby project.
