Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pangweiwei/slua
Browse files Browse the repository at this point in the history
  • Loading branch information
pangweiwei committed Aug 15, 2018
2 parents 94c714f + e87914f commit 2ec8c72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion help.md
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ byte[]是T[]的特殊形式,一般用于内存字节流,比如网络字节

## 判断GameObject是否为null

因为Unity GameObject被destroy后,并不是真正的null,而是一个被标记了为destroyed的GameObject,而GameObject重载了==操作符,在c#中可以==判断是否为null(虽然它不是null),而这个gameobject被push到lua后,并不能判断==nil,所以slua提供IsNuall函数,用于判断是否GameObject被Destory,或者GetComponent的返回值其实不存在,也可以通过IsNull判断,例如:
因为Unity GameObject被destroy后,并不是真正的null,而是一个被标记了为destroyed的GameObject,而GameObject重载了==操作符,在c#中可以==判断是否为null(虽然它不是null),而这个gameobject被push到lua后,并不能判断==nil,所以slua提供IsNull函数,用于判断是否GameObject被Destory,或者GetComponent的返回值其实不存在,也可以通过IsNull判断,例如:

```lua
local go = GameObject()
Expand Down

0 comments on commit 2ec8c72

Please sign in to comment.