- 最后登录
- 2014-10-23
- 注册时间
- 2011-7-19
- 阅读权限
- 90
- 积分
- 81303
 
- 纳金币
- -1
- 精华
- 11
|
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 发表
|
|