开发者

Can I pass null as an argument to as3 signals?

开发者 https://www.devze.com 2023-01-13 08:18 出处:网络
I have a signal like this: public var e_collision:Signal = new Signal(GameObj); When the object collides with another, I pass the other object as the argument.

I have a signal like this:

public var e_collision:Signal = new Signal(GameObj);

When the object collides with another, I pass the other object as the argument.

But if the object collides with a wall, the wall is not a GameObj开发者_开发技巧, I would like to know, can I pass null instead?


Why not?

http://www.peterelst.com/blog/2010/01/22/as3-signals-the-best-thing-since-sliced-bread/


I finally had time to test, result: I can pass null as an argument.

0

精彩评论

暂无评论...
验证码 换一张
取 消