纳金网

标题: Flash-esque Event System for Unity part2,flash事件与unity3d事件的比较 [打印本页]

作者: 会飞的鱼    时间: 2011-12-20 14:57
标题: Flash-esque Event System for Unity part2,flash事件与unity3d事件的比较
Flash-esque Event System for Unity part2,flash事件与unity3d事件的比较-第二部分


I posted about this back in November and I just have not had the time to follow up. I happened to be over on Unity Answers yesterday and saw someone was asking for just this. I figured I should really get this up.
As I stated before, I was going to do a test project and do some profiling to see what performance demands the event system has. Here are a couple screen shots of what the project looks like:
#gallery-1 { margin: auto; } #gallery-1 .gallery-item { float: left; margin-top: 10px; text-align: center; width: 33%; } #gallery-1 img { border: 2px solid #cfcfcf; } #gallery-1 .gallery-caption { margin-left: 0; }




Editor with the sim***nning. Flaming marbles!







Game View and Profiler, you can see the light footprint.

In the Game View screenshot you can see the highlighted method in the Profiler, with how low the consumption is. If you look at the number of draw calls and polycount of the scene, you will see that the amount of performance cost going to rendering makes the event system seem non-existent.
So there you have it, your AS3 event system ported to Unity C#.
I do want to note, however, because I received a bit of criticism for doing this with “why?” so I figure I will explain -
I am from a Flash background myself, like many other Unity devs, but I am now solely a Unity developer. Being out there I see other devs trying to make the jump from Flash to Unity, I have even had to teach a few people to help them do so. I wrote this event system port to provide people making the jump with a familiar system in which to deal with events of various types. I wanted it to look almost exactly the same, given the notable differences of C# and anything ECMAScript.
I really hope that this can ease some of the strain and really get people working with Unity much faster, but I am not attempting to make a substitute for the wonderful native C# event system that is already in place. In fact, I will suggest to anyone that after they become more experienced with the language and Unity that they move to that.
With that said – you can download the Unity Package off of my server here: EQEQ Events System


Cheers!


由 uke  发表


作者: tc    时间: 2012-5-20 23:25
有意思!学习了!

作者: 晃晃    时间: 2012-6-3 23:20
读铁系缘分,顶铁系友情

作者: tc    时间: 2012-6-17 23:23
呵呵,很好,方便罗。

作者: tc    时间: 2012-7-27 23:21
很经典,很实用,学习了!

作者: 菜刀吻电线    时间: 2012-8-3 01:41
水……生命之源……灌……

作者: 菜刀吻电线    时间: 2012-8-13 23:59
有意思!学习了!

作者: 奇    时间: 2012-8-31 01:16
都闪开,介个帖子,偶来顶

作者: tc    时间: 2012-10-3 23:26
加精、加亮滴铁子,尤其要多丁页丁页

作者: tc    时间: 2013-3-19 23:36
凡系斑竹滴话要听;凡系朋友滴帖要顶!





欢迎光临 纳金网 (http://go.narkii.com/club/) Powered by Discuz! X2.5